From 73c3aa8d326a24608e88949e71dbb910b604dede Mon Sep 17 00:00:00 2001 From: Sean Holbert Date: Fri, 8 Sep 2017 22:48:36 -0700 Subject: [PATCH] (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 `` component. The font weight should be applied appropriately. Closes https://github.com/facebook/react-native/pull/15856 Differential Revision: D5800928 Pulled By: shergin fbshipit-source-id: 9095e3e150847f9cb828aa5d080567846441e55d --- React/Views/RCTFont.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/React/Views/RCTFont.mm b/React/Views/RCTFont.mm index c75a2b96702fba..20e86f0f9dfff0 100644 --- a/React/Views/RCTFont.mm +++ b/React/Views/RCTFont.mm @@ -50,6 +50,7 @@ static RCTFontWeight weightOfFont(UIFont *font) @"regular", @"medium", @"semibold", + @"demibold", @"bold", @"heavy", @"black" @@ -62,6 +63,7 @@ static RCTFontWeight weightOfFont(UIFont *font) @(UIFontWeightRegular), @(UIFontWeightMedium), @(UIFontWeightSemibold), + @(UIFontWeightSemibold), @(UIFontWeightBold), @(UIFontWeightHeavy), @(UIFontWeightBlack)