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
47#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
50#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
53#define VARIANT_BIT 0x80000000UL
54#define BASE_GLYPH( code ) ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )
63 ps_unicode_value(
const char* glyph_name )
67 if ( glyph_name[0] ==
'u' &&
68 glyph_name[1] ==
'n' &&
69 glyph_name[2] ==
'i' )
79 const char*
p = glyph_name + 3;
88 d = (
unsigned char)
c -
'0';
91 d = (
unsigned char)
c -
'A';
113 return (FT_UInt32)(
value | VARIANT_BIT );
119 if ( glyph_name[0] ==
'u' )
123 const char*
p = glyph_name + 1;
132 d = (
unsigned char)
c -
'0';
135 d = (
unsigned char)
c -
'A';
153 return (FT_UInt32)(
value | VARIANT_BIT );
160 const char*
p = glyph_name;
161 const char* dot =
NULL;
166 if ( *
p ==
'.' &&
p > glyph_name )
175 return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name,
p );
177 return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |
185 compare_uni_maps(
const void*
a,
190 FT_UInt32 unicode1 = BASE_GLYPH( map1->
unicode );
191 FT_UInt32 unicode2 = BASE_GLYPH( map2->
unicode );
195 if ( unicode1 == unicode2 )
206 if ( unicode1 > unicode2 )
208 else if ( unicode1 < unicode2 )
219#define EXTRA_GLYPH_LIST_SIZE 10
221 static const FT_UInt32 ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =
237 static const char ft_extra_glyph_names[] =
239 'D',
'e',
'l',
't',
'a',0,
240 'O',
'm',
'e',
'g',
'a',0,
241 'f',
'r',
'a',
'c',
't',
'i',
'o',
'n',0,
242 'h',
'y',
'p',
'h',
'e',
'n',0,
243 'm',
'a',
'c',
'r',
'o',
'n',0,
245 'p',
'e',
'r',
'i',
'o',
'd',
'c',
'e',
'n',
't',
'e',
'r',
'e',
'd',0,
246 's',
'p',
'a',
'c',
'e',0,
247 'T',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0,
248 't',
'c',
'o',
'm',
'm',
'a',
'a',
'c',
'c',
'e',
'n',
't',0
252 ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =
268 ps_check_extra_glyph_name(
const char* gname,
276 for (
n = 0;
n < EXTRA_GLYPH_LIST_SIZE;
n++ )
279 ft_extra_glyph_name_offsets[
n], gname ) == 0 )
281 if ( states[
n] == 0 )
285 extra_glyphs[
n] = glyph;
295 ps_check_extra_glyph_unicode( FT_UInt32 uni_char,
301 for (
n = 0;
n < EXTRA_GLYPH_LIST_SIZE;
n++ )
303 if ( uni_char == ft_extra_glyph_unicodes[
n] )
325 FT_UInt extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
326 FT_UInt extra_glyphs[EXTRA_GLYPH_LIST_SIZE];
343 for (
n = 0;
n < num_glyphs;
n++ )
345 const char* gname = get_glyph_name( glyph_data,
n );
350 ps_check_extra_glyph_name( gname,
n,
351 extra_glyphs, extra_glyph_list_states );
352 uni_char = ps_unicode_value( gname );
354 if ( BASE_GLYPH( uni_char ) != 0 )
356 ps_check_extra_glyph_unicode( uni_char,
357 extra_glyph_list_states );
358 map->unicode = uni_char;
359 map->glyph_index =
n;
363 if ( free_glyph_name )
364 free_glyph_name( glyph_data, gname );
368 for (
n = 0;
n < EXTRA_GLYPH_LIST_SIZE;
n++ )
370 if ( extra_glyph_list_states[
n] == 1 )
375 map->unicode = ft_extra_glyph_unicodes[
n];
376 map->glyph_index = extra_glyphs[
n];
394 if (
count < num_glyphs / 2 )
427 FT_UInt32 base_glyph;
438 base_glyph = BASE_GLYPH( mid->
unicode );
440 if ( base_glyph == unicode )
446 if ( base_glyph < unicode )
464 FT_UInt32 char_code = *unicode + 1;
472 FT_UInt32 base_glyph;
480 if (
map->unicode == char_code )
486 base_glyph = BASE_GLYPH(
map->unicode );
488 if ( base_glyph == char_code )
491 if ( base_glyph < char_code )
503 if ( min < table->num_maps )
507 char_code = BASE_GLYPH(
map->unicode );
512 *unicode = char_code;
521 ps_get_macintosh_name(
FT_UInt name_index )
540#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
585 const char* service_id )
588#ifdef FT_CONFIG_OPTION_PIC
607#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
608#define PUT_PS_NAMES_SERVICE( a ) NULL
610#define PUT_PS_NAMES_SERVICE( a ) a
614 psnames_module_class,
#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)
#define PSCMAPS_SERVICES_GET
#define PSCMAPS_INTERFACE_GET
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