21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
23#include FT_INTERNAL_POSTSCRIPT_AUX_H
33#define FT_COMPONENT trace_t42
59#define FT_STRUCTURE T1_FontInfo
61#define T1CODE T1_FIELD_LOCATION_FONT_INFO
71 T1_FIELD_NUM (
"UnderlineThickness", underline_thickness, 0 )
74#define FT_STRUCTURE PS_FontExtraRec
76#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
81#define FT_STRUCTURE T1_FontRec
83#define T1CODE T1_FIELD_LOCATION_FONT_DICT
91#define FT_STRUCTURE FT_BBox
93#define T1CODE T1_FIELD_LOCATION_BBOX
106#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
107#define T1_Release_Table( p ) \
110 if ( (p)->funcs.release ) \
111 (p)->funcs.release( p ); \
114#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
115#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
117#define T1_ToInt( p ) \
118 (p)->root.funcs.to_int( &(p)->root )
119#define T1_ToBytes( p, b, m, n, d ) \
120 (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d )
122#define T1_ToFixedArray( p, m, f, t ) \
123 (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
124#define T1_ToToken( p, t ) \
125 (p)->root.funcs.to_token( &(p)->root, t )
127#define T1_Load_Field( p, f, o, m, pf ) \
128 (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
129#define T1_Load_Field_Table( p, f, o, m, pf ) \
130 (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
236 return (
c ==
' ' ||
c ==
'\t' ||
237 c ==
'\r' ||
c ==
'\n' ||
c ==
'\f' ||
264 if ( temp_scale == 0 )
266 FT_ERROR((
"t42_parse_font_matrix: invalid font matrix\n" ));
272 if ( temp_scale != 0x10000L )
279 temp[3] =
temp[3] < 0 ? -0x10000L : 0x10000L;
308 FT_ERROR((
"t42_parse_encoding: out of bounds\n" ));
339 FT_ERROR((
"t42_parse_encoding: invalid encoding array size\n" ));
349 if ( encode->char_index )
370 char* notdef = (
char *)
".notdef";
406 if (
cur[1] ==
'e' &&
428 if ( only_immediates )
469 else if ( only_immediates )
502 ft_strncmp( (
const char*)
cur,
"StandardEncoding", 16 ) == 0 )
510 ft_strncmp( (
const char*)
cur,
"ISOLatin1Encoding", 17 ) == 0 )
540 FT_ULong n, string_size, old_string_size, real_size;
565 FT_ERROR((
"t42_parse_sfnts: can't find begin of sfnts vector\n" ));
589 else if ( *
cur ==
'<' )
599 FT_ERROR((
"t42_parse_sfnts: invalid data in sfnts array\n" ));
603 if (
FT_REALLOC( string_buf, old_string_size, string_size ) )
610 old_string_size = string_size;
611 string_size = real_size;
622 "can't handle mixed binary and hex strings\n" ));
630 FT_ERROR((
"t42_parse_sfnts: invalid string size\n" ));
641 string_buf =
parser->root.cursor + 1;
645 FT_ERROR((
"t42_parse_sfnts: too much binary data\n" ));
650 parser->root.cursor += string_size + 1;
655 FT_ERROR((
"t42_parse_sfnts: invalid data in sfnts array\n" ));
662 if ( ( string_size & 1 ) && string_buf[string_size - 1] == 0 )
667 FT_ERROR((
"t42_parse_sfnts: invalid string\n" ));
677 for (
n = 0;
n < string_size;
n++ )
690 num_tables = 16 *
face->ttf_data[4] +
face->ttf_data[5];
692 face->ttf_size = 12 + 16 * num_tables;
696 FT_ERROR((
"t42_parse_sfnts: invalid data in sfnts array\n" ));
708 if ( count < face->ttf_size )
719 for (
i = 0;
i < num_tables;
i++ )
729 " invalid data in sfnts array\n" ));
741 face->ttf_size + 1 ) )
750 FT_ERROR((
"t42_parse_sfnts: too much binary data\n" ));
797 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
809 FT_ERROR((
"t42_parse_encoding: invalid number of glyphs\n" ));
817 FT_TRACE0((
"t42_parse_charstrings: adjusting number of glyphs"
818 " (from %d to %d)\n",
825 else if ( *
parser->root.cursor ==
'<' )
840 if ( *
parser->root.cursor ==
'/' )
842 else if ( *
parser->root.cursor ==
'>' )
856 FT_ERROR((
"t42_parse_charstrings: invalid token\n" ));
863 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
871 if ( swap_table->
init )
874 " only one CharStrings array allowed\n" ));
929 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
936 if ( *
cur ==
'/' || *
cur ==
'(' )
942 if (
cur + ( have_literal ? 3 : 2 ) >=
limit )
944 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
964 (
const char*)(name_table->
elements[
n]) ) == 0 )
980 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
1001 if ( !notdef_found )
1003 FT_ERROR((
"t42_parse_charstrings: no /.notdef glyph\n" ));
1010 (
const char*)name_table->
elements[0] ) )
1034 name_table->
elements[notdef_index],
1035 name_table->
lengths [notdef_index] );
1041 code_table->
elements[notdef_index],
1042 code_table->
lengths [notdef_index] );
1101 switch (
field->location )
1104 dummy_object = &
face->type1.font_info;
1108 dummy_object = &
face->type1.font_extra;
1112 dummy_object = &
face->type1.font_bbox;
1116 dummy_object = &
face->type1;
1198 cur2 =
parser->root.cursor;
1200 parser->root.cursor = cur2;
1218 if (
len > 0 && len < 22 && parser->
root.cursor <
limit )
1226 for (
i = 0;
i < n_keywords;
i++ )
1272 loader->num_glyphs = 0;
1273 loader->num_chars = 0;
1276 loader->encoding_table.init = 0;
1277 loader->charstrings.init = 0;
1278 loader->glyph_names.init = 0;
static const WCHAR version[]
FT_DivFix(FT_Long a, FT_Long b)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE6(varformat)
#define FT_TRACE2(varformat)
#define FT_REALLOC(ptr, cursz, newsz)
#define FT_NEW_ARRAY(ptr, count)
#define FT_SET_ERROR(expression)
#define FT_ALLOC(ptr, size)
#define FT_FRAME_ENTER(size)
#define FT_STREAM_SEEK(position)
#define FT_STREAM_SKIP(distance)
#define FT_STREAM_READ(buffer, count)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLuint GLuint GLsizei count
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
static const CLSID * objects[]
static char memory[1024 *256]
#define T1_FIELD_BOOL(_ident, _fname, _dict)
#define T1_FIELD_NUM(_ident, _fname, _dict)
#define T1_FIELD_FIXED(_ident, _fname, _dict)
#define T1_FIELD_KEY(_ident, _fname, _dict)
#define T1_FIELD_BBOX(_ident, _fname, _dict)
struct PSAux_ServiceRec_ * PSAux_Service
@ T1_FIELD_TYPE_INTEGER_ARRAY
@ T1_FIELD_TYPE_FIXED_ARRAY
#define T1_FIELD_STRING(_ident, _fname, _dict)
#define T1_FIELD_CALLBACK(_ident, _name, _dict)
@ T1_FIELD_LOCATION_FONT_EXTRA
@ T1_FIELD_LOCATION_CID_INFO
@ T1_FIELD_LOCATION_FONT_INFO
struct T1_FieldRec_ * T1_Field
const PS_Table_FuncsRec * ps_table_funcs
FT_Error(* init)(PS_Table table, FT_Int count, FT_Memory memory)
PS_TableRec encoding_table
@ T1_ENCODING_TYPE_ISOLATIN1
@ T1_ENCODING_TYPE_STANDARD
@ T1_ENCODING_TYPE_EXPERT
T1_FIELD_DICT_FONTDICT family_name
T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT underline_position
T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT italic_angle
FT_BEGIN_HEADER struct T1_EncodingRecRec_ * T1_Encoding
static void t42_parse_font_matrix(T42_Face face, T42_Loader loader)
t42_parse_dict(T42_Face face, T42_Loader loader, FT_Byte *base, FT_Long size)
static void t42_parse_encoding(T42_Face face, T42_Loader loader)
#define T1_ToBytes(p, b, m, n, d)
#define T1_ToFixedArray(p, m, f, t)
t42_parser_init(T42_Parser parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
#define T1_Add_Table(p, i, o, l)
#define T1_Release_Table(p)
#define T1_Skip_Spaces(p)
#define T1_Skip_PS_Token(p)
static void t42_parse_charstrings(T42_Face face, T42_Loader loader)
t42_loader_done(T42_Loader loader)
static void t42_parse_sfnts(T42_Face face, T42_Loader loader)
static int t42_is_space(FT_Byte c)
static const T1_FieldRec t42_keywords[]
t42_loader_init(T42_Loader loader, T42_Face face)
static FT_Error t42_load_keyword(T42_Face face, T42_Loader loader, T1_Field field)
#define T1_Load_Field(p, f, o, m, pf)
t42_parser_done(T42_Parser parser)
enum T42_Load_Status_ T42_Load_Status
#define T1_Load_Field_Table(p, f, o, m, pf)
FT_BEGIN_HEADER struct T42_ParserRec_ * T42_Parser
FT_BEGIN_HEADER struct T42_FaceRec_ * T42_Face