diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2015-07-13 19:14:25 +0900 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2015-07-13 19:14:25 +0900 |
commit | a1f783824fb7aa21cd4a413b7876d7ceba351982 (patch) | |
tree | 390e28693d1ca37a6cc1ae5fa9612350cc3b4a07 | |
parent | 455fe1a7f1cf5cf6b7f1fc99bb8b05c633503c1d (diff) | |
download | emacs-a1f783824fb7aa21cd4a413b7876d7ceba351982.tar.gz |
Avoid deprecated enums in mac-ct font backend driver
* 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.
-rw-r--r-- | src/macfont.m | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/macfont.m b/src/macfont.m index b25640e0cb8..02dc46824e9 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -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) { |