summaryrefslogtreecommitdiff
path: root/src/os/macosx/macos.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/macosx/macos.mm')
-rw-r--r--src/os/macosx/macos.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/os/macosx/macos.mm b/src/os/macosx/macos.mm
index 38ddae8ee..1b1a1d5a7 100644
--- a/src/os/macosx/macos.mm
+++ b/src/os/macosx/macos.mm
@@ -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;
+}