Skip to content

Commit

Permalink
(iOS) Support for ExtraBold alias of Heavy (font-weight 800)
Browse files Browse the repository at this point in the history
Summary:
ExtraBold is a fairly common suffix in font naming. A good example is "Circe-ExtraBold". It's usually synonymous with Heavy or Black at font weight 800, as described here: https://www.webtype.com/info/articles/fonts-weights/

This fixes a regression with ExtraBold fonts introduced in d3007b0 where simply having an extrabold font will cause `weightOfFont` to choose this weight aggressively, resulting in all bold text erroneously interpreted as extrabold/heavy. This fix ensures that extrabold is detected before bold, and correctly attributed to `UIFontWeightHeavy`.
Closes #16323

Differential Revision: D6119059

Pulled By: shergin

fbshipit-source-id: 56a5c30584f220974308a7d6068c8d952aa20fb8
  • Loading branch information
sjmueller authored and facebook-github-bot committed Oct 23, 2017
1 parent 95073f8 commit d38b95f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions React/Views/RCTFont.mm
Expand Up @@ -51,6 +51,7 @@ static RCTFontWeight weightOfFont(UIFont *font)
@"medium",
@"semibold",
@"demibold",
@"extrabold",
@"bold",
@"heavy",
@"black"
Expand All @@ -64,6 +65,7 @@ static RCTFontWeight weightOfFont(UIFont *font)
@(UIFontWeightMedium),
@(UIFontWeightSemibold),
@(UIFontWeightSemibold),
@(UIFontWeightHeavy),
@(UIFontWeightBold),
@(UIFontWeightHeavy),
@(UIFontWeightBlack)
Expand Down

0 comments on commit d38b95f

Please sign in to comment.