12
12
#import < React/RCTLog.h>
13
13
14
14
NSString *const RCTTextAttributesIsHighlightedAttributeName = @" RCTTextAttributesIsHighlightedAttributeName" ;
15
+ NSString *const RCTTextAttributesFontSmoothingAttributeName = @" RCTTextAttributesFontSmoothingAttributeName" ; // TODO(OSS Candidate ISS#2710739)
15
16
NSString *const RCTTextAttributesTagAttributeName = @" RCTTextAttributesTagAttributeName" ;
16
17
17
18
@implementation RCTTextAttributes
@@ -56,6 +57,7 @@ - (void)applyTextAttributes:(RCTTextAttributes *)textAttributes
56
57
_fontVariant = textAttributes->_fontVariant ?: _fontVariant;
57
58
_allowFontScaling = textAttributes->_allowFontScaling || _allowFontScaling; // *
58
59
_letterSpacing = !isnan (textAttributes->_letterSpacing ) ? textAttributes->_letterSpacing : _letterSpacing;
60
+ _fontSmoothing = textAttributes->_fontSmoothing != RCTFontSmoothingAuto ? textAttributes->_fontSmoothing : _fontSmoothing; // TODO(OSS Candidate ISS#2710739)
59
61
60
62
// Paragraph Styles
61
63
_lineHeight = !isnan (textAttributes->_lineHeight ) ? textAttributes->_lineHeight : _lineHeight;
@@ -183,6 +185,12 @@ - (NSParagraphStyle *)effectiveParagraphStyle
183
185
attributes[RCTTextAttributesIsHighlightedAttributeName] = @YES ;
184
186
}
185
187
188
+ // [TODO(macOS ISS#2323203)
189
+ if (_fontSmoothing != RCTFontSmoothingAuto) {
190
+ attributes[RCTTextAttributesFontSmoothingAttributeName] = @(_fontSmoothing);
191
+ }
192
+ // ]TODO(macOS ISS#2323203)
193
+
186
194
if (_tag) {
187
195
attributes[RCTTextAttributesTagAttributeName] = _tag;
188
196
}
@@ -290,6 +298,7 @@ - (BOOL)isEqual:(RCTTextAttributes *)textAttributes
290
298
RCTTextAttributesCompareObjects (_fontVariant) &&
291
299
RCTTextAttributesCompareOthers (_allowFontScaling) &&
292
300
RCTTextAttributesCompareFloats (_letterSpacing) &&
301
+ RCTTextAttributesCompareOthers (_fontSmoothing) && // TODO(OSS Candidate ISS#2710739)
293
302
// Paragraph Styles
294
303
RCTTextAttributesCompareFloats (_lineHeight) &&
295
304
RCTTextAttributesCompareFloats (_alignment) &&
@@ -309,4 +318,16 @@ - (BOOL)isEqual:(RCTTextAttributes *)textAttributes
309
318
RCTTextAttributesCompareOthers (_textTransform);
310
319
}
311
320
321
+ // [TODO(OSS Candidate ISS#2710739)
322
+ static RCTFontSmoothing _fontSmoothingDefault = RCTFontSmoothingAuto;
323
+
324
+ + (RCTFontSmoothing)fontSmoothingDefault {
325
+ return _fontSmoothingDefault;
326
+ }
327
+
328
+ + (void )setFontSmoothingDefault : (RCTFontSmoothing)fontSmoothingDefault {
329
+ _fontSmoothingDefault = fontSmoothingDefault;
330
+ }
331
+ // ]TODO(OSS Candidate ISS#2710739)
332
+
312
333
@end
0 commit comments