Skip to content

Commit

Permalink
Fix missing font constants on iOS7
Browse files Browse the repository at this point in the history
Reviewed By: dinhviethoa

Differential Revision: D3682528

fbshipit-source-id: 7e3a0b7c2c043a869f2f5dfe9aaf404897076d0b
  • Loading branch information
javache authored and Facebook Github Bot 4 committed Aug 7, 2016
1 parent 20c6d11 commit 6b9406e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions React/Views/RCTFont.mm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@

#import <mutex>

#if !defined(__IPHONE_8_2) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_2

// These constants are defined in iPhone SDK 8.2, but the app cannot run on
// iOS < 8.2 unless we redefine them here. If you target iOS 8.2 or above
// as a base target, the standard constants will be used instead.
// These constants can only be removed when React Native drops iOS8 support.

#define UIFontWeightUltraLight -0.8
#define UIFontWeightThin -0.6
#define UIFontWeightLight -0.4
#define UIFontWeightRegular 0
#define UIFontWeightMedium 0.23
#define UIFontWeightSemibold 0.3
#define UIFontWeightBold 0.4
#define UIFontWeightHeavy 0.56
#define UIFontWeightBlack 0.62

#endif

typedef CGFloat RCTFontWeight;
static RCTFontWeight weightOfFont(UIFont *font)
{
Expand Down

0 comments on commit 6b9406e

Please sign in to comment.