| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* cffcmap.c */ | 3 /* cffcmap.c */ |
| 4 /* */ | 4 /* */ |
| 5 /* CFF character mapping table (cmap) support (body). */ | 5 /* CFF character mapping table (cmap) support (body). */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 2002-2007, 2010, 2013 by */ | 7 /* Copyright 2002-2007, 2010, 2013 by */ |
| 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 /* */ | 9 /* */ |
| 10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
| 11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
| 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
| 14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
| 15 /* */ | 15 /* */ |
| 16 /***************************************************************************/ | 16 /***************************************************************************/ |
| 17 | 17 |
| 18 | 18 |
| 19 #include "../../include/ft2build.h" | 19 #include <ft2build.h> |
| 20 #include "../../include/freetype/internal/ftdebug.h" | 20 #include FT_INTERNAL_DEBUG_H |
| 21 #include "cffcmap.h" | 21 #include "cffcmap.h" |
| 22 #include "cffload.h" | 22 #include "cffload.h" |
| 23 | 23 |
| 24 #include "cfferrs.h" | 24 #include "cfferrs.h" |
| 25 | 25 |
| 26 | 26 |
| 27 /*************************************************************************/ | 27 /*************************************************************************/ |
| 28 /*************************************************************************/ | 28 /*************************************************************************/ |
| 29 /***** *****/ | 29 /***** *****/ |
| 30 /***** CFF STANDARD (AND EXPERT) ENCODING CMAPS *****/ | 30 /***** CFF STANDARD (AND EXPERT) ENCODING CMAPS *****/ |
| 31 /***** *****/ | 31 /***** *****/ |
| 32 /*************************************************************************/ | 32 /*************************************************************************/ |
| 33 /*************************************************************************/ | 33 /*************************************************************************/ |
| 34 | 34 |
| 35 FT_CALLBACK_DEF( FT_Error ) | 35 FT_CALLBACK_DEF( FT_Error ) |
| 36 cff_cmap_encoding_init( CFF_CMapStd cmap ) | 36 cff_cmap_encoding_init( CFF_CMapStd cmap, |
| 37 FT_Pointer pointer ) |
| 37 { | 38 { |
| 38 TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); | 39 TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); |
| 39 CFF_Font cff = (CFF_Font)face->extra.data; | 40 CFF_Font cff = (CFF_Font)face->extra.data; |
| 40 CFF_Encoding encoding = &cff->encoding; | 41 CFF_Encoding encoding = &cff->encoding; |
| 41 | 42 |
| 43 FT_UNUSED( pointer ); |
| 44 |
| 42 | 45 |
| 43 cmap->gids = encoding->codes; | 46 cmap->gids = encoding->codes; |
| 44 | 47 |
| 45 return 0; | 48 return 0; |
| 46 } | 49 } |
| 47 | 50 |
| 48 | 51 |
| 49 FT_CALLBACK_DEF( void ) | 52 FT_CALLBACK_DEF( void ) |
| 50 cff_cmap_encoding_done( CFF_CMapStd cmap ) | 53 cff_cmap_encoding_done( CFF_CMapStd cmap ) |
| 51 { | 54 { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 CFF_Font cff = (CFF_Font)face->extra.data; | 131 CFF_Font cff = (CFF_Font)face->extra.data; |
| 129 CFF_Charset charset = &cff->charset; | 132 CFF_Charset charset = &cff->charset; |
| 130 FT_UInt sid = charset->sids[idx]; | 133 FT_UInt sid = charset->sids[idx]; |
| 131 | 134 |
| 132 | 135 |
| 133 return cff_index_get_sid_string( cff, sid ); | 136 return cff_index_get_sid_string( cff, sid ); |
| 134 } | 137 } |
| 135 | 138 |
| 136 | 139 |
| 137 FT_CALLBACK_DEF( FT_Error ) | 140 FT_CALLBACK_DEF( FT_Error ) |
| 138 cff_cmap_unicode_init( PS_Unicodes unicodes ) | 141 cff_cmap_unicode_init( PS_Unicodes unicodes, |
| 142 FT_Pointer pointer ) |
| 139 { | 143 { |
| 140 TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); | 144 TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes ); |
| 141 FT_Memory memory = FT_FACE_MEMORY( face ); | 145 FT_Memory memory = FT_FACE_MEMORY( face ); |
| 142 CFF_Font cff = (CFF_Font)face->extra.data; | 146 CFF_Font cff = (CFF_Font)face->extra.data; |
| 143 CFF_Charset charset = &cff->charset; | 147 CFF_Charset charset = &cff->charset; |
| 144 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; | 148 FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames; |
| 145 | 149 |
| 150 FT_UNUSED( pointer ); |
| 151 |
| 146 | 152 |
| 147 /* can't build Unicode map for CID-keyed font */ | 153 /* can't build Unicode map for CID-keyed font */ |
| 148 /* because we don't know glyph names. */ | 154 /* because we don't know glyph names. */ |
| 149 if ( !charset->sids ) | 155 if ( !charset->sids ) |
| 150 return FT_THROW( No_Unicode_Glyph_Name ); | 156 return FT_THROW( No_Unicode_Glyph_Name ); |
| 151 | 157 |
| 152 return psnames->unicodes_init( memory, | 158 return psnames->unicodes_init( memory, |
| 153 unicodes, | 159 unicodes, |
| 154 cff->num_glyphs, | 160 cff->num_glyphs, |
| 155 (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name, | 161 (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 207 |
| 202 (FT_CMap_InitFunc) cff_cmap_unicode_init, | 208 (FT_CMap_InitFunc) cff_cmap_unicode_init, |
| 203 (FT_CMap_DoneFunc) cff_cmap_unicode_done, | 209 (FT_CMap_DoneFunc) cff_cmap_unicode_done, |
| 204 (FT_CMap_CharIndexFunc)cff_cmap_unicode_char_index, | 210 (FT_CMap_CharIndexFunc)cff_cmap_unicode_char_index, |
| 205 (FT_CMap_CharNextFunc) cff_cmap_unicode_char_next, | 211 (FT_CMap_CharNextFunc) cff_cmap_unicode_char_next, |
| 206 | 212 |
| 207 NULL, NULL, NULL, NULL, NULL | 213 NULL, NULL, NULL, NULL, NULL |
| 208 ) | 214 ) |
| 209 | 215 |
| 210 /* END */ | 216 /* END */ |
| OLD | NEW |