Skip to content

Commit 73c3aa8

Browse files
wildseansyfacebook-github-bot
authored andcommitted
(iOS) Support for DemiBold alias of SemiBold (font-weight 600)
Summary: For more information on font weight naming see [this post](https://www.quora.com/What-is-the-difference-between-Medium-Demi-and-Semibold-fonts). DemiBold is fairly common in font naming. For example, iOS React Native lacks support of "AvNext-DemiBold". Also removed warning about `NSUInteger` <=> `NSInteger` comparison, by making `i` an `NSUInteger` Before and after screenshots: ![before-fix](https://user-images.githubusercontent.com/177857/30182567-1dfebcb0-93cc-11e7-9b51-78ef6f41c447.png) ![after-fix](https://user-images.githubusercontent.com/177857/30182570-1f90ea94-93cc-11e7-8f68-008ae648ffbe.png) Add any DemiBold font to an iOS react native project. Set fontWeight to `'600'` on a `<Text />` component. The font weight should be applied appropriately. Closes #15856 Differential Revision: D5800928 Pulled By: shergin fbshipit-source-id: 9095e3e150847f9cb828aa5d080567846441e55d
1 parent 4ca6172 commit 73c3aa8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

React/Views/RCTFont.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static RCTFontWeight weightOfFont(UIFont *font)
5050
@"regular",
5151
@"medium",
5252
@"semibold",
53+
@"demibold",
5354
@"bold",
5455
@"heavy",
5556
@"black"
@@ -62,6 +63,7 @@ static RCTFontWeight weightOfFont(UIFont *font)
6263
@(UIFontWeightRegular),
6364
@(UIFontWeightMedium),
6465
@(UIFontWeightSemibold),
66+
@(UIFontWeightSemibold),
6567
@(UIFontWeightBold),
6668
@(UIFontWeightHeavy),
6769
@(UIFontWeightBlack)

0 commit comments

Comments
 (0)