NSFont: define font weight constants

Define font weight constants introduced in macOS 10.11.
This commit is contained in:
Daniel Ferreira 2017-08-10 13:25:35 +10:00 committed by Ivan Vučica
parent 5a66de7139
commit 5e8b278e93
2 changed files with 23 additions and 0 deletions

View file

@ -288,4 +288,17 @@ APPKIT_EXPORT NSString *NSAFMVersion;
APPKIT_EXPORT NSString *NSAFMWeight;
APPKIT_EXPORT NSString *NSAFMXHeight;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_11, GS_API_LATEST)
typedef CGFloat NSFontWeight;
APPKIT_EXPORT const CGFloat NSFontWeightUltraLight;
APPKIT_EXPORT const CGFloat NSFontWeightThin;
APPKIT_EXPORT const CGFloat NSFontWeightLight;
APPKIT_EXPORT const CGFloat NSFontWeightRegular;
APPKIT_EXPORT const CGFloat NSFontWeightMedium;
APPKIT_EXPORT const CGFloat NSFontWeightSemibold;
APPKIT_EXPORT const CGFloat NSFontWeightBold;
APPKIT_EXPORT const CGFloat NSFontWeightHeavy;
APPKIT_EXPORT const CGFloat NSFontWeightBlack;
#endif
#endif // _GNUstep_H_NSFont

View file

@ -147,6 +147,16 @@ const CGFloat NSGray = 0.5;
const CGFloat NSLightGray = .667;
const CGFloat NSWhite = 1;
const CGFloat NSFontWeightUltraLight = -0.8;
const CGFloat NSFontWeightThin = -0.6;
const CGFloat NSFontWeightLight = -0.4;
const CGFloat NSFontWeightRegular = 0;
const CGFloat NSFontWeightMedium = 0.23;
const CGFloat NSFontWeightSemibold = 0.3;
const CGFloat NSFontWeightBold = 0.4;
const CGFloat NSFontWeightHeavy = 0.56;
const CGFloat NSFontWeightBlack = 0.62;
// NSColor notification
NSString *NSSystemColorsDidChangeNotification =
@"NSSystemColorsDidChangeNotification";