linux-packaging-mono/external/bockbuild/packages/patches/pango-system-font-check-version.patch
Xamarin Public Jenkins (auto-signing) 6bdd276d05 Imported Upstream version 5.0.0.42
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
2017-04-10 11:41:01 +00:00

71 lines
3.1 KiB
Diff

diff --git a/pango/pangocairo-coretextfontmap.c b/pango/pangocairo-coretextfontmap.c
index 6cb3809..c75737c 100644
--- a/pango/pangocairo-coretextfontmap.c
+++ b/pango/pangocairo-coretextfontmap.c
@@ -185,9 +185,13 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap,
PangoContext *context,
const PangoFontDescription *description)
{
- char *descname = pango_font_description_get_family (description);
+ const char *descname = pango_font_description_get_family (description);
+ SInt32 major, minor;
- if (strcmp (descname, "-apple-system-font") == 0)
+ Gestalt (gestaltSystemVersionMajor, &major);
+ Gestalt (gestaltSystemVersionMinor, &minor);
+
+ if (major == 10 && minor>= 11 && strcmp (descname, "-apple-system-font") == 0)
{
PangoCoreTextFont *cfont;
NSFont *sysfont;
@@ -195,7 +199,6 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap,
cairo_matrix_t font_matrix;
PangoCoreTextFontsetKey fontset_key;
PangoCoreTextFontKey key;
- PangoLanguage *language;
PangoFontDescription *tmp_desc;
gboolean synthetic_italic = FALSE;
double abs_size = get_scaled_size (fontmap, context, description);
@@ -207,7 +210,7 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap,
PangoCairoCoreTextFont *cafont = g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT, NULL);
cfont = PANGO_CORE_TEXT_FONT (cafont);
cafont->abs_size = abs_size;
- _pango_core_text_font_set_ctfont (cfont, CFRetain (sysfont));
+ _pango_core_text_font_set_ctfont (cfont, (CTFontRef)CFRetain (sysfont));
tmp_desc = pango_font_description_copy_static (description);
@@ -261,7 +264,7 @@ pango_cairo_core_text_font_map_load_font (PangoCoreTextFontMap *fontmap,
}
}
- return PANGO_FONT_MAP_CLASS (pango_cairo_core_text_font_map_parent_class)->load_font (fontmap, context, description);
+ return (PangoCoreTextFont*) PANGO_FONT_MAP_CLASS (pango_cairo_core_text_font_map_parent_class)->load_font (PANGO_FONT_MAP (fontmap), context, description);
}
static void
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c
index 4234bf1..c395c91 100644
--- a/pango/pangocoretext-fontmap.c
+++ b/pango/pangocoretext-fontmap.c
@@ -1367,6 +1367,7 @@ pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap)
CTFontCollectionRef collection;
CFArrayRef ctfaces;
CFIndex i, count;
+ SInt32 major, minor;
ctfontmap->serial = 1;
ctfontmap->families = g_hash_table_new_full (g_str_hash, g_str_equal,
@@ -1430,7 +1431,10 @@ pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap)
CFRelease (dict);
}
- if (true)
+ Gestalt (gestaltSystemVersionMajor, &major);
+ Gestalt (gestaltSystemVersionMinor, &minor);
+
+ if (major == 10 && minor >= 11)
{
NSFont *sysfont = [NSFont systemFontOfSize: 0.0];
NSString *name = [[NSFont fontWithName: [[sysfont fontDescriptor] postscriptName] size: 0.0] familyName];