20#include FT_INTERNAL_DEBUG_H
21#include FT_INTERNAL_OBJECTS_H
22#include FT_SERVICE_POSTSCRIPT_CMAPS_H
39#define DEFINE_PS_TABLES
40#define DEFINE_PS_TABLES_DATA
46#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
49#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
52#define VARIANT_BIT 0x80000000UL
53#define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )
62 ps_unicode_value(
const char* glyph_name )
66 if ( glyph_name[0] ==
'u' &&
67 glyph_name[1] ==
'n' &&
68 glyph_name[2] ==
'i' )
78 const char*
p = glyph_name + 3;
87 d = (
unsigned char)
c -
'0';
90 d = (
unsigned char)
c -
'A';
112 return (FT_UInt32)(
value | VARIANT_BIT );
118 if ( glyph_name[0] ==
'u' )
122 const char*
p = glyph_name + 1;
131 d = (
unsigned char)
c -
'0';
134 d = (
unsigned char)
c -
'A';
152 return (FT_UInt32)(
value | VARIANT_BIT );
159 const char*
p = glyph_name;
160 const char* dot =
NULL;
165 if ( *
p ==
'.' &&
p > glyph_name )
174 return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name,
p );
176 return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
184 compare_uni_maps(
const void*
a,
189 FT_UInt32 unicode1 = BASE_GLYPH( map1->
unicode );
190 FT_UInt32 unicode2 = BASE_GLYPH( map2->
unicode );
194 if ( unicode1 == unicode2 )
205 if ( unicode1 > unicode2 )
207 else if ( unicode1 < unicode2 )
218#define EXTRA_GLYPH_LIST_SIZE 10
220 static const FT_UInt32 ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =
236 static const char ft_extra_glyph_names[] =
238 'D',
'e',
'l',
't',
'a',0,
239 'O',
'm',
'e',
'g',
'a',0,
240 'f',
'r',
'a',
'c',
't',
'i',
'o',
'n',0,
241 'h',
'y',
'p',
'h',
'e',
'n',0,
242 'm',
'a',
'c',
'r',
'o',
'n',0,
244 'p',
'e',
'r',
'i',
'o',
'd',
'c',
'e',
'n',
't',
'e',
'r',
'e',
'd',0,
245 's',
'p',
'a',
'c',
'e',0,
246 'T',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0,
247 't',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0
251 ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =
267 ps_check_extra_glyph_name(
const char* gname,
275 for (
n = 0;
n < EXTRA_GLYPH_LIST_SIZE;
n++ )
278 ft_extra_glyph_name_offsets[
n], gname ) == 0 )
280 if ( states[
n] == 0 )
284 extra_glyphs[
n] = glyph;
294 ps_check_extra_glyph_unicode( FT_UInt32 uni_char,
300 for (
n = 0;
n < EXTRA_GLYPH_LIST_SIZE;
n++ )
302 if ( uni_char == ft_extra_glyph_unicodes[
n] )
324 FT_UInt extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
325 FT_UInt extra_glyphs[EXTRA_GLYPH_LIST_SIZE];
342 for (
n = 0;
n < num_glyphs;
n++ )
344 const char* gname = get_glyph_name( glyph_data,
n );
349 ps_check_extra_glyph_name( gname,
n,
350 extra_glyphs, extra_glyph_list_states );
351 uni_char = ps_unicode_value( gname );
353 if ( BASE_GLYPH( uni_char ) != 0 )
355 ps_check_extra_glyph_unicode( uni_char,
356 extra_glyph_list_states );
357 map->unicode = uni_char;
358 map->glyph_index =
n;
362 if ( free_glyph_name )
363 free_glyph_name( glyph_data, gname );
367 for (
n = 0;
n < EXTRA_GLYPH_LIST_SIZE;
n++ )
369 if ( extra_glyph_list_states[
n] == 1 )
374 map->unicode = ft_extra_glyph_unicodes[
n];
375 map->glyph_index = extra_glyphs[
n];
393 if (
count < num_glyphs / 2 )
396 num_glyphs + EXTRA_GLYPH_LIST_SIZE,
428 FT_UInt32 base_glyph;
439 base_glyph = BASE_GLYPH( mid->
unicode );
441 if ( base_glyph == unicode )
447 if ( base_glyph < unicode )
465 FT_UInt32 char_code = *unicode + 1;
473 FT_UInt32 base_glyph;
481 if (
map->unicode == char_code )
487 base_glyph = BASE_GLYPH(
map->unicode );
489 if ( base_glyph == char_code )
492 if ( base_glyph < char_code )
504 if ( min < table->num_maps )
508 char_code = BASE_GLYPH(
map->unicode );
513 *unicode = char_code;
522 ps_get_macintosh_name(
FT_UInt name_index )
541#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
586 const char* service_id )
596#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
597#define PUT_PS_NAMES_SERVICE( a ) NULL
599#define PUT_PS_NAMES_SERVICE( a ) a
603 psnames_module_class,
613 (
void*)&pscmaps_interface ),
#define FT_CALLBACK_DEF(x)
#define FT_NEW_ARRAY(ptr, count)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
void(* FT_Module_Destructor)(FT_Module module)
FT_Error(* FT_Module_Constructor)(FT_Module module)
FT_Module_Interface(* FT_Module_Requester)(FT_Module module, const char *name)
#define FT_DEFINE_MODULE( class_, flags_, size_, name_, version_, requires_, interface_, init_, done_, get_interface_)
ft_service_list_lookup(FT_ServiceDesc service_descriptors, const char *service_id)
#define FT_DEFINE_SERVICEDESCREC1(class_, serv_id_1, serv_data_1)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
GLuint GLuint GLsizei count
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
static char memory[1024 *256]
#define PUT_PS_NAMES_SERVICE(a)
const char ft_standard_glyph_names[3696]
const short ft_sid_names[FT_NUM_SID_NAMES]
const unsigned short t1_expert_encoding[256]
const unsigned short t1_standard_encoding[256]
const short ft_mac_names[FT_NUM_MAC_NAMES]
const char *(* PS_Macintosh_NameFunc)(FT_UInt name_index)
const char *(* PS_GetGlyphNameFunc)(FT_Pointer data, FT_UInt string_index)
const char *(* PS_Adobe_Std_StringsFunc)(FT_UInt string_index)
FT_UInt32(* PS_Unicode_ValueFunc)(const char *glyph_name)
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 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_)
void(* PS_FreeGlyphNameFunc)(FT_Pointer data, const char *name)
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS
FT_UInt(* PS_Unicodes_CharIndexFunc)(PS_Unicodes unicodes, FT_UInt32 unicode)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList