(svn r25663) -Fix [FS#4857]: [OSX] Monospace font detection.
This commit is contained in:
@@ -36,4 +36,6 @@ static inline bool MacOSVersionIsAtLeast(long major, long minor, long bugfix)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsMonospaceFont(CFStringRef name);
|
||||
|
||||
#endif /* MACOS_H */
|
||||
|
@@ -193,3 +193,15 @@ uint GetCPUCoreCount()
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a font is a monospace font.
|
||||
* @param name Name of the font.
|
||||
* @return True if the font is a monospace font.
|
||||
*/
|
||||
bool IsMonospaceFont(CFStringRef name)
|
||||
{
|
||||
NSFont *font = [ NSFont fontWithName:(NSString *)name size:0.0f ];
|
||||
|
||||
return font != NULL ? [ font isFixedPitch ] : false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user