summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cairo-quartz-font.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c
index 621d3540c..b7efc54de 100644
--- a/src/cairo-quartz-font.c
+++ b/src/cairo-quartz-font.c
@@ -165,6 +165,17 @@ _cairo_quartz_font_face_create_for_toy (cairo_toy_font_face_t *toy_face,
cgFont = CGFontCreateWithFontName (FontName);
CFRelease (FontName);
+ if (!cgFont) {
+ /* Attempt to create font by replacing hyphens for spaces in font name. */
+ for (size_t i = 0; i < strlen (full_name); i++) {
+ if (full_name[i] == '-')
+ full_name[i] = ' ';
+ }
+ FontName = CFStringCreateWithCString (NULL, full_name, kCFStringEncodingASCII);
+ cgFont = CGFontCreateWithFontName (FontName);
+ CFRelease (FontName);
+ }
+
if (cgFont)
break;
}