21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
23#include FT_INTERNAL_POSTSCRIPT_AUX_H
33#define FT_COMPONENT 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;
289 FT_ERROR((
"t42_parse_font_matrix: invalid font matrix\n" ));
315 FT_ERROR((
"t42_parse_encoding: out of bounds\n" ));
346 FT_ERROR((
"t42_parse_encoding: invalid encoding array size\n" ));
356 if ( encode->char_index )
377 char* notdef = (
char *)
".notdef";
413 if (
cur[1] ==
'e' &&
435 if ( only_immediates )
476 else if ( only_immediates )
509 ft_strncmp( (
const char*)
cur,
"StandardEncoding", 16 ) == 0 )
517 ft_strncmp( (
const char*)
cur,
"ISOLatin1Encoding", 17 ) == 0 )
547 FT_ULong n, string_size, old_string_size, real_size;
572 FT_ERROR((
"t42_parse_sfnts: can't find begin of sfnts vector\n" ));
596 else if ( *
cur ==
'<' )
598 if ( string_buf && !allocated )
601 "can't handle mixed binary and hex strings\n" ));
614 FT_ERROR((
"t42_parse_sfnts: invalid data in sfnts array\n" ));
618 if (
FT_REALLOC( string_buf, old_string_size, string_size ) )
625 old_string_size = string_size;
626 string_size = real_size;
637 "can't handle mixed binary and hex strings\n" ));
645 FT_ERROR((
"t42_parse_sfnts: invalid string size\n" ));
656 string_buf =
parser->root.cursor + 1;
660 FT_ERROR((
"t42_parse_sfnts: too much binary data\n" ));
665 parser->root.cursor += string_size + 1;
670 FT_ERROR((
"t42_parse_sfnts: invalid data in sfnts array\n" ));
677 if ( ( string_size & 1 ) && string_buf[string_size - 1] == 0 )
682 FT_ERROR((
"t42_parse_sfnts: invalid string\n" ));
692 for (
n = 0;
n < string_size;
n++ )
705 num_tables = 16 *
face->ttf_data[4] +
face->ttf_data[5];
707 face->ttf_size = 12 + 16 * num_tables;
711 FT_ERROR((
"t42_parse_sfnts: invalid data in sfnts array\n" ));
723 if ( count < face->ttf_size )
734 for (
i = 0;
i < num_tables;
i++ )
744 " invalid data in sfnts array\n" ));
756 face->ttf_size + 1 ) )
765 FT_ERROR((
"t42_parse_sfnts: too much binary data\n" ));
812 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
824 FT_ERROR((
"t42_parse_encoding: invalid number of glyphs\n" ));
832 FT_TRACE0((
"t42_parse_charstrings: adjusting number of glyphs"
833 " (from %d to %d)\n",
840 else if ( *
parser->root.cursor ==
'<' )
855 if ( *
parser->root.cursor ==
'/' )
857 else if ( *
parser->root.cursor ==
'>' )
871 FT_ERROR((
"t42_parse_charstrings: invalid token\n" ));
878 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
886 if ( swap_table->
init )
889 " only one CharStrings array allowed\n" ));
944 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
951 if ( *
cur ==
'/' || *
cur ==
'(' )
957 if (
cur + ( have_literal ? 3 : 2 ) >=
limit )
959 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
979 (
const char*)(name_table->
elements[
n]) ) == 0 )
995 FT_ERROR((
"t42_parse_charstrings: out of bounds\n" ));
1016 if ( !notdef_found )
1018 FT_ERROR((
"t42_parse_charstrings: no /.notdef glyph\n" ));
1025 (
const char*)name_table->
elements[0] ) )
1049 name_table->
elements[notdef_index],
1050 name_table->
lengths [notdef_index] );
1056 code_table->
elements[notdef_index],
1057 code_table->
lengths [notdef_index] );
1116 switch (
field->location )
1119 dummy_object = &
face->type1.font_info;
1123 dummy_object = &
face->type1.font_extra;
1127 dummy_object = &
face->type1.font_bbox;
1131 dummy_object = &
face->type1;
1213 cur2 =
parser->root.cursor;
1215 parser->root.cursor = cur2;
1233 if (
len > 0 && len < 22 && parser->
root.cursor <
limit )
1241 for (
i = 0;
i < n_keywords;
i++ )
1287 loader->num_glyphs = 0;
1288 loader->num_chars = 0;
1291 loader->encoding_table.init = 0;
1292 loader->charstrings.init = 0;
1293 loader->glyph_names.init = 0;
static const WCHAR version[]
FT_DivFix(FT_Long a, FT_Long b)
FT_Matrix_Check(const FT_Matrix *matrix)
#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