formatting
This commit is contained in:
parent
d0165401bb
commit
d573c7e76b
|
@ -173,8 +173,8 @@
|
|||
static
|
||||
FT_Error Load_Glyph( CFF_GlyphSlot slot,
|
||||
CFF_Size size,
|
||||
FT_UShort glyph_index,
|
||||
FT_UInt load_flags )
|
||||
FT_UShort glyph_index,
|
||||
FT_UInt load_flags )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
@ -236,10 +236,10 @@
|
|||
/* */
|
||||
static
|
||||
FT_UInt cff_get_char_index( TT_CharMap charmap,
|
||||
FT_Long charcode )
|
||||
FT_Long charcode )
|
||||
{
|
||||
FT_Error error;
|
||||
CFF_Face face;
|
||||
CFF_Face face;
|
||||
TT_CMapTable* cmap;
|
||||
|
||||
|
||||
|
@ -277,8 +277,8 @@
|
|||
|
||||
|
||||
static
|
||||
FT_Module_Interface cff_get_interface( CFF_Driver driver,
|
||||
const char* interface )
|
||||
FT_Module_Interface cff_get_interface( CFF_Driver driver,
|
||||
const char* interface )
|
||||
{
|
||||
FT_Module sfnt;
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Init_Builder */
|
||||
/* CFF_Init_Builder */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initializes a given glyph builder. */
|
||||
|
@ -220,9 +220,9 @@
|
|||
/* */
|
||||
static
|
||||
void CFF_Init_Builder( CFF_Builder* builder,
|
||||
TT_Face face,
|
||||
CFF_Size size,
|
||||
CFF_GlyphSlot glyph )
|
||||
TT_Face face,
|
||||
CFF_Size size,
|
||||
CFF_GlyphSlot glyph )
|
||||
{
|
||||
builder->path_begun = 0;
|
||||
builder->load_points = 1;
|
||||
|
@ -261,7 +261,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Done_Builder */
|
||||
/* CFF_Done_Builder */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Finalizes a given glyph builder. Its contents can still be used */
|
||||
|
@ -285,7 +285,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* cff_compute_bias */
|
||||
/* cff_compute_bias */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Computes the bias value in dependence of the number of glyph */
|
||||
|
@ -316,7 +316,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Init_Decoder */
|
||||
/* CFF_Init_Decoder */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initializes a given glyph decoder. */
|
||||
|
@ -332,10 +332,10 @@
|
|||
/* slot :: The current glyph object. */
|
||||
/* */
|
||||
FT_LOCAL_DEF
|
||||
void CFF_Init_Decoder( CFF_Decoder* decoder,
|
||||
TT_Face face,
|
||||
CFF_Size size,
|
||||
CFF_GlyphSlot slot )
|
||||
void CFF_Init_Decoder( CFF_Decoder* decoder,
|
||||
TT_Face face,
|
||||
CFF_Size size,
|
||||
CFF_GlyphSlot slot )
|
||||
{
|
||||
CFF_Font* cff = (CFF_Font*)face->extra.data;
|
||||
|
||||
|
@ -356,7 +356,7 @@
|
|||
/* this function is used to select the locals subrs array */
|
||||
FT_LOCAL_DEF
|
||||
void CFF_Prepare_Decoder( CFF_Decoder* decoder,
|
||||
FT_UInt glyph_index )
|
||||
FT_UInt glyph_index )
|
||||
{
|
||||
CFF_Font* cff = (CFF_Font*)decoder->builder.face->extra.data;
|
||||
CFF_SubFont* sub = &cff->top_font;
|
||||
|
@ -383,7 +383,7 @@
|
|||
/* check that there is enough room for `count' more points */
|
||||
static
|
||||
FT_Error check_points( CFF_Builder* builder,
|
||||
FT_Int count )
|
||||
FT_Int count )
|
||||
{
|
||||
return FT_GlyphLoader_Check_Points( builder->loader, count, 0 );
|
||||
}
|
||||
|
@ -392,9 +392,9 @@
|
|||
/* add a new point, do not check space */
|
||||
static
|
||||
void add_point( CFF_Builder* builder,
|
||||
FT_Pos x,
|
||||
FT_Pos y,
|
||||
FT_Byte flag )
|
||||
FT_Pos x,
|
||||
FT_Pos y,
|
||||
FT_Byte flag )
|
||||
{
|
||||
FT_Outline* outline = builder->current;
|
||||
|
||||
|
@ -418,8 +418,8 @@
|
|||
/* check space for a new on-curve point, then add it */
|
||||
static
|
||||
FT_Error add_point1( CFF_Builder* builder,
|
||||
FT_Pos x,
|
||||
FT_Pos y )
|
||||
FT_Pos x,
|
||||
FT_Pos y )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
@ -462,8 +462,8 @@
|
|||
/* if a path was begun, add its first on-curve point */
|
||||
static
|
||||
FT_Error start_point( CFF_Builder* builder,
|
||||
FT_Pos x,
|
||||
FT_Pos y )
|
||||
FT_Pos x,
|
||||
FT_Pos y )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
|
||||
|
@ -516,7 +516,7 @@
|
|||
|
||||
static
|
||||
FT_Int cff_lookup_glyph_by_stdcharcode( CFF_Font* cff,
|
||||
FT_Int charcode )
|
||||
FT_Int charcode )
|
||||
{
|
||||
FT_UInt n;
|
||||
FT_UShort glyph_sid;
|
||||
|
@ -542,10 +542,10 @@
|
|||
|
||||
static
|
||||
FT_Error cff_operator_seac( CFF_Decoder* decoder,
|
||||
FT_Pos adx,
|
||||
FT_Pos ady,
|
||||
FT_Int bchar,
|
||||
FT_Int achar )
|
||||
FT_Pos adx,
|
||||
FT_Pos ady,
|
||||
FT_Int bchar,
|
||||
FT_Int achar )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Int bchar_index, achar_index, n_base_points;
|
||||
|
@ -667,7 +667,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Parse_CharStrings */
|
||||
/* CFF_Parse_CharStrings */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Parses a given Type 2 charstrings program. */
|
||||
|
@ -685,18 +685,18 @@
|
|||
/* */
|
||||
FT_LOCAL_DEF
|
||||
FT_Error CFF_Parse_CharStrings( CFF_Decoder* decoder,
|
||||
FT_Byte* charstring_base,
|
||||
FT_Int charstring_len )
|
||||
FT_Byte* charstring_base,
|
||||
FT_Int charstring_len )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Error error;
|
||||
CFF_Decoder_Zone* zone;
|
||||
FT_Byte* ip;
|
||||
FT_Byte* limit;
|
||||
FT_Byte* ip;
|
||||
FT_Byte* limit;
|
||||
CFF_Builder* builder = &decoder->builder;
|
||||
FT_Outline* outline;
|
||||
FT_Pos x, y;
|
||||
FT_Fixed seed;
|
||||
FT_Fixed* stack;
|
||||
FT_Outline* outline;
|
||||
FT_Pos x, y;
|
||||
FT_Fixed seed;
|
||||
FT_Fixed* stack;
|
||||
|
||||
|
||||
/* set default width */
|
||||
|
@ -733,7 +733,7 @@
|
|||
while ( ip < limit )
|
||||
{
|
||||
CFF_Operator op;
|
||||
FT_Byte v;
|
||||
FT_Byte v;
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
|
@ -1054,7 +1054,7 @@
|
|||
FT_TRACE4(( op == cff_op_hstem ? " hstem" :
|
||||
op == cff_op_vstem ? " vstem" :
|
||||
op == cff_op_hstemhm ? " hstemhm" :
|
||||
" vstemhm" ));
|
||||
" vstemhm" ));
|
||||
decoder->num_hints += num_args / 2;
|
||||
args = stack;
|
||||
break;
|
||||
|
@ -1062,7 +1062,7 @@
|
|||
case cff_op_hintmask:
|
||||
case cff_op_cntrmask:
|
||||
FT_TRACE4(( op == cff_op_hintmask ? " hintmask"
|
||||
: " cntrmask" ));
|
||||
: " cntrmask" ));
|
||||
|
||||
decoder->num_hints += num_args / 2;
|
||||
ip += ( decoder->num_hints + 7 ) >> 3;
|
||||
|
@ -1127,7 +1127,7 @@
|
|||
|
||||
|
||||
FT_TRACE4(( op == cff_op_hlineto ? " hlineto"
|
||||
: " vlineto" ));
|
||||
: " vlineto" ));
|
||||
|
||||
if ( start_point ( builder, x, y ) ||
|
||||
check_points( builder, num_args ) )
|
||||
|
@ -1254,7 +1254,7 @@
|
|||
|
||||
|
||||
FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto"
|
||||
: " hvcurveto" ));
|
||||
: " hvcurveto" ));
|
||||
|
||||
if ( start_point ( builder, x, y ) )
|
||||
goto Memory_Error;
|
||||
|
@ -1584,8 +1584,9 @@
|
|||
/* We are going to emulate the seac operator. */
|
||||
if ( num_args == 4 )
|
||||
{
|
||||
error = cff_operator_seac( decoder, args[0] >> 16, args[1] >> 16,
|
||||
args[2] >> 16, args[3] >> 16 );
|
||||
error = cff_operator_seac( decoder,
|
||||
args[0] >> 16, args[1] >> 16,
|
||||
args[2] >> 16, args[3] >> 16 );
|
||||
args += 4;
|
||||
}
|
||||
|
||||
|
@ -2021,12 +2022,12 @@
|
|||
|
||||
FT_LOCAL_DEF
|
||||
FT_Error CFF_Compute_Max_Advance( TT_Face face,
|
||||
FT_Int* max_advance )
|
||||
FT_Int* max_advance )
|
||||
{
|
||||
FT_Error error = 0;
|
||||
FT_Error error = 0;
|
||||
CFF_Decoder decoder;
|
||||
FT_Int glyph_index;
|
||||
CFF_Font* cff = (CFF_Font*)face->other;
|
||||
FT_Int glyph_index;
|
||||
CFF_Font* cff = (CFF_Font*)face->other;
|
||||
|
||||
|
||||
*max_advance = 0;
|
||||
|
@ -2048,7 +2049,7 @@
|
|||
|
||||
/* now get load the unscaled outline */
|
||||
error = CFF_Access_Element( &cff->charstrings_index, glyph_index,
|
||||
&charstring, &charstring_len );
|
||||
&charstring, &charstring_len );
|
||||
if ( !error )
|
||||
{
|
||||
CFF_Prepare_Decoder( &decoder, glyph_index );
|
||||
|
@ -2088,18 +2089,18 @@
|
|||
|
||||
FT_LOCAL_DEF
|
||||
FT_Error CFF_Load_Glyph( CFF_GlyphSlot glyph,
|
||||
CFF_Size size,
|
||||
FT_Int glyph_index,
|
||||
FT_Int load_flags )
|
||||
CFF_Size size,
|
||||
FT_Int glyph_index,
|
||||
FT_Int load_flags )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Error error;
|
||||
CFF_Decoder decoder;
|
||||
TT_Face face = (TT_Face)glyph->root.face;
|
||||
FT_Bool hinting;
|
||||
CFF_Font* cff = (CFF_Font*)face->extra.data;
|
||||
TT_Face face = (TT_Face)glyph->root.face;
|
||||
FT_Bool hinting;
|
||||
CFF_Font* cff = (CFF_Font*)face->extra.data;
|
||||
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
FT_Matrix font_matrix;
|
||||
FT_Vector font_offset;
|
||||
|
||||
|
||||
if ( load_flags & FT_LOAD_NO_RECURSE )
|
||||
|
|
|
@ -35,7 +35,7 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Structure> */
|
||||
/* CFF_Builder */
|
||||
/* CFF_Builder */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used during glyph loading to store its outline. */
|
||||
|
@ -86,31 +86,31 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
typedef struct CFF_Builder_
|
||||
{
|
||||
FT_Memory memory;
|
||||
TT_Face face;
|
||||
FT_Memory memory;
|
||||
TT_Face face;
|
||||
CFF_GlyphSlot glyph;
|
||||
FT_GlyphLoader* loader;
|
||||
FT_Outline* base;
|
||||
FT_Outline* current;
|
||||
FT_GlyphLoader* loader;
|
||||
FT_Outline* base;
|
||||
FT_Outline* current;
|
||||
|
||||
FT_Vector last;
|
||||
FT_Vector last;
|
||||
|
||||
FT_Fixed scale_x;
|
||||
FT_Fixed scale_y;
|
||||
FT_Fixed scale_x;
|
||||
FT_Fixed scale_y;
|
||||
|
||||
FT_Pos pos_x;
|
||||
FT_Pos pos_y;
|
||||
FT_Pos pos_x;
|
||||
FT_Pos pos_y;
|
||||
|
||||
FT_Vector left_bearing;
|
||||
FT_Vector advance;
|
||||
FT_Vector left_bearing;
|
||||
FT_Vector advance;
|
||||
|
||||
FT_BBox bbox; /* bounding box */
|
||||
FT_Bool path_begun;
|
||||
FT_Bool load_points;
|
||||
FT_Bool no_recurse;
|
||||
FT_BBox bbox; /* bounding box */
|
||||
FT_Bool path_begun;
|
||||
FT_Bool load_points;
|
||||
FT_Bool no_recurse;
|
||||
|
||||
FT_Error error; /* only used for memory errors */
|
||||
FT_Bool metrics_only;
|
||||
FT_Error error; /* only used for memory errors */
|
||||
FT_Bool metrics_only;
|
||||
|
||||
} CFF_Builder;
|
||||
|
||||
|
@ -129,70 +129,70 @@ FT_BEGIN_HEADER
|
|||
typedef struct CFF_Decoder_
|
||||
{
|
||||
CFF_Builder builder;
|
||||
CFF_Font* cff;
|
||||
CFF_Font* cff;
|
||||
|
||||
FT_Fixed stack[CFF_MAX_OPERANDS + 1];
|
||||
FT_Fixed* top;
|
||||
FT_Fixed stack[CFF_MAX_OPERANDS + 1];
|
||||
FT_Fixed* top;
|
||||
|
||||
CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
|
||||
CFF_Decoder_Zone* zone;
|
||||
|
||||
FT_Int flex_state;
|
||||
FT_Int num_flex_vectors;
|
||||
FT_Vector flex_vectors[7];
|
||||
FT_Int flex_state;
|
||||
FT_Int num_flex_vectors;
|
||||
FT_Vector flex_vectors[7];
|
||||
|
||||
FT_Pos glyph_width;
|
||||
FT_Pos nominal_width;
|
||||
FT_Pos glyph_width;
|
||||
FT_Pos nominal_width;
|
||||
|
||||
FT_Bool read_width;
|
||||
FT_Int num_hints;
|
||||
FT_Fixed* buildchar;
|
||||
FT_Int len_buildchar;
|
||||
FT_Bool read_width;
|
||||
FT_Int num_hints;
|
||||
FT_Fixed* buildchar;
|
||||
FT_Int len_buildchar;
|
||||
|
||||
FT_UInt num_locals;
|
||||
FT_UInt num_globals;
|
||||
FT_UInt num_locals;
|
||||
FT_UInt num_globals;
|
||||
|
||||
FT_Int locals_bias;
|
||||
FT_Int globals_bias;
|
||||
FT_Int locals_bias;
|
||||
FT_Int globals_bias;
|
||||
|
||||
FT_Byte** locals;
|
||||
FT_Byte** globals;
|
||||
FT_Byte** locals;
|
||||
FT_Byte** globals;
|
||||
|
||||
FT_Byte** glyph_names; /* for pure CFF fonts only */
|
||||
FT_UInt num_glyphs; /* number of glyphs in font */
|
||||
FT_Byte** glyph_names; /* for pure CFF fonts only */
|
||||
FT_UInt num_glyphs; /* number of glyphs in font */
|
||||
|
||||
} CFF_Decoder;
|
||||
|
||||
|
||||
FT_LOCAL
|
||||
void CFF_Init_Decoder( CFF_Decoder* decoder,
|
||||
TT_Face face,
|
||||
CFF_Size size,
|
||||
CFF_GlyphSlot slot );
|
||||
TT_Face face,
|
||||
CFF_Size size,
|
||||
CFF_GlyphSlot slot );
|
||||
|
||||
FT_LOCAL
|
||||
void CFF_Prepare_Decoder( CFF_Decoder* decoder,
|
||||
FT_UInt glyph_index );
|
||||
FT_UInt glyph_index );
|
||||
|
||||
#if 0 /* unused until we support pure CFF fonts */
|
||||
|
||||
/* Compute the maximum advance width of a font through quick parsing */
|
||||
FT_LOCAL
|
||||
FT_Error CFF_Compute_Max_Advance( TT_Face face,
|
||||
FT_Int* max_advance );
|
||||
FT_Int* max_advance );
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
FT_LOCAL
|
||||
FT_Error CFF_Parse_CharStrings( CFF_Decoder* decoder,
|
||||
FT_Byte* charstring_base,
|
||||
FT_Int charstring_len );
|
||||
FT_Byte* charstring_base,
|
||||
FT_Int charstring_len );
|
||||
|
||||
FT_LOCAL
|
||||
FT_Error CFF_Load_Glyph( CFF_GlyphSlot glyph,
|
||||
CFF_Size size,
|
||||
FT_Int glyph_index,
|
||||
FT_Int load_flags );
|
||||
CFF_Size size,
|
||||
FT_Int glyph_index,
|
||||
FT_Int load_flags );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
static
|
||||
FT_String* CFF_StrCopy( FT_Memory memory,
|
||||
const FT_String* source )
|
||||
const FT_String* source )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_String* result = 0;
|
||||
|
@ -71,7 +71,7 @@
|
|||
/* this function is used to build a Unicode charmap from the glyph names */
|
||||
/* in a file */
|
||||
static
|
||||
FT_Error CFF_Build_Unicode_Charmap( CFF_Face face,
|
||||
FT_Error CFF_Build_Unicode_Charmap( CFF_Face face,
|
||||
FT_ULong base_offset,
|
||||
PSNames_Interface* psnames )
|
||||
{
|
||||
|
@ -119,8 +119,8 @@
|
|||
|
||||
for ( ; gname < limit; gname++ )
|
||||
gname[0] = CFF_Get_String( &font->string_index,
|
||||
GET_UShort(),
|
||||
psnames );
|
||||
GET_UShort(),
|
||||
psnames );
|
||||
FORGET_Frame();
|
||||
break;
|
||||
}
|
||||
|
@ -156,8 +156,8 @@
|
|||
for ( ; count > 0; count-- )
|
||||
{
|
||||
gname[0] = CFF_Get_String( &font->string_index,
|
||||
first,
|
||||
psnames );
|
||||
first,
|
||||
psnames );
|
||||
gname++;
|
||||
first++;
|
||||
}
|
||||
|
@ -239,7 +239,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Init_Face */
|
||||
/* CFF_Init_Face */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initializes a given OpenType face object. */
|
||||
|
@ -261,10 +261,10 @@
|
|||
/* */
|
||||
FT_LOCAL
|
||||
FT_Error CFF_Init_Face( FT_Stream stream,
|
||||
CFF_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params )
|
||||
CFF_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params )
|
||||
{
|
||||
FT_Error error;
|
||||
SFNT_Interface* sfnt;
|
||||
|
@ -496,7 +496,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Done_Face */
|
||||
/* CFF_Done_Face */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Finalizes a given face object. */
|
||||
|
@ -530,7 +530,7 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* CFF_Init_Driver */
|
||||
/* CFF_Init_Driver */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initializes a given OpenType driver object. */
|
||||
|
|
|
@ -33,7 +33,7 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* CFF_Driver */
|
||||
/* CFF_Driver */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to an OpenType driver object. */
|
||||
|
@ -46,7 +46,7 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* CFF_Size */
|
||||
/* CFF_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to an OpenType size object. */
|
||||
|
@ -57,12 +57,12 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* CFF_GlyphSlot */
|
||||
/* CFF_GlyphSlot */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to an OpenType glyph slot object. */
|
||||
/* */
|
||||
typedef struct CFF_GlyphSlotRec_
|
||||
typedef struct CFF_GlyphSlotRec_
|
||||
{
|
||||
FT_GlyphSlotRec root;
|
||||
|
||||
|
@ -116,10 +116,10 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
FT_LOCAL
|
||||
FT_Error CFF_Init_Face( FT_Stream stream,
|
||||
CFF_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
CFF_Face face,
|
||||
FT_Int face_index,
|
||||
FT_Int num_params,
|
||||
FT_Parameter* params );
|
||||
|
||||
FT_LOCAL
|
||||
void CFF_Done_Face( CFF_Face face );
|
||||
|
|
Loading…
Reference in New Issue