forked from minhngoc25a/freetype2
* src/type1/t1driver.c, src/type1/t1parse.c: 16bit fixes.
formatting, copyright updates
This commit is contained in:
parent
91db04cb9c
commit
efa996155e
|
@ -1,3 +1,7 @@
|
|||
2002-04-02 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/type1/t1driver.c, src/type1/t1parse.c: 16bit fixes.
|
||||
|
||||
2002-04-01 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/truetype/ttgload.c: 16bit fixes.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 by
|
||||
# Copyright 1996-2000, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 by
|
||||
# Copyright 1996-2000, 2001 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* AFM support for Type 1 fonts (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -167,7 +167,7 @@
|
|||
FT_Byte* p;
|
||||
FT_Int count = 0;
|
||||
T1_Kern_Pair* pair;
|
||||
T1_Font type1 = &((T1_Face)t1_face)->type1;
|
||||
T1_Font type1 = &((T1_Face)t1_face)->type1;
|
||||
T1_AFM* afm = 0;
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* AFM support for Type 1 fonts (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 driver interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -109,7 +109,7 @@
|
|||
|
||||
|
||||
static const char*
|
||||
t1_get_ps_name( T1_Face face )
|
||||
t1_get_ps_name( T1_Face face )
|
||||
{
|
||||
return (const char*) face->type1.font_name;
|
||||
}
|
||||
|
@ -239,6 +239,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charmap :: A handle to the source charmap object. */
|
||||
/* */
|
||||
/* charcode :: The character code. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -248,8 +249,8 @@
|
|||
Get_Char_Index( FT_CharMap charmap,
|
||||
FT_Long charcode )
|
||||
{
|
||||
T1_Face face;
|
||||
FT_UInt result = 0;
|
||||
T1_Face face;
|
||||
FT_UInt result = 0;
|
||||
PSNames_Service psnames;
|
||||
|
||||
|
||||
|
@ -269,7 +270,7 @@
|
|||
|
||||
/* the function returns 0xFFFF if the Unicode charcode has */
|
||||
/* no corresponding glyph */
|
||||
if ( result == 0xFFFF )
|
||||
if ( result == 0xFFFFU )
|
||||
result = 0;
|
||||
goto Exit;
|
||||
|
||||
|
@ -286,7 +287,7 @@
|
|||
|
||||
/* the function returns 0xFFFF if the Unicode charcode has */
|
||||
/* no corresponding glyph */
|
||||
if ( result == 0xFFFF )
|
||||
if ( result == 0xFFFFU )
|
||||
result = 0;
|
||||
}
|
||||
goto Exit;
|
||||
|
@ -355,6 +356,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charmap :: A handle to the source charmap object. */
|
||||
/* */
|
||||
/* charcode :: The character code. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -364,7 +366,7 @@
|
|||
Get_Next_Char( FT_CharMap charmap,
|
||||
FT_Long charcode )
|
||||
{
|
||||
T1_Face face;
|
||||
T1_Face face;
|
||||
PSNames_Service psnames;
|
||||
|
||||
|
||||
|
@ -389,7 +391,7 @@
|
|||
/* */
|
||||
case ft_encoding_latin_1:
|
||||
{
|
||||
FT_Long code;
|
||||
FT_Long code;
|
||||
|
||||
|
||||
/* use the `PSNames' module to synthetize the Unicode charmap */
|
||||
|
@ -481,28 +483,28 @@
|
|||
sizeof( T1_SizeRec ),
|
||||
sizeof( T1_GlyphSlotRec ),
|
||||
|
||||
(FT_Face_InitFunc) T1_Face_Init,
|
||||
(FT_Face_DoneFunc) T1_Face_Done,
|
||||
(FT_Size_InitFunc) T1_Size_Init,
|
||||
(FT_Size_DoneFunc) T1_Size_Done,
|
||||
(FT_Slot_InitFunc)T1_GlyphSlot_Init,
|
||||
(FT_Slot_DoneFunc)T1_GlyphSlot_Done,
|
||||
(FT_Face_InitFunc) T1_Face_Init,
|
||||
(FT_Face_DoneFunc) T1_Face_Done,
|
||||
(FT_Size_InitFunc) T1_Size_Init,
|
||||
(FT_Size_DoneFunc) T1_Size_Done,
|
||||
(FT_Slot_InitFunc) T1_GlyphSlot_Init,
|
||||
(FT_Slot_DoneFunc) T1_GlyphSlot_Done,
|
||||
|
||||
(FT_Size_ResetPointsFunc) T1_Size_Reset,
|
||||
(FT_Size_ResetPixelsFunc)T1_Size_Reset,
|
||||
(FT_Slot_LoadFunc) T1_Load_Glyph,
|
||||
(FT_CharMap_CharIndexFunc) Get_Char_Index,
|
||||
(FT_Size_ResetPixelsFunc) T1_Size_Reset,
|
||||
(FT_Slot_LoadFunc) T1_Load_Glyph,
|
||||
(FT_CharMap_CharIndexFunc)Get_Char_Index,
|
||||
|
||||
#ifdef T1_CONFIG_OPTION_NO_AFM
|
||||
(FT_Face_GetKerningFunc) 0,
|
||||
(FT_Face_AttachFunc) 0,
|
||||
(FT_Face_GetKerningFunc) 0,
|
||||
(FT_Face_AttachFunc) 0,
|
||||
#else
|
||||
(FT_Face_GetKerningFunc) Get_Kerning,
|
||||
(FT_Face_AttachFunc) T1_Read_AFM,
|
||||
(FT_Face_GetKerningFunc) Get_Kerning,
|
||||
(FT_Face_AttachFunc) T1_Read_AFM,
|
||||
#endif
|
||||
(FT_Face_GetAdvancesFunc) 0,
|
||||
(FT_Face_GetAdvancesFunc) 0,
|
||||
|
||||
(FT_CharMap_CharNextFunc) Get_Next_Char
|
||||
(FT_CharMap_CharNextFunc) Get_Next_Char
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* High-level Type 1 driver interface (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 Glyph Loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -57,9 +57,9 @@
|
|||
|
||||
FT_CALLBACK_DEF( FT_Error )
|
||||
T1_Parse_Glyph( T1_Decoder decoder,
|
||||
FT_UInt glyph_index )
|
||||
FT_UInt glyph_index )
|
||||
{
|
||||
T1_Face face = (T1_Face)decoder->builder.face;
|
||||
T1_Face face = (T1_Face)decoder->builder.face;
|
||||
T1_Font type1 = &face->type1;
|
||||
|
||||
|
||||
|
@ -77,10 +77,10 @@
|
|||
T1_Compute_Max_Advance( T1_Face face,
|
||||
FT_Int* max_advance )
|
||||
{
|
||||
FT_Error error;
|
||||
T1_DecoderRec decoder;
|
||||
FT_Int glyph_index;
|
||||
T1_Font type1 = &face->type1;
|
||||
FT_Error error;
|
||||
T1_DecoderRec decoder;
|
||||
FT_Int glyph_index;
|
||||
T1_Font type1 = &face->type1;
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
|
||||
|
||||
|
@ -146,13 +146,14 @@
|
|||
T1_DecoderRec decoder;
|
||||
T1_Face face = (T1_Face)glyph->root.face;
|
||||
FT_Bool hinting;
|
||||
T1_Font type1 = &face->type1;
|
||||
T1_Font type1 = &face->type1;
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
const T1_Decoder_Funcs decoder_funcs = psaux->t1_decoder_funcs;
|
||||
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
|
||||
|
||||
if ( load_flags & FT_LOAD_NO_RECURSE )
|
||||
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 Glyph Loader (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 font loader (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -101,7 +101,7 @@
|
|||
FT_UInt num_designs,
|
||||
FT_UInt num_axis )
|
||||
{
|
||||
PS_Blend blend;
|
||||
PS_Blend blend;
|
||||
FT_Memory memory = face->root.memory;
|
||||
FT_Error error = 0;
|
||||
|
||||
|
@ -184,8 +184,8 @@
|
|||
FT_Multi_Master* master )
|
||||
{
|
||||
PS_Blend blend = face->blend;
|
||||
FT_UInt n;
|
||||
FT_Error error;
|
||||
FT_UInt n;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = T1_Err_Invalid_Argument;
|
||||
|
@ -217,8 +217,8 @@
|
|||
FT_Fixed* coords )
|
||||
{
|
||||
PS_Blend blend = face->blend;
|
||||
FT_Error error;
|
||||
FT_UInt n, m;
|
||||
FT_Error error;
|
||||
FT_UInt n, m;
|
||||
|
||||
|
||||
error = T1_Err_Invalid_Argument;
|
||||
|
@ -263,8 +263,8 @@
|
|||
FT_Long* coords )
|
||||
{
|
||||
PS_Blend blend = face->blend;
|
||||
FT_Error error;
|
||||
FT_UInt n, p;
|
||||
FT_Error error;
|
||||
FT_UInt n, p;
|
||||
|
||||
|
||||
error = T1_Err_Invalid_Argument;
|
||||
|
@ -276,12 +276,13 @@
|
|||
|
||||
for ( n = 0; n < blend->num_axis; n++ )
|
||||
{
|
||||
FT_Long design = coords[n];
|
||||
FT_Fixed the_blend;
|
||||
FT_Long design = coords[n];
|
||||
FT_Fixed the_blend;
|
||||
PS_DesignMap map = blend->design_map + n;
|
||||
FT_Fixed* designs = map->design_points;
|
||||
FT_Fixed* blends = map->blend_points;
|
||||
FT_Int before = -1, after = -1;
|
||||
FT_Fixed* designs = map->design_points;
|
||||
FT_Fixed* blends = map->blend_points;
|
||||
FT_Int before = -1, after = -1;
|
||||
|
||||
|
||||
for ( p = 0; p < (FT_UInt)map->num_points; p++ )
|
||||
{
|
||||
|
@ -331,7 +332,7 @@
|
|||
T1_Done_Blend( T1_Face face )
|
||||
{
|
||||
FT_Memory memory = face->root.memory;
|
||||
PS_Blend blend = face->blend;
|
||||
PS_Blend blend = face->blend;
|
||||
|
||||
|
||||
if ( blend )
|
||||
|
@ -383,11 +384,11 @@
|
|||
parse_blend_axis_types( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
|
||||
FT_Int n, num_axis;
|
||||
FT_Error error = 0;
|
||||
T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
|
||||
FT_Int n, num_axis;
|
||||
FT_Error error = 0;
|
||||
PS_Blend blend;
|
||||
FT_Memory memory;
|
||||
FT_Memory memory;
|
||||
|
||||
|
||||
/* take an array of objects */
|
||||
|
@ -413,11 +414,12 @@
|
|||
for ( n = 0; n < num_axis; n++ )
|
||||
{
|
||||
T1_Token token = axis_tokens + n;
|
||||
FT_Byte* name;
|
||||
FT_Int len;
|
||||
FT_Byte* name;
|
||||
FT_Int len;
|
||||
|
||||
|
||||
/* skip first slash, if any */
|
||||
if (token->start[0] == '/')
|
||||
if ( token->start[0] == '/' )
|
||||
token->start++;
|
||||
|
||||
len = (FT_Int)( token->limit - token->start );
|
||||
|
@ -444,13 +446,13 @@
|
|||
parse_blend_design_positions( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ];
|
||||
FT_Int num_designs;
|
||||
FT_Int num_axis;
|
||||
T1_Parser parser = &loader->parser;
|
||||
T1_TokenRec design_tokens[ T1_MAX_MM_DESIGNS ];
|
||||
FT_Int num_designs;
|
||||
FT_Int num_axis;
|
||||
T1_Parser parser = &loader->parser;
|
||||
|
||||
FT_Error error = 0;
|
||||
PS_Blend blend;
|
||||
FT_Error error = 0;
|
||||
PS_Blend blend;
|
||||
|
||||
|
||||
/* get the array of design tokens - compute number of designs */
|
||||
|
@ -475,9 +477,9 @@
|
|||
|
||||
for ( n = 0; n < (FT_UInt)num_designs; n++ )
|
||||
{
|
||||
T1_TokenRec axis_tokens[ T1_MAX_MM_DESIGNS ];
|
||||
T1_Token token;
|
||||
FT_Int axis, n_axis;
|
||||
T1_TokenRec axis_tokens[ T1_MAX_MM_DESIGNS ];
|
||||
T1_Token token;
|
||||
FT_Int axis, n_axis;
|
||||
|
||||
|
||||
/* read axis/coordinates tokens */
|
||||
|
@ -526,14 +528,14 @@
|
|||
parse_blend_design_map( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
T1_Parser parser = &loader->parser;
|
||||
PS_Blend blend;
|
||||
T1_TokenRec axis_tokens[ T1_MAX_MM_AXIS ];
|
||||
FT_Int n, num_axis;
|
||||
FT_Byte* old_cursor;
|
||||
FT_Byte* old_limit;
|
||||
FT_Memory memory = face->root.memory;
|
||||
FT_Error error = 0;
|
||||
T1_Parser parser = &loader->parser;
|
||||
PS_Blend blend;
|
||||
T1_TokenRec axis_tokens[T1_MAX_MM_AXIS];
|
||||
FT_Int n, num_axis;
|
||||
FT_Byte* old_cursor;
|
||||
FT_Byte* old_limit;
|
||||
FT_Memory memory = face->root.memory;
|
||||
|
||||
|
||||
T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &num_axis );
|
||||
|
@ -555,8 +557,8 @@
|
|||
/* now, read each axis design map */
|
||||
for ( n = 0; n < num_axis; n++ )
|
||||
{
|
||||
PS_DesignMap map = blend->design_map + n;
|
||||
T1_Token token;
|
||||
PS_DesignMap map = blend->design_map + n;
|
||||
T1_Token token;
|
||||
FT_Int p, num_points;
|
||||
|
||||
|
||||
|
@ -607,13 +609,13 @@
|
|||
parse_weight_vector( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
T1_Parser parser = &loader->parser;
|
||||
PS_Blend blend = face->blend;
|
||||
T1_TokenRec master;
|
||||
FT_UInt n;
|
||||
FT_Byte* old_cursor;
|
||||
FT_Byte* old_limit;
|
||||
FT_Error error = 0;
|
||||
T1_Parser parser = &loader->parser;
|
||||
PS_Blend blend = face->blend;
|
||||
T1_TokenRec master;
|
||||
FT_UInt n;
|
||||
FT_Byte* old_cursor;
|
||||
FT_Byte* old_limit;
|
||||
|
||||
|
||||
if ( !blend || blend->num_designs == 0 )
|
||||
|
@ -683,7 +685,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* First of all, define the token field static variables. This is a set */
|
||||
/* of T1_FieldRec variables used later. */
|
||||
/* of T1_FieldRec variables used later. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
@ -691,13 +693,13 @@
|
|||
static FT_Error
|
||||
t1_load_keyword( T1_Face face,
|
||||
T1_Loader* loader,
|
||||
T1_Field field )
|
||||
T1_Field field )
|
||||
{
|
||||
FT_Error error;
|
||||
void* dummy_object;
|
||||
void** objects;
|
||||
FT_UInt max_objects;
|
||||
PS_Blend blend = face->blend;
|
||||
PS_Blend blend = face->blend;
|
||||
|
||||
|
||||
/* if the keyword has a dedicated callback, call it */
|
||||
|
@ -774,8 +776,8 @@
|
|||
|
||||
static int
|
||||
read_binary_data( T1_Parser parser,
|
||||
FT_Int* size,
|
||||
FT_Byte** base )
|
||||
FT_Int* size,
|
||||
FT_Byte** base )
|
||||
{
|
||||
FT_Byte* cur;
|
||||
FT_Byte* limit = parser->root.limit;
|
||||
|
@ -819,12 +821,12 @@
|
|||
T1_Loader* loader )
|
||||
{
|
||||
T1_Parser parser = &loader->parser;
|
||||
FT_Error error;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Int len;
|
||||
FT_Byte* cur;
|
||||
FT_Byte* cur2;
|
||||
FT_Byte* limit;
|
||||
FT_Error error;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Int len;
|
||||
FT_Byte* cur;
|
||||
FT_Byte* cur2;
|
||||
FT_Byte* limit;
|
||||
|
||||
|
||||
if ( face->type1.font_name )
|
||||
|
@ -865,8 +867,8 @@
|
|||
T1_Loader* loader )
|
||||
{
|
||||
T1_Parser parser = &loader->parser;
|
||||
FT_Fixed temp[4];
|
||||
FT_BBox* bbox = &face->type1.font_bbox;
|
||||
FT_Fixed temp[4];
|
||||
FT_BBox* bbox = &face->type1.font_bbox;
|
||||
|
||||
|
||||
(void)T1_ToFixedArray( parser, 4, temp, 0 );
|
||||
|
@ -881,12 +883,12 @@
|
|||
parse_font_matrix( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
T1_Parser parser = &loader->parser;
|
||||
FT_Matrix* matrix = &face->type1.font_matrix;
|
||||
FT_Vector* offset = &face->type1.font_offset;
|
||||
FT_Face root = (FT_Face)&face->root;
|
||||
FT_Fixed temp[6];
|
||||
FT_Fixed temp_scale;
|
||||
T1_Parser parser = &loader->parser;
|
||||
FT_Matrix* matrix = &face->type1.font_matrix;
|
||||
FT_Vector* offset = &face->type1.font_offset;
|
||||
FT_Face root = (FT_Face)&face->root;
|
||||
FT_Fixed temp[6];
|
||||
FT_Fixed temp_scale;
|
||||
|
||||
|
||||
if ( matrix->xx || matrix->yx )
|
||||
|
@ -930,11 +932,11 @@
|
|||
parse_encoding( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
T1_Parser parser = &loader->parser;
|
||||
T1_Parser parser = &loader->parser;
|
||||
FT_Byte* cur = parser->root.cursor;
|
||||
FT_Byte* limit = parser->root.limit;
|
||||
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
|
||||
|
||||
/* skip whitespace */
|
||||
|
@ -954,10 +956,10 @@
|
|||
if ( (FT_Byte)( *cur - '0' ) < 10 )
|
||||
{
|
||||
T1_Encoding encode = &face->type1.encoding;
|
||||
FT_Int count, n;
|
||||
PS_Table char_table = &loader->encoding_table;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Error error;
|
||||
FT_Int count, n;
|
||||
PS_Table char_table = &loader->encoding_table;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( encode->char_index )
|
||||
|
@ -1104,7 +1106,7 @@
|
|||
FT_Error error;
|
||||
FT_Int n;
|
||||
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
|
||||
|
||||
if ( loader->num_subrs )
|
||||
|
@ -1129,7 +1131,6 @@
|
|||
/* */
|
||||
/* `index' + binary data */
|
||||
/* */
|
||||
|
||||
for ( n = 0; n < loader->num_subrs; n++ )
|
||||
{
|
||||
FT_Int idx, size;
|
||||
|
@ -1196,20 +1197,20 @@
|
|||
parse_charstrings( T1_Face face,
|
||||
T1_Loader* loader )
|
||||
{
|
||||
T1_Parser parser = &loader->parser;
|
||||
PS_Table code_table = &loader->charstrings;
|
||||
PS_Table name_table = &loader->glyph_names;
|
||||
PS_Table swap_table = &loader->swap_table;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
T1_Parser parser = &loader->parser;
|
||||
PS_Table code_table = &loader->charstrings;
|
||||
PS_Table name_table = &loader->glyph_names;
|
||||
PS_Table swap_table = &loader->swap_table;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Error error;
|
||||
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
|
||||
FT_Byte* cur;
|
||||
FT_Byte* limit = parser->root.limit;
|
||||
FT_Int n;
|
||||
FT_UInt notdef_index = 0;
|
||||
FT_Byte notdef_found = 0;
|
||||
FT_Byte* cur;
|
||||
FT_Byte* limit = parser->root.limit;
|
||||
FT_Int n;
|
||||
FT_UInt notdef_index = 0;
|
||||
FT_Byte notdef_found = 0;
|
||||
|
||||
|
||||
if ( loader->num_glyphs )
|
||||
|
@ -1400,11 +1401,10 @@
|
|||
}
|
||||
else if ( !notdef_found )
|
||||
{
|
||||
|
||||
/* notdef_index is already 0, or /.notdef is undefined in */
|
||||
/* charstrings dictionary. Worry about /.notdef undefined. */
|
||||
/* We take index 0 and add it to the end of the table(s) */
|
||||
/* and add our own /.notdef glyph to index 0. */
|
||||
/* notdef_index is already 0, or /.notdef is undefined in */
|
||||
/* charstrings dictionary. Worry about /.notdef undefined. */
|
||||
/* We take index 0 and add it to the end of the table(s) */
|
||||
/* and add our own /.notdef glyph to index 0. */
|
||||
|
||||
/* 0 333 hsbw endchar */
|
||||
FT_Byte notdef_glyph[] = {0x8B, 0xF7, 0xE1, 0x0D, 0x0E};
|
||||
|
@ -1639,10 +1639,10 @@
|
|||
FT_LOCAL_DEF( FT_Error )
|
||||
T1_Open_Face( T1_Face face )
|
||||
{
|
||||
T1_Loader loader;
|
||||
T1_Parser parser;
|
||||
T1_Font type1 = &face->type1;
|
||||
FT_Error error;
|
||||
T1_Loader loader;
|
||||
T1_Parser parser;
|
||||
T1_Font type1 = &face->type1;
|
||||
FT_Error error;
|
||||
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
|
||||
|
@ -1653,10 +1653,10 @@
|
|||
type1->private_dict.lenIV = 4;
|
||||
|
||||
parser = &loader.parser;
|
||||
error = T1_New_Parser( parser,
|
||||
face->root.stream,
|
||||
face->root.memory,
|
||||
psaux );
|
||||
error = T1_New_Parser( parser,
|
||||
face->root.stream,
|
||||
face->root.memory,
|
||||
psaux );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 font loader (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 objects manager (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -141,7 +141,7 @@
|
|||
|
||||
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
T1_GlyphSlot_Init( T1_GlyphSlot slot )
|
||||
T1_GlyphSlot_Init( T1_GlyphSlot slot )
|
||||
{
|
||||
T1_Face face;
|
||||
PSHinter_Service pshinter;
|
||||
|
@ -190,7 +190,7 @@
|
|||
T1_Face_Done( T1_Face face )
|
||||
{
|
||||
FT_Memory memory;
|
||||
T1_Font type1 = &face->type1;
|
||||
T1_Font type1 = &face->type1;
|
||||
|
||||
|
||||
if ( face )
|
||||
|
@ -205,7 +205,7 @@
|
|||
|
||||
/* release font info strings */
|
||||
{
|
||||
PS_FontInfo info = &type1->font_info;
|
||||
PS_FontInfo info = &type1->font_info;
|
||||
|
||||
|
||||
FT_FREE( info->version );
|
||||
|
@ -351,6 +351,7 @@
|
|||
char* full = face->type1.font_info.full_name;
|
||||
char* family = root->family_name;
|
||||
|
||||
|
||||
if ( full )
|
||||
{
|
||||
while ( *family && *full == *family )
|
||||
|
@ -390,10 +391,10 @@
|
|||
root->num_fixed_sizes = 0;
|
||||
root->available_sizes = 0;
|
||||
|
||||
root->bbox.xMin = face->type1.font_bbox.xMin >> 16;
|
||||
root->bbox.yMin = face->type1.font_bbox.yMin >> 16;
|
||||
root->bbox.xMax = (face->type1.font_bbox.xMax + 0xFFFFU) >> 16;
|
||||
root->bbox.yMax = (face->type1.font_bbox.yMax + 0xFFFFU) >> 16;
|
||||
root->bbox.xMin = face->type1.font_bbox.xMin >> 16;
|
||||
root->bbox.yMin = face->type1.font_bbox.yMin >> 16;
|
||||
root->bbox.xMax = ( face->type1.font_bbox.xMax + 0xFFFFU ) >> 16;
|
||||
root->bbox.yMax = ( face->type1.font_bbox.yMax + 0xFFFFU ) >> 16;
|
||||
|
||||
/* Set units_per_EM if we didn't set it in parse_font_matrix. */
|
||||
if ( !root->units_per_EM )
|
||||
|
@ -432,14 +433,16 @@
|
|||
#ifdef FT_CONFIG_OPTION_USE_CMAPS
|
||||
|
||||
{
|
||||
FT_Face root = &face->root;
|
||||
FT_Face root = &face->root;
|
||||
|
||||
|
||||
if ( psnames && psaux )
|
||||
{
|
||||
FT_CharMapRec charmap;
|
||||
T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes;
|
||||
FT_CMap_Class clazz;
|
||||
|
||||
|
||||
charmap.face = root;
|
||||
|
||||
/* first of all, try to synthetize a Unicode charmap */
|
||||
|
@ -455,32 +458,32 @@
|
|||
|
||||
switch ( face->type1.encoding_type )
|
||||
{
|
||||
case T1_ENCODING_TYPE_STANDARD:
|
||||
charmap.encoding = ft_encoding_adobe_standard;
|
||||
charmap.encoding_id = 0;
|
||||
clazz = cmap_classes->standard;
|
||||
break;
|
||||
case T1_ENCODING_TYPE_STANDARD:
|
||||
charmap.encoding = ft_encoding_adobe_standard;
|
||||
charmap.encoding_id = 0;
|
||||
clazz = cmap_classes->standard;
|
||||
break;
|
||||
|
||||
case T1_ENCODING_TYPE_EXPORT:
|
||||
charmap.encoding = ft_encoding_adobe_expert;
|
||||
charmap.encoding_id = 1;
|
||||
clazz = cmap_classes->expert;
|
||||
break;
|
||||
case T1_ENCODING_TYPE_EXPORT:
|
||||
charmap.encoding = ft_encoding_adobe_expert;
|
||||
charmap.encoding_id = 1;
|
||||
clazz = cmap_classes->expert;
|
||||
break;
|
||||
|
||||
case T1_ENCODING_TYPE_ARRAY:
|
||||
charmap.encoding = ft_encoding_adobe_custom;
|
||||
charmap.encoding_id = 2;
|
||||
clazz = cmap_classes->custom;
|
||||
break;
|
||||
case T1_ENCODING_TYPE_ARRAY:
|
||||
charmap.encoding = ft_encoding_adobe_custom;
|
||||
charmap.encoding_id = 2;
|
||||
clazz = cmap_classes->custom;
|
||||
break;
|
||||
|
||||
case T1_ENCODING_TYPE_ISOLATIN1:
|
||||
charmap.encoding = ft_encoding_latin_1;
|
||||
charmap.encoding_id = 3;
|
||||
clazz = cmap_classes->unicode;
|
||||
break;
|
||||
case T1_ENCODING_TYPE_ISOLATIN1:
|
||||
charmap.encoding = ft_encoding_latin_1;
|
||||
charmap.encoding_id = 3;
|
||||
clazz = cmap_classes->unicode;
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
||||
if ( clazz )
|
||||
|
@ -600,7 +603,7 @@
|
|||
/* Finalizes a given Type 1 driver. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* driver :: A handle to the target Type 1 driver. */
|
||||
/* driver :: A handle to the target Type 1 driver. */
|
||||
/* */
|
||||
FT_LOCAL_DEF( void )
|
||||
T1_Driver_Done( T1_Driver driver )
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 objects manager (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 parser (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -108,7 +108,7 @@
|
|||
*size = 0;
|
||||
if ( !FT_STREAM_READ_FIELDS( pfb_tag_fields, &head ) )
|
||||
{
|
||||
if ( head.tag == 0x8001 || head.tag == 0x8002 )
|
||||
if ( head.tag == 0x8001U || head.tag == 0x8002U )
|
||||
{
|
||||
*tag = head.tag;
|
||||
*size = head.size;
|
||||
|
@ -165,7 +165,7 @@
|
|||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
if ( tag != 0x8001 )
|
||||
if ( tag != 0x8001U )
|
||||
{
|
||||
/* assume that this is a PFA file for now; an error will */
|
||||
/* be produced later when more things are checked */
|
||||
|
@ -230,7 +230,7 @@
|
|||
FT_LOCAL_DEF( void )
|
||||
T1_Finalize_Parser( T1_Parser parser )
|
||||
{
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
|
||||
|
||||
/* always free the private dictionary */
|
||||
|
@ -294,7 +294,7 @@
|
|||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
if ( tag != 0x8002 )
|
||||
if ( tag != 0x8002U )
|
||||
break;
|
||||
|
||||
parser->private_len += size;
|
||||
|
@ -321,7 +321,7 @@
|
|||
for (;;)
|
||||
{
|
||||
error = read_pfb_tag( stream, &tag, &size );
|
||||
if ( error || tag != 0x8002 )
|
||||
if ( error || tag != 0x8002U )
|
||||
{
|
||||
error = T1_Err_Ok;
|
||||
break;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 parser (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -97,19 +97,19 @@ FT_BEGIN_HEADER
|
|||
#define T1_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
|
||||
#define T1_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
|
||||
|
||||
#define T1_ToCoordArray( p, m, c ) \
|
||||
#define T1_ToCoordArray( p, m, c ) \
|
||||
(p)->root.funcs.to_coord_array( &(p)->root, m, c )
|
||||
#define T1_ToFixedArray( p, m, f, t ) \
|
||||
#define T1_ToFixedArray( p, m, f, t ) \
|
||||
(p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
|
||||
#define T1_ToToken( p, t ) \
|
||||
#define T1_ToToken( p, t ) \
|
||||
(p)->root.funcs.to_token( &(p)->root, t )
|
||||
#define T1_ToTokenArray( p, t, m, c ) \
|
||||
#define T1_ToTokenArray( p, t, m, c ) \
|
||||
(p)->root.funcs.to_token_array( &(p)->root, t, m, c )
|
||||
|
||||
#define T1_Load_Field( p, f, o, m, pf ) \
|
||||
#define T1_Load_Field( p, f, o, m, pf ) \
|
||||
(p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
|
||||
|
||||
#define T1_Load_Field_Table( p, f, o, m, pf ) \
|
||||
#define T1_Load_Field_Table( p, f, o, m, pf ) \
|
||||
(p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Type 1 tokenizer (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -21,16 +21,16 @@
|
|||
#undef T1CODE
|
||||
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
|
||||
|
||||
T1_FIELD_STRING( "version", version )
|
||||
T1_FIELD_STRING( "Notice", notice )
|
||||
T1_FIELD_STRING( "FullName", full_name )
|
||||
T1_FIELD_STRING( "FamilyName", family_name )
|
||||
T1_FIELD_STRING( "Weight", weight )
|
||||
T1_FIELD_STRING ( "version", version )
|
||||
T1_FIELD_STRING ( "Notice", notice )
|
||||
T1_FIELD_STRING ( "FullName", full_name )
|
||||
T1_FIELD_STRING ( "FamilyName", family_name )
|
||||
T1_FIELD_STRING ( "Weight", weight )
|
||||
|
||||
T1_FIELD_NUM ( "ItalicAngle", italic_angle )
|
||||
T1_FIELD_TYPE_BOOL ( "isFixedPitch", is_fixed_pitch )
|
||||
T1_FIELD_NUM ( "UnderlinePosition", underline_position )
|
||||
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
|
||||
T1_FIELD_NUM ( "ItalicAngle", italic_angle )
|
||||
T1_FIELD_TYPE_BOOL( "isFixedPitch", is_fixed_pitch )
|
||||
T1_FIELD_NUM ( "UnderlinePosition", underline_position )
|
||||
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness )
|
||||
|
||||
|
||||
#undef FT_STRUCTURE
|
||||
|
|
Loading…
Reference in New Issue