aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2017-05-20 16:39:53 +0200
committerPhilipp Stephani2017-05-21 21:49:38 +0200
commit0446a5a040f7a0142b33cb70946fcde54914b2ce (patch)
tree9b22ed094dc768fd3bc98bfa8da2d0b7c6e9297a /src
parentd79a4ea632733ac5a0b004728fde737c8952c441 (diff)
downloademacs-0446a5a040f7a0142b33cb70946fcde54914b2ce.tar.gz
emacs-0446a5a040f7a0142b33cb70946fcde54914b2ce.zip
Use NSCharacterCollection instead of CTCharacterCollection
This should not cause behavior changes, but fixes a compiler warning due to implicit conversions between the enums. * src/macfont.m (macfont_cache, macfont_lookup_cache) (macfont_get_glyph_for_cid, macfont_get_uvs_table) (macfont_variation_glyphs): Use NSCharacterCollection.
Diffstat (limited to 'src')
-rw-r--r--src/macfont.m26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/macfont.m b/src/macfont.m
index f356842db18..b859eb43787 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -206,7 +206,7 @@ mac_screen_font_get_advance_width_for_glyph (ScreenFontRef font, CGGlyph glyph)
206 206
207#if !USE_CT_GLYPH_INFO 207#if !USE_CT_GLYPH_INFO
208static CGGlyph 208static CGGlyph
209mac_font_get_glyph_for_cid (CTFontRef font, CTCharacterCollection collection, 209mac_font_get_glyph_for_cid (CTFontRef font, NSCharacterCollection collection,
210 CGFontIndex cid) 210 CGFontIndex cid)
211{ 211{
212 CGGlyph result = kCGFontIndexInvalid; 212 CGGlyph result = kCGFontIndexInvalid;
@@ -1321,8 +1321,8 @@ struct macfont_cache
1321 /* Character collection specifying the destination of the mapping 1321 /* Character collection specifying the destination of the mapping
1322 provided by `table' above. If `table' is obtained from the UVS 1322 provided by `table' above. If `table' is obtained from the UVS
1323 subtable in the font cmap table, then the value of this member 1323 subtable in the font cmap table, then the value of this member
1324 should be kCTCharacterCollectionIdentityMapping. */ 1324 should be NSIdentityMappingCharacterCollection. */
1325 CTCharacterCollection collection; 1325 NSCharacterCollection collection;
1326 } uvs; 1326 } uvs;
1327}; 1327};
1328 1328
@@ -1333,8 +1333,8 @@ static CFCharacterSetRef macfont_get_cf_charset (struct font *);
1333static CFCharacterSetRef macfont_get_cf_charset_for_name (CFStringRef); 1333static CFCharacterSetRef macfont_get_cf_charset_for_name (CFStringRef);
1334static CGGlyph macfont_get_glyph_for_character (struct font *, UTF32Char); 1334static CGGlyph macfont_get_glyph_for_character (struct font *, UTF32Char);
1335static CGGlyph macfont_get_glyph_for_cid (struct font *font, 1335static CGGlyph macfont_get_glyph_for_cid (struct font *font,
1336 CTCharacterCollection, CGFontIndex); 1336 NSCharacterCollection, CGFontIndex);
1337static CFDataRef macfont_get_uvs_table (struct font *, CTCharacterCollection *); 1337static CFDataRef macfont_get_uvs_table (struct font *, NSCharacterCollection *);
1338 1338
1339static struct macfont_cache * 1339static struct macfont_cache *
1340macfont_lookup_cache (CFStringRef key) 1340macfont_lookup_cache (CFStringRef key)
@@ -1582,7 +1582,7 @@ macfont_get_glyph_for_character (struct font *font, UTF32Char c)
1582} 1582}
1583 1583
1584static CGGlyph 1584static CGGlyph
1585macfont_get_glyph_for_cid (struct font *font, CTCharacterCollection collection, 1585macfont_get_glyph_for_cid (struct font *font, NSCharacterCollection collection,
1586 CGFontIndex cid) 1586 CGFontIndex cid)
1587{ 1587{
1588 struct macfont_info *macfont_info = (struct macfont_info *) font; 1588 struct macfont_info *macfont_info = (struct macfont_info *) font;
@@ -1593,7 +1593,7 @@ macfont_get_glyph_for_cid (struct font *font, CTCharacterCollection collection,
1593} 1593}
1594 1594
1595static CFDataRef 1595static CFDataRef
1596macfont_get_uvs_table (struct font *font, CTCharacterCollection *collection) 1596macfont_get_uvs_table (struct font *font, NSCharacterCollection *collection)
1597{ 1597{
1598 struct macfont_info *macfont_info = (struct macfont_info *) font; 1598 struct macfont_info *macfont_info = (struct macfont_info *) font;
1599 CTFontRef macfont = macfont_info->macfont; 1599 CTFontRef macfont = macfont_info->macfont;
@@ -1603,12 +1603,12 @@ macfont_get_uvs_table (struct font *font, CTCharacterCollection *collection)
1603 if (cache->uvs.table == NULL) 1603 if (cache->uvs.table == NULL)
1604 { 1604 {
1605 CFDataRef uvs_table = mac_font_copy_uvs_table (macfont); 1605 CFDataRef uvs_table = mac_font_copy_uvs_table (macfont);
1606 CTCharacterCollection uvs_collection = 1606 NSCharacterCollection uvs_collection =
1607 kCTCharacterCollectionIdentityMapping; 1607 NSIdentityMappingCharacterCollection;
1608 1608
1609 if (uvs_table == NULL 1609 if (uvs_table == NULL
1610 && mac_font_get_glyph_for_cid (macfont, 1610 && mac_font_get_glyph_for_cid (macfont,
1611 kCTCharacterCollectionAdobeJapan1, 1611 NSAdobeJapan1CharacterCollection,
1612 6480) != kCGFontIndexInvalid) 1612 6480) != kCGFontIndexInvalid)
1613 { 1613 {
1614 /* If the glyph for U+4E55 is accessible via its CID 6480, 1614 /* If the glyph for U+4E55 is accessible via its CID 6480,
@@ -1625,7 +1625,7 @@ macfont_get_uvs_table (struct font *font, CTCharacterCollection *collection)
1625 if (mac_uvs_table_adobe_japan1) 1625 if (mac_uvs_table_adobe_japan1)
1626 { 1626 {
1627 uvs_table = CFRetain (mac_uvs_table_adobe_japan1); 1627 uvs_table = CFRetain (mac_uvs_table_adobe_japan1);
1628 uvs_collection = kCTCharacterCollectionAdobeJapan1; 1628 uvs_collection = NSAdobeJapan1CharacterCollection;
1629 } 1629 }
1630 } 1630 }
1631 if (uvs_table == NULL) 1631 if (uvs_table == NULL)
@@ -3348,7 +3348,7 @@ static int
3348macfont_variation_glyphs (struct font *font, int c, unsigned variations[256]) 3348macfont_variation_glyphs (struct font *font, int c, unsigned variations[256])
3349{ 3349{
3350 CFDataRef uvs_table; 3350 CFDataRef uvs_table;
3351 CTCharacterCollection uvs_collection; 3351 NSCharacterCollection uvs_collection;
3352 int i, n = 0; 3352 int i, n = 0;
3353 3353
3354 block_input (); 3354 block_input ();
@@ -3368,7 +3368,7 @@ macfont_variation_glyphs (struct font *font, int c, unsigned variations[256])
3368 { 3368 {
3369 CGGlyph glyph = glyphs[i]; 3369 CGGlyph glyph = glyphs[i];
3370 3370
3371 if (uvs_collection != kCTCharacterCollectionIdentityMapping 3371 if (uvs_collection != NSIdentityMappingCharacterCollection
3372 && glyph != kCGFontIndexInvalid) 3372 && glyph != kCGFontIndexInvalid)
3373 glyph = macfont_get_glyph_for_cid (font, uvs_collection, glyph); 3373 glyph = macfont_get_glyph_for_cid (font, uvs_collection, glyph);
3374 if (glyph == kCGFontIndexInvalid) 3374 if (glyph == kCGFontIndexInvalid)