Skip to content

Commit 79474a4

Browse files
authored
fix: ignore fontWeight '0' values (#91)
1 parent 371efbe commit 79474a4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

ios/config/EditorConfig.mm

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,19 @@ - (void)setPrimaryFontFamily:(NSString *)newValue {
6262
- (UIFont *)primaryFont {
6363
if(_primaryFontNeedsRecreation) {
6464
_primaryFontNeedsRecreation = NO;
65+
66+
NSString *newFontWeight = [self primaryFontWeight];
67+
// fix RCTFontWeight conversion warnings:
68+
// sometimes changing font family comes with weight '0' if not specified
69+
// RCTConvert doesn't recognize this value so we just nullify it and it gets a default value
70+
if([newFontWeight isEqualToString:@"0"]) {
71+
newFontWeight = nullptr;
72+
}
73+
6574
_primaryFont = [RCTFont updateFont:nullptr
6675
withFamily:[self primaryFontFamily]
6776
size:[self primaryFontSize]
68-
weight:[self primaryFontWeight]
77+
weight:newFontWeight
6978
style:nullptr
7079
variant:nullptr
7180
scaleMultiplier: 1];

0 commit comments

Comments
 (0)