20 #include FT_INTERNAL_DEBUG_H 21 #include FT_INTERNAL_OBJECTS_H 22 #include FT_SERVICE_POSTSCRIPT_CMAPS_H 31 #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES 34 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST 37 #define VARIANT_BIT 0x80000000UL 38 #define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) ) 47 ps_unicode_value(
const char* glyph_name )
51 if ( glyph_name[0] ==
'u' &&
52 glyph_name[1] ==
'n' &&
53 glyph_name[2] ==
'i' )
63 const char*
p = glyph_name + 3;
66 for ( count = 4; count > 0; count--, p++ )
72 d = (
unsigned char)c -
'0';
75 d = (
unsigned char)c -
'A';
88 value = ( value << 4 ) + d;
97 return (
FT_UInt32)( value | VARIANT_BIT );
103 if ( glyph_name[0] ==
'u' )
107 const char* p = glyph_name + 1;
110 for ( count = 6; count > 0; count--, p++ )
116 d = (
unsigned char)c -
'0';
119 d = (
unsigned char)c -
'A';
129 value = ( value << 4 ) + d;
137 return (
FT_UInt32)( value | VARIANT_BIT );
144 const char* p = glyph_name;
150 if ( *p ==
'.' && p > glyph_name )
159 return (
FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
161 return (
FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
169 compare_uni_maps(
const void*
a,
179 if ( unicode1 == unicode2 )
190 if ( unicode1 > unicode2 )
192 else if ( unicode1 < unicode2 )
203 #define EXTRA_GLYPH_LIST_SIZE 10 205 static const FT_UInt32 ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =
221 static const char ft_extra_glyph_names[] =
223 'D',
'e',
'l',
't',
'a',0,
224 'O',
'm',
'e',
'g',
'a',0,
225 'f',
'r',
'a',
'c',
't',
'i',
'o',
'n',0,
226 'h',
'y',
'p',
'h',
'e',
'n',0,
227 'm',
'a',
'c',
'r',
'o',
'n',0,
229 'p',
'e',
'r',
'i',
'o',
'd',
'c',
'e',
'n',
't',
'e',
'r',
'e',
'd',0,
230 's',
'p',
'a',
'c',
'e',0,
231 'T',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0,
232 't',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0
236 ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =
252 ps_check_extra_glyph_name(
const char* gname,
260 for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
263 ft_extra_glyph_name_offsets[n], gname ) == 0 )
265 if ( states[n] == 0 )
269 extra_glyphs[
n] = glyph;
279 ps_check_extra_glyph_unicode(
FT_UInt32 uni_char,
285 for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
287 if ( uni_char == ft_extra_glyph_unicodes[n] )
309 FT_UInt extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
310 FT_UInt extra_glyphs[EXTRA_GLYPH_LIST_SIZE];
327 for ( n = 0; n < num_glyphs; n++ )
329 const char* gname = get_glyph_name( glyph_data, n );
334 ps_check_extra_glyph_name( gname, n,
335 extra_glyphs, extra_glyph_list_states );
336 uni_char = ps_unicode_value( gname );
338 if ( BASE_GLYPH( uni_char ) != 0 )
340 ps_check_extra_glyph_unicode( uni_char,
341 extra_glyph_list_states );
347 if ( free_glyph_name )
348 free_glyph_name( glyph_data, gname );
352 for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
354 if ( extra_glyph_list_states[n] == 1 )
359 map->
unicode = ft_extra_glyph_unicodes[
n];
373 error =
FT_THROW( No_Unicode_Glyph_Name );
378 if ( count < num_glyphs / 2 )
414 mid = min + ( ( max -
min ) >> 1 );
422 base_glyph = BASE_GLYPH( mid->
unicode );
424 if ( base_glyph == unicode )
430 if ( base_glyph < unicode )
461 mid = min + ( ( max -
min ) >> 1 );
462 map = table->
maps + mid;
464 if ( map->
unicode == char_code )
470 base_glyph = BASE_GLYPH( map->
unicode );
472 if ( base_glyph == char_code )
475 if ( base_glyph < char_code )
487 if ( min < table->num_maps )
491 char_code = BASE_GLYPH( map->
unicode );
496 *unicode = char_code;
505 ps_get_macintosh_name(
FT_UInt name_index )
510 return ft_standard_glyph_names + ft_mac_names[name_index];
520 return ft_standard_glyph_names + ft_sid_names[
sid];
524 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST 536 t1_standard_encoding,
551 t1_standard_encoding,
564 const char* service_id )
567 #ifdef FT_CONFIG_OPTION_PIC 586 #ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES 587 #define PUT_PS_NAMES_SERVICE( a ) NULL 589 #define PUT_PS_NAMES_SERVICE( a ) a 593 psnames_module_class,
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
FT_Error(* FT_Module_Constructor)(FT_Module module)
GLboolean GLboolean GLboolean GLboolean a
#define FT_DEFINE_MODULE( class_, flags_, size_, name_, version_, requires_, interface_, init_, done_, get_interface_)
return FT_THROW(Missing_Property)
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS
#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLboolean GLboolean GLboolean b
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, unicodes_char_index_, unicodes_char_next_, macintosh_name_, adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_)
float dot(float a, float b)
#define PSCMAPS_INTERFACE_GET
const char *(* PS_GetGlyphNameFunc)(FT_Pointer data, FT_UInt string_index)
const char *(* PS_Macintosh_NameFunc)(FT_UInt name_index)
#define PUT_PS_NAMES_SERVICE(a)
float min(float a, float b)
void(* PS_FreeGlyphNameFunc)(FT_Pointer data, const char *name)
#define FT_CALLBACK_DEF(x)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
GLsizei const GLfloat * value
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_NEW_ARRAY(ptr, count)
const char *(* PS_Adobe_Std_StringsFunc)(FT_UInt string_index)
FT_UInt32(* PS_Unicodes_CharNextFunc)(PS_Unicodes unicodes, FT_UInt32 *unicode)
FT_Error(* PS_Unicodes_InitFunc)(FT_Memory memory, PS_Unicodes unicodes, FT_UInt num_glyphs, PS_GetGlyphNameFunc get_glyph_name, PS_FreeGlyphNameFunc free_glyph_name, FT_Pointer glyph_data)
#define PSCMAPS_SERVICES_GET
void(* FT_Module_Destructor)(FT_Module module)
FT_UInt32(* PS_Unicode_ValueFunc)(const char *glyph_name)
GLuint GLuint GLsizei count
GLenum GLsizei GLenum GLenum const GLvoid * table
FT_UInt(* PS_Unicodes_CharIndexFunc)(PS_Unicodes unicodes, FT_UInt32 unicode)