20 #include FT_INTERNAL_OBJECTS_H
21 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
30 #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
33 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
36 #define VARIANT_BIT 0x80000000UL
37 #define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )
46 ps_unicode_value(
const char* glyph_name )
50 if ( glyph_name[0] ==
'u' &&
51 glyph_name[1] ==
'n' &&
52 glyph_name[2] ==
'i' )
62 const char*
p = glyph_name + 3;
65 for ( count = 4; count > 0; count--, p++ )
71 d = (
unsigned char)c -
'0';
74 d = (
unsigned char)c -
'A';
87 value = ( value << 4 ) + d;
96 return (FT_UInt32)( value | VARIANT_BIT );
102 if ( glyph_name[0] ==
'u' )
106 const char* p = glyph_name + 1;
109 for ( count = 6; count > 0; count--, p++ )
115 d = (
unsigned char)c -
'0';
118 d = (
unsigned char)c -
'A';
128 value = ( value << 4 ) + d;
136 return (FT_UInt32)( value | VARIANT_BIT );
143 const char* p = glyph_name;
144 const char* dot =
NULL;
149 if ( *p ==
'.' && p > glyph_name )
158 return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );
160 return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
168 compare_uni_maps(
const void*
a,
173 FT_UInt32 unicode1 = BASE_GLYPH( map1->
unicode );
174 FT_UInt32 unicode2 = BASE_GLYPH( map2->
unicode );
178 if ( unicode1 == unicode2 )
189 if ( unicode1 > unicode2 )
191 else if ( unicode1 < unicode2 )
202 #define EXTRA_GLYPH_LIST_SIZE 10
204 static const FT_UInt32 ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =
220 static const char ft_extra_glyph_names[] =
222 'D',
'e',
'l',
't',
'a',0,
223 'O',
'm',
'e',
'g',
'a',0,
224 'f',
'r',
'a',
'c',
't',
'i',
'o',
'n',0,
225 'h',
'y',
'p',
'h',
'e',
'n',0,
226 'm',
'a',
'c',
'r',
'o',
'n',0,
228 'p',
'e',
'r',
'i',
'o',
'd',
'c',
'e',
'n',
't',
'e',
'r',
'e',
'd',0,
229 's',
'p',
'a',
'c',
'e',0,
230 'T',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0,
231 't',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0
235 ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =
251 ps_check_extra_glyph_name(
const char* gname,
259 for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
262 ft_extra_glyph_name_offsets[n], gname ) == 0 )
264 if ( states[n] == 0 )
268 extra_glyphs[
n] = glyph;
278 ps_check_extra_glyph_unicode( FT_UInt32 uni_char,
284 for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
286 if ( uni_char == ft_extra_glyph_unicodes[n] )
308 FT_UInt extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
309 FT_UInt extra_glyphs[EXTRA_GLYPH_LIST_SIZE];
326 for ( n = 0; n < num_glyphs; n++ )
328 const char* gname = get_glyph_name( glyph_data, n );
333 ps_check_extra_glyph_name( gname, n,
334 extra_glyphs, extra_glyph_list_states );
335 uni_char = ps_unicode_value( gname );
337 if ( BASE_GLYPH( uni_char ) != 0 )
339 ps_check_extra_glyph_unicode( uni_char,
340 extra_glyph_list_states );
346 if ( free_glyph_name )
347 free_glyph_name( glyph_data, gname );
351 for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )
353 if ( extra_glyph_list_states[n] == 1 )
358 map->
unicode = ft_extra_glyph_unicodes[
n];
372 error = PSnames_Err_No_Unicode_Glyph_Name;
377 if ( count < num_glyphs / 2 )
380 error = PSnames_Err_Ok;
410 FT_UInt32 base_glyph;
413 mid = min + ( ( max -
min ) >> 1 );
421 base_glyph = BASE_GLYPH( mid->
unicode );
423 if ( base_glyph == unicode )
429 if ( base_glyph < unicode )
447 FT_UInt32 char_code = *unicode + 1;
455 FT_UInt32 base_glyph;
460 mid = min + ( ( max -
min ) >> 1 );
461 map = table->
maps + mid;
463 if ( map->
unicode == char_code )
469 base_glyph = BASE_GLYPH( map->
unicode );
471 if ( base_glyph == char_code )
474 if ( base_glyph < char_code )
486 if ( min < table->num_maps )
490 char_code = BASE_GLYPH( map->
unicode );
495 *unicode = char_code;
504 ps_get_macintosh_name(
FT_UInt name_index )
523 #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
564 const char* service_id )
567 #ifdef FT_CONFIG_OPTION_PIC
573 library = module->library;
586 #ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
587 #define PUT_PS_NAMES_SERVICE(a) 0
589 #define PUT_PS_NAMES_SERVICE(a) a
GLenum GLsizei GLenum GLenum const GLvoid * table
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
static const short ft_sid_names[FT_NUM_SID_NAMES]
const char *(* PS_Adobe_Std_StringsFunc)(FT_UInt string_index)
static const char ft_standard_glyph_names[3696]
#define FT_PSCMAPS_INTERFACE_GET
#define FT_DEFINE_SERVICEDESCREC1(class_,serv_id_1, serv_data_1)
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS
GLboolean GLboolean GLboolean GLboolean a
return Display return Display Bool Bool int d
const char *(* PS_GetGlyphNameFunc)(FT_Pointer data, FT_UInt string_index)
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,interface_, init_, done_, get_interface_)
void(* FT_Module_Destructor)(FT_Module module)
#define PUT_PS_NAMES_SERVICE(a)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_CALLBACK_DEF(x)
#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_)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
static const unsigned short t1_standard_encoding[256]
void(* PS_FreeGlyphNameFunc)(FT_Pointer data, const char *name)
#define FT_NEW_ARRAY(ptr, count)
FT_Error(* FT_Module_Constructor)(FT_Module module)
EGLSurface EGLint void ** value
FT_UInt32(* PS_Unicodes_CharNextFunc)(PS_Unicodes unicodes, FT_UInt32 *unicode)
FT_UInt(* PS_Unicodes_CharIndexFunc)(PS_Unicodes unicodes, FT_UInt32 unicode)
FT_UInt32(* PS_Unicode_ValueFunc)(const char *glyph_name)
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)
GLdouble GLdouble GLdouble b
static const unsigned short t1_expert_encoding[256]
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLint *params GLenum GLenum GLfloat *params GLenum GLint GLenum GLenum GLvoid *pixels GLenum GLint GLenum GLint *params GLenum GLenum GLint *params GLenum GLsizei const GLvoid *pointer GLenum GLenum const GLint *params GLenum GLfloat GLfloat GLint GLint const GLfloat *points GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat *points GLint GLfloat GLfloat GLint GLfloat GLfloat v2 GLenum GLenum const GLint *params GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum map
#define FT_PSCMAPS_SERVICES_GET
const char *(* PS_Macintosh_NameFunc)(FT_UInt name_index)
static const short ft_mac_names[FT_NUM_MAC_NAMES]