10
10
#include < react/renderer/textlayoutmanager/RCTFontProperties.h>
11
11
#include < react/renderer/textlayoutmanager/RCTFontUtils.h>
12
12
13
- using namespace facebook::react;
14
-
15
- inline static NSTextAlignment RCTNSTextAlignmentFromTextAlignment (TextAlignment textAlignment)
13
+ inline static NSTextAlignment RCTNSTextAlignmentFromTextAlignment (facebook::react::TextAlignment textAlignment)
16
14
{
17
15
switch (textAlignment) {
18
- case TextAlignment::Natural:
16
+ case facebook::react:: TextAlignment::Natural:
19
17
return NSTextAlignmentNatural;
20
- case TextAlignment::Left:
18
+ case facebook::react:: TextAlignment::Left:
21
19
return NSTextAlignmentLeft;
22
- case TextAlignment::Right:
20
+ case facebook::react:: TextAlignment::Right:
23
21
return NSTextAlignmentRight;
24
- case TextAlignment::Center:
22
+ case facebook::react:: TextAlignment::Center:
25
23
return NSTextAlignmentCenter;
26
- case TextAlignment::Justified:
24
+ case facebook::react:: TextAlignment::Justified:
27
25
return NSTextAlignmentJustified;
28
26
}
29
27
}
30
28
31
- inline static NSWritingDirection RCTNSWritingDirectionFromWritingDirection (WritingDirection writingDirection)
29
+ inline static NSWritingDirection RCTNSWritingDirectionFromWritingDirection (
30
+ facebook::react::WritingDirection writingDirection)
32
31
{
33
32
switch (writingDirection) {
34
- case WritingDirection::Natural:
33
+ case facebook::react:: WritingDirection::Natural:
35
34
return NSWritingDirectionNatural;
36
- case WritingDirection::LeftToRight:
35
+ case facebook::react:: WritingDirection::LeftToRight:
37
36
return NSWritingDirectionLeftToRight;
38
- case WritingDirection::RightToLeft:
37
+ case facebook::react:: WritingDirection::RightToLeft:
39
38
return NSWritingDirectionRightToLeft;
40
39
}
41
40
}
42
41
43
- inline static NSLineBreakStrategy RCTNSLineBreakStrategyFromLineBreakStrategy (LineBreakStrategy lineBreakStrategy)
42
+ inline static NSLineBreakStrategy RCTNSLineBreakStrategyFromLineBreakStrategy (
43
+ facebook::react::LineBreakStrategy lineBreakStrategy)
44
44
{
45
45
switch (lineBreakStrategy) {
46
- case LineBreakStrategy::None:
46
+ case facebook::react:: LineBreakStrategy::None:
47
47
return NSLineBreakStrategyNone;
48
- case LineBreakStrategy::PushOut:
48
+ case facebook::react:: LineBreakStrategy::PushOut:
49
49
return NSLineBreakStrategyPushOut;
50
- case LineBreakStrategy::HangulWordPriority:
50
+ case facebook::react:: LineBreakStrategy::HangulWordPriority:
51
51
if (@available (iOS 14.0 , *)) {
52
52
return NSLineBreakStrategyHangulWordPriority;
53
53
} else {
54
54
return NSLineBreakStrategyNone;
55
55
}
56
- case LineBreakStrategy::Standard:
56
+ case facebook::react:: LineBreakStrategy::Standard:
57
57
if (@available (iOS 14.0 , *)) {
58
58
return NSLineBreakStrategyStandard;
59
59
} else {
@@ -62,38 +62,39 @@ inline static NSLineBreakStrategy RCTNSLineBreakStrategyFromLineBreakStrategy(Li
62
62
}
63
63
}
64
64
65
- inline static RCTFontStyle RCTFontStyleFromFontStyle (FontStyle fontStyle)
65
+ inline static RCTFontStyle RCTFontStyleFromFontStyle (facebook::react:: FontStyle fontStyle)
66
66
{
67
67
switch (fontStyle) {
68
- case FontStyle::Normal:
68
+ case facebook::react:: FontStyle::Normal:
69
69
return RCTFontStyleNormal;
70
- case FontStyle::Italic:
70
+ case facebook::react:: FontStyle::Italic:
71
71
return RCTFontStyleItalic;
72
- case FontStyle::Oblique:
72
+ case facebook::react:: FontStyle::Oblique:
73
73
return RCTFontStyleOblique;
74
74
}
75
75
}
76
76
77
- inline static RCTFontVariant RCTFontVariantFromFontVariant (FontVariant fontVariant)
77
+ inline static RCTFontVariant RCTFontVariantFromFontVariant (facebook::react:: FontVariant fontVariant)
78
78
{
79
79
return (RCTFontVariant)fontVariant;
80
80
}
81
81
82
- inline static NSUnderlineStyle RCTNSUnderlineStyleFromTextDecorationStyle (TextDecorationStyle textDecorationStyle)
82
+ inline static NSUnderlineStyle RCTNSUnderlineStyleFromTextDecorationStyle (
83
+ facebook::react::TextDecorationStyle textDecorationStyle)
83
84
{
84
85
switch (textDecorationStyle) {
85
- case TextDecorationStyle::Solid:
86
+ case facebook::react:: TextDecorationStyle::Solid:
86
87
return NSUnderlineStyleSingle;
87
- case TextDecorationStyle::Double:
88
+ case facebook::react:: TextDecorationStyle::Double:
88
89
return NSUnderlineStyleDouble;
89
- case TextDecorationStyle::Dashed:
90
+ case facebook::react:: TextDecorationStyle::Dashed:
90
91
return NSUnderlinePatternDash | NSUnderlineStyleSingle;
91
- case TextDecorationStyle::Dotted:
92
+ case facebook::react:: TextDecorationStyle::Dotted:
92
93
return NSUnderlinePatternDot | NSUnderlineStyleSingle;
93
94
}
94
95
}
95
96
96
- inline static UIColor *RCTUIColorFromSharedColor (const SharedColor &sharedColor)
97
+ inline static UIColor *RCTUIColorFromSharedColor (const facebook::react:: SharedColor &sharedColor)
97
98
{
98
99
if (!sharedColor) {
99
100
return nil ;
0 commit comments