forked from minhngoc25a/freetype2
* src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables
with a zero length value. * builds/beos/beos.mk: Include `link-std.mk'. * src/type1/t1load.h (T1_Loader): Renamed to... (T1_LoaderRec): This. (T1_Loader): Now pointer to T1_LoaderRec. * src/type1/t1load.c: Updated. * include/freetype/internal/t1types.h, src/type1/t1load.c, src/type1/t1objs.c: s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
This commit is contained in:
parent
95fcaf8df7
commit
bd889e5de9
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
||||||
|
2002-05-12 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables
|
||||||
|
with a zero length value.
|
||||||
|
|
||||||
|
2002-05-12 Michael Pfeiffer <michael.pfeiffer@utanet.at>
|
||||||
|
|
||||||
|
* builds/beos/beos.mk: Include `link-std.mk'.
|
||||||
|
|
||||||
|
2002-05-12 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
* src/type1/t1load.h (T1_Loader): Renamed to...
|
||||||
|
(T1_LoaderRec): This.
|
||||||
|
(T1_Loader): Now pointer to T1_LoaderRec.
|
||||||
|
* src/type1/t1load.c: Updated.
|
||||||
|
|
||||||
|
* include/freetype/internal/t1types.h, src/type1/t1load.c,
|
||||||
|
src/type1/t1objs.c:
|
||||||
|
s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
|
||||||
|
|
||||||
2002-05-06 Werner Lemberg <wl@gnu.org>
|
2002-05-06 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
* README: Add a note regarding libttf vs. libfreetype.
|
* README: Add a note regarding libttf vs. libfreetype.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# FreeType 2 configuration rules for a BeOS system
|
# FreeType 2 configuration rules for a BeOS system
|
||||||
#
|
#
|
||||||
|
|
||||||
# Copyright 1996-2000 by
|
# Copyright 1996-2000, 2002 by
|
||||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
#
|
#
|
||||||
# This file is part of the FreeType project, and may only be used, modified,
|
# This file is part of the FreeType project, and may only be used, modified,
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
include $(TOP)/builds/compiler/ansi-cc.mk
|
include $(TOP)/builds/compiler/ansi-cc.mk
|
||||||
include $(TOP)/builds/beos/beos-def.mk
|
include $(TOP)/builds/beos/beos-def.mk
|
||||||
|
include $(TOP)/builds/link_std.mk
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ FT_BEGIN_HEADER
|
||||||
T1_ENCODING_TYPE_ARRAY,
|
T1_ENCODING_TYPE_ARRAY,
|
||||||
T1_ENCODING_TYPE_STANDARD,
|
T1_ENCODING_TYPE_STANDARD,
|
||||||
T1_ENCODING_TYPE_ISOLATIN1,
|
T1_ENCODING_TYPE_ISOLATIN1,
|
||||||
T1_ENCODING_TYPE_EXPORT
|
T1_ENCODING_TYPE_EXPERT
|
||||||
|
|
||||||
} T1_EncodingType;
|
} T1_EncodingType;
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,9 @@
|
||||||
|
|
||||||
for ( ; entry < limit; entry++ )
|
for ( ; entry < limit; entry++ )
|
||||||
{
|
{
|
||||||
if ( entry->Tag == tag )
|
/* For compatibility with Windows, we consider 0-length */
|
||||||
|
/* tables the same as missing tables. */
|
||||||
|
if ( entry->Tag == tag && entry->Length != 0 )
|
||||||
{
|
{
|
||||||
FT_TRACE3(( "found table.\n" ));
|
FT_TRACE3(( "found table.\n" ));
|
||||||
return entry;
|
return entry;
|
||||||
|
|
|
@ -445,8 +445,8 @@
|
||||||
const char* gname = face->type1.glyph_names[n];
|
const char* gname = face->type1.glyph_names[n];
|
||||||
|
|
||||||
|
|
||||||
if ( gname && gname[0] == glyph_name[0] &&
|
if ( gname && gname[0] == glyph_name[0] &&
|
||||||
ft_strcmp( gname, glyph_name ) == 0 )
|
ft_strcmp( gname, glyph_name ) == 0 )
|
||||||
return charcode;
|
return charcode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,8 +378,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_blend_axis_types( T1_Face face,
|
parse_blend_axis_types( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
|
T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
|
||||||
FT_Int n, num_axis;
|
FT_Int n, num_axis;
|
||||||
|
@ -440,8 +440,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_blend_design_positions( T1_Face face,
|
parse_blend_design_positions( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ];
|
T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ];
|
||||||
FT_Int num_designs;
|
FT_Int num_designs;
|
||||||
|
@ -522,8 +522,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_blend_design_map( T1_Face face,
|
parse_blend_design_map( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
FT_Error error = 0;
|
FT_Error error = 0;
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
|
@ -603,8 +603,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_weight_vector( T1_Face face,
|
parse_weight_vector( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
FT_Error error = 0;
|
FT_Error error = 0;
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
|
@ -655,8 +655,8 @@
|
||||||
/* of spec!); we detect it and terminate the parsing */
|
/* of spec!); we detect it and terminate the parsing */
|
||||||
/* */
|
/* */
|
||||||
static void
|
static void
|
||||||
parse_shared_dict( T1_Face face,
|
parse_shared_dict( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
|
|
||||||
|
@ -688,15 +688,15 @@
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
t1_load_keyword( T1_Face face,
|
t1_load_keyword( T1_Face face,
|
||||||
T1_Loader* loader,
|
T1_Loader loader,
|
||||||
T1_Field field )
|
T1_Field field )
|
||||||
{
|
{
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
void* dummy_object;
|
void* dummy_object;
|
||||||
void** objects;
|
void** objects;
|
||||||
FT_UInt max_objects;
|
FT_UInt max_objects;
|
||||||
PS_Blend blend = face->blend;
|
PS_Blend blend = face->blend;
|
||||||
|
|
||||||
|
|
||||||
/* if the keyword has a dedicated callback, call it */
|
/* if the keyword has a dedicated callback, call it */
|
||||||
|
@ -767,7 +767,11 @@
|
||||||
/* Note: we must accept "+" as a valid character, as it is used in */
|
/* Note: we must accept "+" as a valid character, as it is used in */
|
||||||
/* embedded type1 fonts in PDF documents. */
|
/* embedded type1 fonts in PDF documents. */
|
||||||
/* */
|
/* */
|
||||||
return ( ft_isalnum( c ) || c == '.' || c == '_' || c == '-' || c == '+' );
|
return ( ft_isalnum( c ) ||
|
||||||
|
c == '.' ||
|
||||||
|
c == '_' ||
|
||||||
|
c == '-' ||
|
||||||
|
c == '+' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -814,8 +818,8 @@
|
||||||
/* dictionaries */
|
/* dictionaries */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_font_name( T1_Face face,
|
parse_font_name( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
@ -860,8 +864,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_font_bbox( T1_Face face,
|
parse_font_bbox( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
FT_Fixed temp[4];
|
FT_Fixed temp[4];
|
||||||
|
@ -877,8 +881,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_font_matrix( T1_Face face,
|
parse_font_matrix( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
FT_Matrix* matrix = &face->type1.font_matrix;
|
FT_Matrix* matrix = &face->type1.font_matrix;
|
||||||
|
@ -889,7 +893,7 @@
|
||||||
|
|
||||||
|
|
||||||
if ( matrix->xx || matrix->yx )
|
if ( matrix->xx || matrix->yx )
|
||||||
/* with synthetic fonts, it's possible we get here twice */
|
/* with synthetic fonts, it's possible we get here twice */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(void)T1_ToFixedArray( parser, 6, temp, 3 );
|
(void)T1_ToFixedArray( parser, 6, temp, 3 );
|
||||||
|
@ -926,8 +930,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_encoding( T1_Face face,
|
parse_encoding( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
FT_Byte* cur = parser->root.cursor;
|
FT_Byte* cur = parser->root.cursor;
|
||||||
|
@ -973,13 +977,13 @@
|
||||||
if ( FT_NEW_ARRAY( encode->char_index, count ) ||
|
if ( FT_NEW_ARRAY( encode->char_index, count ) ||
|
||||||
FT_NEW_ARRAY( encode->char_name, count ) ||
|
FT_NEW_ARRAY( encode->char_name, count ) ||
|
||||||
FT_SET_ERROR( psaux->ps_table_funcs->init(
|
FT_SET_ERROR( psaux->ps_table_funcs->init(
|
||||||
char_table, count, memory ) ) )
|
char_table, count, memory ) ) )
|
||||||
{
|
{
|
||||||
parser->root.error = error;
|
parser->root.error = error;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We need to `zero' out encoding_table.elements */
|
/* We need to `zero' out encoding_table.elements */
|
||||||
for ( n = 0; n < count; n++ )
|
for ( n = 0; n < count; n++ )
|
||||||
{
|
{
|
||||||
char* notdef = (char *)".notdef";
|
char* notdef = (char *)".notdef";
|
||||||
|
@ -1015,10 +1019,10 @@
|
||||||
/* we stop when we encounter a `def' */
|
/* we stop when we encounter a `def' */
|
||||||
if ( c == 'd' && cur + 3 < limit )
|
if ( c == 'd' && cur + 3 < limit )
|
||||||
{
|
{
|
||||||
if ( cur[1] == 'e' &&
|
if ( cur[1] == 'e' &&
|
||||||
cur[2] == 'f' &&
|
cur[2] == 'f' &&
|
||||||
is_space(cur[-1]) &&
|
is_space( cur[-1] ) &&
|
||||||
is_space(cur[3]) )
|
is_space( cur[3] ) )
|
||||||
{
|
{
|
||||||
FT_TRACE6(( "encoding end\n" ));
|
FT_TRACE6(( "encoding end\n" ));
|
||||||
break;
|
break;
|
||||||
|
@ -1033,7 +1037,7 @@
|
||||||
|
|
||||||
parser->root.cursor = cur;
|
parser->root.cursor = cur;
|
||||||
charcode = T1_ToInt( parser );
|
charcode = T1_ToInt( parser );
|
||||||
cur = parser->root.cursor;
|
cur = parser->root.cursor;
|
||||||
|
|
||||||
/* skip whitespace */
|
/* skip whitespace */
|
||||||
while ( cur < limit && is_space( *cur ) )
|
while ( cur < limit && is_space( *cur ) )
|
||||||
|
@ -1068,19 +1072,19 @@
|
||||||
face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;
|
face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;
|
||||||
parser->root.cursor = cur;
|
parser->root.cursor = cur;
|
||||||
}
|
}
|
||||||
/* Otherwise, we should have either `StandardEncoding' or */
|
/* Otherwise, we should have either `StandardEncoding', */
|
||||||
/* `ExpertEncoding' */
|
/* `ExpertEncoding', or `ISOLatin1Encoding' */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( cur + 17 < limit &&
|
if ( cur + 17 < limit &&
|
||||||
ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 )
|
ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 )
|
||||||
face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD;
|
face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD;
|
||||||
|
|
||||||
else if ( cur + 15 < limit &&
|
else if ( cur + 15 < limit &&
|
||||||
ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 )
|
ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 )
|
||||||
face->type1.encoding_type = T1_ENCODING_TYPE_EXPORT;
|
face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT;
|
||||||
|
|
||||||
else if ( cur + 18 < limit &&
|
else if ( cur + 18 < limit &&
|
||||||
ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 )
|
ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 )
|
||||||
face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
|
face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
|
||||||
|
|
||||||
|
@ -1094,8 +1098,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_subrs( T1_Face face,
|
parse_subrs( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
PS_Table table = &loader->subrs;
|
PS_Table table = &loader->subrs;
|
||||||
|
@ -1191,8 +1195,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_charstrings( T1_Face face,
|
parse_charstrings( T1_Face face,
|
||||||
T1_Loader* loader )
|
T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
PS_Table code_table = &loader->charstrings;
|
PS_Table code_table = &loader->charstrings;
|
||||||
|
@ -1241,8 +1245,8 @@
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
FT_Int size;
|
FT_Int size;
|
||||||
|
@ -1479,10 +1483,10 @@
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
parse_dict( T1_Face face,
|
parse_dict( T1_Face face,
|
||||||
T1_Loader* loader,
|
T1_Loader loader,
|
||||||
FT_Byte* base,
|
FT_Byte* base,
|
||||||
FT_Long size )
|
FT_Long size )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
|
|
||||||
|
@ -1499,7 +1503,7 @@
|
||||||
for ( ; cur < limit; cur++ )
|
for ( ; cur < limit; cur++ )
|
||||||
{
|
{
|
||||||
/* look for `FontDirectory', which causes problems on some fonts */
|
/* look for `FontDirectory', which causes problems on some fonts */
|
||||||
if ( *cur == 'F' && cur + 25 < limit &&
|
if ( *cur == 'F' && cur + 25 < limit &&
|
||||||
ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 )
|
ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 )
|
||||||
{
|
{
|
||||||
FT_Byte* cur2;
|
FT_Byte* cur2;
|
||||||
|
@ -1596,8 +1600,8 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
t1_init_loader( T1_Loader* loader,
|
t1_init_loader( T1_Loader loader,
|
||||||
T1_Face face )
|
T1_Face face )
|
||||||
{
|
{
|
||||||
FT_UNUSED( face );
|
FT_UNUSED( face );
|
||||||
|
|
||||||
|
@ -1616,7 +1620,7 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
t1_done_loader( T1_Loader* loader )
|
t1_done_loader( T1_Loader loader )
|
||||||
{
|
{
|
||||||
T1_Parser parser = &loader->parser;
|
T1_Parser parser = &loader->parser;
|
||||||
|
|
||||||
|
@ -1636,7 +1640,7 @@
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
T1_Open_Face( T1_Face face )
|
T1_Open_Face( T1_Face face )
|
||||||
{
|
{
|
||||||
T1_Loader loader;
|
T1_LoaderRec loader;
|
||||||
T1_Parser parser;
|
T1_Parser parser;
|
||||||
T1_Font type1 = &face->type1;
|
T1_Font type1 = &face->type1;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
@ -1701,8 +1705,7 @@
|
||||||
loader.glyph_names.block = 0;
|
loader.glyph_names.block = 0;
|
||||||
loader.glyph_names.elements = 0;
|
loader.glyph_names.elements = 0;
|
||||||
|
|
||||||
/* we must now build type1.encoding when we have a custom */
|
/* we must now build type1.encoding when we have a custom array */
|
||||||
/* array.. */
|
|
||||||
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
|
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
|
||||||
{
|
{
|
||||||
FT_Int charcode, idx, min_char, max_char;
|
FT_Int charcode, idx, min_char, max_char;
|
||||||
|
@ -1740,8 +1743,8 @@
|
||||||
if ( ft_strcmp( (const char*)".notdef",
|
if ( ft_strcmp( (const char*)".notdef",
|
||||||
(const char*)glyph_name ) != 0 )
|
(const char*)glyph_name ) != 0 )
|
||||||
{
|
{
|
||||||
if (charcode < min_char) min_char = charcode;
|
if ( charcode < min_char ) min_char = charcode;
|
||||||
if (charcode > max_char) max_char = charcode;
|
if ( charcode > max_char ) max_char = charcode;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ FT_BEGIN_HEADER
|
||||||
PS_TableRec subrs;
|
PS_TableRec subrs;
|
||||||
FT_Bool fontdata;
|
FT_Bool fontdata;
|
||||||
|
|
||||||
} T1_Loader;
|
} T1_LoaderRec, *T1_Loader;
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
|
|
|
@ -327,10 +327,9 @@
|
||||||
|
|
||||||
root->num_glyphs = face->type1.num_glyphs;
|
root->num_glyphs = face->type1.num_glyphs;
|
||||||
root->face_index = face_index;
|
root->face_index = face_index;
|
||||||
|
|
||||||
root->face_flags = FT_FACE_FLAG_SCALABLE;
|
root->face_flags = FT_FACE_FLAG_SCALABLE;
|
||||||
|
|
||||||
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
|
root->face_flags |= FT_FACE_FLAG_HORIZONTAL;
|
||||||
|
|
||||||
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
|
root->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;
|
||||||
|
|
||||||
if ( face->type1.font_info.is_fixed_pitch )
|
if ( face->type1.font_info.is_fixed_pitch )
|
||||||
|
@ -432,28 +431,28 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
FT_Face root = &face->root;
|
FT_Face root = &face->root;
|
||||||
|
|
||||||
|
|
||||||
if ( psnames && psaux )
|
if ( psnames && psaux )
|
||||||
{
|
{
|
||||||
FT_CharMapRec charmap;
|
FT_CharMapRec charmap;
|
||||||
T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes;
|
T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes;
|
||||||
FT_CMap_Class clazz;
|
FT_CMap_Class clazz;
|
||||||
|
|
||||||
|
|
||||||
charmap.face = root;
|
charmap.face = root;
|
||||||
|
|
||||||
/* first of all, try to synthetize a Unicode charmap */
|
/* first of all, try to synthetize a Unicode charmap */
|
||||||
charmap.platform_id = 3;
|
charmap.platform_id = 3;
|
||||||
charmap.encoding_id = 1;
|
charmap.encoding_id = 1;
|
||||||
charmap.encoding = ft_encoding_unicode;
|
charmap.encoding = ft_encoding_unicode;
|
||||||
|
|
||||||
FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
|
FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
|
||||||
|
|
||||||
/* now, generate an Adobe Standard encoding when appropriate */
|
/* now, generate an Adobe Standard encoding when appropriate */
|
||||||
charmap.platform_id = 7;
|
charmap.platform_id = 7;
|
||||||
clazz = NULL;
|
clazz = NULL;
|
||||||
|
|
||||||
switch ( face->type1.encoding_type )
|
switch ( face->type1.encoding_type )
|
||||||
{
|
{
|
||||||
case T1_ENCODING_TYPE_STANDARD:
|
case T1_ENCODING_TYPE_STANDARD:
|
||||||
|
@ -461,29 +460,29 @@
|
||||||
charmap.encoding_id = 0;
|
charmap.encoding_id = 0;
|
||||||
clazz = cmap_classes->standard;
|
clazz = cmap_classes->standard;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T1_ENCODING_TYPE_EXPORT:
|
case T1_ENCODING_TYPE_EXPERT:
|
||||||
charmap.encoding = ft_encoding_adobe_expert;
|
charmap.encoding = ft_encoding_adobe_expert;
|
||||||
charmap.encoding_id = 1;
|
charmap.encoding_id = 1;
|
||||||
clazz = cmap_classes->expert;
|
clazz = cmap_classes->expert;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T1_ENCODING_TYPE_ARRAY:
|
case T1_ENCODING_TYPE_ARRAY:
|
||||||
charmap.encoding = ft_encoding_adobe_custom;
|
charmap.encoding = ft_encoding_adobe_custom;
|
||||||
charmap.encoding_id = 2;
|
charmap.encoding_id = 2;
|
||||||
clazz = cmap_classes->custom;
|
clazz = cmap_classes->custom;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T1_ENCODING_TYPE_ISOLATIN1:
|
case T1_ENCODING_TYPE_ISOLATIN1:
|
||||||
charmap.encoding = ft_encoding_latin_1;
|
charmap.encoding = ft_encoding_latin_1;
|
||||||
charmap.encoding_id = 3;
|
charmap.encoding_id = 3;
|
||||||
clazz = cmap_classes->unicode;
|
clazz = cmap_classes->unicode;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( clazz )
|
if ( clazz )
|
||||||
FT_CMap_New( clazz, NULL, &charmap, NULL );
|
FT_CMap_New( clazz, NULL, &charmap, NULL );
|
||||||
}
|
}
|
||||||
|
@ -535,7 +534,7 @@
|
||||||
charmap->encoding_id = 0;
|
charmap->encoding_id = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T1_ENCODING_TYPE_EXPORT:
|
case T1_ENCODING_TYPE_EXPERT:
|
||||||
charmap->encoding = ft_encoding_adobe_expert;
|
charmap->encoding = ft_encoding_adobe_expert;
|
||||||
charmap->encoding_id = 1;
|
charmap->encoding_id = 1;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue