]> code.delx.au - gnu-emacs/commitdiff
Avoid deprecated enums in mac-ct font backend driver
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Mon, 13 Jul 2015 10:14:25 +0000 (19:14 +0900)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Mon, 13 Jul 2015 10:14:25 +0000 (19:14 +0900)
* src/macfont.m (mac_font_copy_default_descriptors_for_language)
(mac_ctfont_get_advance_width_for_glyph)
(mac_ctfont_get_bounding_rect_for_glyph): Avoid deprecated enums.

src/macfont.m

index b25640e0cb86e13e65bd6914c4184e0bf6439a5f..02dc46824e993106bdb9ae2e0a9d61d4e0c1070e 100644 (file)
@@ -3521,15 +3521,25 @@ mac_ctfont_create_preferred_family_for_attributes (CFDictionaryRef attributes)
 static inline double
 mac_ctfont_get_advance_width_for_glyph (CTFontRef font, CGGlyph glyph)
 {
-  return CTFontGetAdvancesForGlyphs (font, kCTFontDefaultOrientation,
-                                     &glyph, NULL, 1);
+  return CTFontGetAdvancesForGlyphs (font,
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+                                    kCTFontOrientationDefault,
+#else
+                                    kCTFontDefaultOrientation,
+#endif
+                                    &glyph, NULL, 1);
 }
 
 static inline CGRect
 mac_ctfont_get_bounding_rect_for_glyph (CTFontRef font, CGGlyph glyph)
 {
-  return CTFontGetBoundingRectsForGlyphs (font, kCTFontDefaultOrientation,
-                                          &glyph, NULL, 1);
+  return CTFontGetBoundingRectsForGlyphs (font,
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+                                         kCTFontOrientationDefault,
+#else
+                                         kCTFontDefaultOrientation,
+#endif
+                                         &glyph, NULL, 1);
 }
 
 static CFArrayRef
@@ -3891,7 +3901,7 @@ mac_font_copy_default_descriptors_for_language (CFStringRef language)
 #endif
     {
       CTFontRef user_font =
-        CTFontCreateUIFontForLanguage (kCTFontUserFontType, 0, language);
+       CTFontCreateUIFontForLanguage (kCTFontUIFontUser, 0, language);
 
       if (user_font)
         {