[ReactNative] Honor fontWeight once again

This commit is contained in:
Kevin Gozali 2015-04-30 12:21:06 -07:00
parent eb0476074f
commit b6646d1c4c
1 changed files with 5 additions and 5 deletions

View File

@ -733,11 +733,6 @@ static BOOL RCTFontIsCondensed(UIFont *font)
isItalic = [self RCTFontStyle:style];
}
// Get font weight
if (weight) {
fontWeight = [self RCTFontWeight:weight];
}
// Gracefully handle being given a font name rather than font family, for
// example: "Helvetica Light Oblique" rather than just "Helvetica".
if ([UIFont fontNamesForFamilyName:familyName].count == 0) {
@ -756,6 +751,11 @@ static BOOL RCTFontIsCondensed(UIFont *font)
}
}
// Get font weight
if (weight) {
fontWeight = [self RCTFontWeight:weight];
}
// Get the closest font that matches the given weight for the fontFamily
UIFont *bestMatch = [UIFont fontWithName:font.fontName size: fontSize];
CGFloat closestWeight;