Skip to content

Commit

Permalink
[ReactNative] Honor fontWeight once again
Browse files Browse the repository at this point in the history
  • Loading branch information
fkgozali committed Apr 30, 2015
1 parent eb04760 commit b6646d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions React/Base/RCTConvert.m
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,6 @@ + (UIFont *)UIFont:(UIFont *)font withFamily:(id)family
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) {
Expand All @@ -756,6 +751,11 @@ + (UIFont *)UIFont:(UIFont *)font withFamily:(id)family
}
}

// 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;
Expand Down

0 comments on commit b6646d1

Please sign in to comment.