[ReactNative] <Text>: apply the fontWeight correctly if fontFamily style is also present

This commit is contained in:
Kevin Gozali
2015-04-08 19:17:26 -07:00
parent ae76d3982b
commit e5aeb31d6f

View File

@@ -670,11 +670,6 @@ static BOOL RCTFontIsCondensed(UIFont *font)
isCondensed = RCTFontIsCondensed(font);
}
// Get font weight
if (weight) {
fontWeight = [self RCTFontWeight:weight];
}
// Get font style
if (style) {
isItalic = [self RCTFontStyle:style];
@@ -700,6 +695,11 @@ static BOOL RCTFontIsCondensed(UIFont *font)
}
}
// Get font weight
if (weight) {
fontWeight = [self RCTFontWeight:weight];
}
// Get closest match
UIFont *bestMatch = font;
CGFloat closestWeight = font ? RCTWeightOfFont(font) : INFINITY;