20#include FT_INTERNAL_POSTSCRIPT_AUX_H
21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_CALC_H
39#define FT_COMPONENT trace_psobjs
84 table->init = 0xDEADBEEFUL;
129 table->block = old_base;
141 table->capacity = new_size;
175 if ( idx < 0 || idx >=
table->max_elems )
177 FT_ERROR((
"ps_table_add: invalid index\n" ));
178 return FT_THROW( Invalid_Argument );
197 new_size += ( new_size >> 2 ) + 1;
205 if ( in_offset >= 0 )
206 object =
table->block + in_offset;
328#define IS_OCTAL_DIGIT( c ) ( '0' <= (c) && (c) <= '7' )
431 FT_ERROR((
"skip_string: missing closing delimiter `>'\n" ));
526 if ( *
cur ==
'[' || *
cur ==
']' )
564 FT_ERROR((
"ps_parser_skip_PS_token:"
565 " unexpected closing delimiter `>'\n" ));
588 if ( cur < limit && cur == parser->
cursor )
590 FT_ERROR((
"ps_parser_skip_PS_token:"
591 " current token is `%c' which is self-delimiting\n"
593 " but invalid at this point\n",
673 while ( cur < limit && !parser->
error )
679 else if ( *
cur ==
']' )
763 parser->cursor = old_cursor;
764 parser->limit = old_limit;
828 if ( old_cur ==
cur )
908 if ( old_cur ==
cur )
966 else if ( *
cur ==
')' )
1065 parser->cursor = old_cur;
1066 parser->limit = old_limit;
1076 count = max_objects;
1080 if ( max_objects == 0 )
1118 switch (
field->size )
1129 *(FT_UInt32*)
q = (FT_UInt32)
val;
1167 " expected a name or string\n"
1169 " but found token of type %d instead\n",
1179 FT_TRACE0((
"ps_parser_load_field: overwriting field %s\n",
1207 " expected four integers in bounding box\n" ));
1230 for (
i = 0;
i < 4;
i++ )
1233 temp +
i * max_objects, 0 );
1237 " expected %d integer%s in the %s subarray\n"
1239 " of /FontBBox in the /Blend dictionary\n",
1240 max_objects, max_objects > 1 ?
"s" :
"",
1242 : (
i == 1 ?
"second"
1243 : (
i == 2 ?
"third"
1254 for (
i = 0;
i < max_objects;
i++ )
1277 *pflags |= 1L <<
field->flag_bit;
1293#define T1_MAX_TABLE_ELEMENTS 32
1319 if ( num_elements < 0 )
1327 old_cursor =
parser->cursor;
1328 old_limit =
parser->limit;
1338 for ( ; num_elements > 0; num_elements--,
token++ )
1356 *pflags |= 1L <<
field->flag_bit;
1361 parser->cursor = old_cursor;
1362 parser->limit = old_limit;
1400 FT_ERROR((
"ps_parser_to_bytes: Missing starting delimiter `<'\n" ));
1415 if ( cur < parser->
limit && *
cur !=
'>' )
1417 FT_ERROR((
"ps_parser_to_bytes: Missing closing delimiter `>'\n" ));
1460 max_values,
values, power_ten );
1540 builder->load_points = 1;
1542 builder->face =
face;
1543 builder->glyph = glyph;
1544 builder->memory =
face->memory;
1551 builder->loader = loader;
1556 builder->hints_globals =
size->internal->module_data;
1557 builder->hints_funcs =
NULL;
1560 builder->hints_funcs = glyph->internal->glyph_hints;
1566 builder->left_bearing.x = 0;
1567 builder->left_bearing.y = 0;
1568 builder->advance.x = 0;
1569 builder->advance.y = 0;
1595 glyph->
outline = *builder->base;
1618 if ( builder->load_points )
1660 FT_ERROR((
"t1_builder_add_contour: no outline to add points to\n" ));
1661 return FT_THROW( Invalid_File_Format );
1664 if ( !builder->load_points )
1673 if (
outline->n_contours > 0 )
1742 if ( p1->
x == p2->
x && p1->
y == p2->
y )
1747 if (
outline->n_contours > 0 )
1799 builder->path_begun = 0;
1800 builder->load_points = 1;
1802 builder->face =
face;
1803 builder->glyph = glyph;
1804 builder->memory =
face->root.memory;
1811 builder->loader = loader;
1816 builder->hints_globals =
NULL;
1817 builder->hints_funcs =
NULL;
1819 if ( hinting &&
size )
1826 builder->hints_globals = (
void *)
internal->topfont;
1827 builder->hints_funcs = glyph->root.internal->glyph_hints;
1835 builder->left_bearing.x = 0;
1836 builder->left_bearing.y = 0;
1837 builder->advance.x = 0;
1838 builder->advance.y = 0;
1887 if ( builder->load_points )
1940 if ( !builder->load_points )
1949 if (
outline->n_contours > 0 )
1970 if ( !builder->path_begun )
1972 builder->path_begun = 1;
2007 if ( p1->
x == p2->
x && p1->
y == p2->
y )
2012 if (
outline->n_contours > 0 )
2071 ps_builder->loader = t1builder->
loader;
2072 ps_builder->
base = t1builder->
base;
2073 ps_builder->current = t1builder->
current;
2075 ps_builder->pos_x = &t1builder->
pos_x;
2076 ps_builder->pos_y = &t1builder->
pos_y;
2079 ps_builder->advance = &t1builder->
advance;
2081 ps_builder->bbox = &t1builder->
bbox;
2082 ps_builder->path_begun = 0;
2084 ps_builder->no_recurse = t1builder->
no_recurse;
2095 ps_builder->glyph = cffbuilder->
glyph;
2096 ps_builder->loader = cffbuilder->
loader;
2097 ps_builder->
base = cffbuilder->
base;
2098 ps_builder->current = cffbuilder->
current;
2100 ps_builder->pos_x = &cffbuilder->
pos_x;
2101 ps_builder->pos_y = &cffbuilder->
pos_y;
2104 ps_builder->advance = &cffbuilder->
advance;
2106 ps_builder->bbox = &cffbuilder->
bbox;
2107 ps_builder->path_begun = cffbuilder->
path_begun;
2108 ps_builder->load_points = cffbuilder->
load_points;
2109 ps_builder->no_recurse = cffbuilder->
no_recurse;
2114 ps_builder->is_t1 = is_t1;
2162 if ( builder->load_points )
2171 if ( !builder->is_t1 &&
2179#ifdef T1_CONFIG_OPTION_OLD_ENGINE
2180#ifndef CFF_CONFIG_OPTION_OLD_ENGINE
2183 if ( builder->is_t1 &&
2230 FT_ERROR((
"ps_builder_add_contour: no outline to add points to\n" ));
2231 return FT_THROW( Invalid_File_Format );
2234 if ( !builder->load_points )
2243 if (
outline->n_contours > 0 )
2264 if ( !builder->path_begun )
2266 builder->path_begun = 1;
2309 if ( p1->
x == p2->
x && p1->
y == p2->
y )
2314 if (
outline->n_contours > 0 )
2373 ps_decoder->psnames = t1_decoder->
psnames;
2375 ps_decoder->num_glyphs = t1_decoder->
num_glyphs;
2376 ps_decoder->glyph_names = t1_decoder->
glyph_names;
2377 ps_decoder->hint_mode = t1_decoder->
hint_mode;
2378 ps_decoder->blend = t1_decoder->
blend;
2381 ps_decoder->locals = t1_decoder->
subrs;
2382 ps_decoder->locals_len = t1_decoder->
subrs_len;
2383 ps_decoder->locals_hash = t1_decoder->
subrs_hash;
2385 ps_decoder->buildchar = t1_decoder->
buildchar;
2388 ps_decoder->lenIV = t1_decoder->
lenIV;
2399 ps_decoder->cff = cff_decoder->
cff;
2403 ps_decoder->num_globals = cff_decoder->
num_globals;
2404 ps_decoder->globals = cff_decoder->
globals;
2406 ps_decoder->num_locals = cff_decoder->
num_locals;
2407 ps_decoder->locals = cff_decoder->
locals;
2408 ps_decoder->locals_bias = cff_decoder->
locals_bias;
2410 ps_decoder->glyph_width = &cff_decoder->
glyph_width;
2411 ps_decoder->width_only = cff_decoder->
width_only;
2413 ps_decoder->hint_mode = cff_decoder->
hint_mode;
2467 cpriv->
lenIV = priv->lenIV;
2475 if (
face->internal->random_seed != -1 )
2479 subfont->
random = (FT_UInt32)
face->internal->random_seed;
2480 if (
face->internal->random_seed )
2485 (FT_UInt32)
face->internal->random_seed );
2487 }
while (
face->internal->random_seed < 0 );
2490 if ( !subfont->random )
2496 seed = (FT_UInt32)( (
FT_Offset)(
char*)&seed ^
2499 seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
2503 subfont->random = seed;
ios_base &_STLP_CALL internal(ios_base &__s)
static unsigned char bytes[4]
struct CFF_InternalRec_ * CFF_Internal
#define CFF_CONFIG_OPTION_OLD_ENGINE
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
struct FT_FaceRec_ * FT_Face
#define FT_ASSERT(condition)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_HINTING_FREETYPE
FT_GlyphLoader_Rewind(FT_GlyphLoader loader)
#define FT_GLYPHLOADER_CHECK_POINTS(_loader, _points, _contours)
#define FT_CURVE_TAG_CUBIC
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_NEW_ARRAY(ptr, count)
#define FT_ALLOC(ptr, size)
#define FT_MEM_COPY(dest, source, count)
#define FT_FACE_DRIVER(x)
#define FT_PAD_CEIL(x, n)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLenum GLuint GLint GLenum face
GLboolean GLenum GLenum GLvoid * values
GLuint GLsizei GLsizei * length
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 flag
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]
struct @1677::@1678 driver
#define IS_PS_NEWLINE(ch)
FT_BEGIN_HEADER struct PS_DriverRec_ * PS_Driver
struct T1_DecoderRec_ * T1_Decoder
struct T1_BuilderRec_ * T1_Builder
enum T1_FieldType_ T1_FieldType
@ T1_FIELD_TYPE_FIXED_1000
@ T1_FIELD_TYPE_FIXED_ARRAY
struct T1_FieldRec_ * T1_Field
FT_CALLBACK_TABLE_DEF const CFF_Builder_FuncsRec cff_builder_funcs
FT_CALLBACK_TABLE_DEF const PS_Builder_FuncsRec ps_builder_funcs
FT_CALLBACK_TABLE_DEF const T1_Builder_FuncsRec t1_builder_funcs
FT_CALLBACK_TABLE_DEF const PS_Table_FuncsRec ps_table_funcs
FT_CALLBACK_TABLE_DEF const PS_Parser_FuncsRec ps_parser_funcs
PS_Conv_ToInt(FT_Byte **cursor, FT_Byte *limit)
PS_Conv_ToFixed(FT_Byte **cursor, FT_Byte *limit, FT_Long power_ten)
PS_Conv_EexecDecode(FT_Byte **cursor, FT_Byte *limit, FT_Byte *buffer, FT_Offset n, FT_UShort *seed)
PS_Conv_ASCIIHexDecode(FT_Byte **cursor, FT_Byte *limit, FT_Byte *buffer, FT_Offset n)
cff_builder_add_point1(CFF_Builder *builder, FT_Pos x, FT_Pos y)
ps_parser_skip_PS_token(PS_Parser parser)
static FT_Error skip_string(FT_Byte **acur, FT_Byte *limit)
t1_builder_close_contour(T1_Builder builder)
cff_builder_add_point(CFF_Builder *builder, FT_Pos x, FT_Pos y, FT_Byte flag)
ps_parser_to_fixed(PS_Parser parser, FT_Int power_ten)
ps_parser_to_token_array(PS_Parser parser, T1_Token tokens, FT_UInt max_tokens, FT_Int *pnum_tokens)
ps_builder_close_contour(PS_Builder *builder)
ps_builder_add_contour(PS_Builder *builder)
ps_decoder_init(PS_Decoder *ps_decoder, void *decoder, FT_Bool is_t1)
ps_builder_init(PS_Builder *ps_builder, void *builder, FT_Bool is_t1)
#define IS_OCTAL_DIGIT(c)
ps_parser_init(PS_Parser parser, FT_Byte *base, FT_Byte *limit, FT_Memory memory)
t1_builder_start_point(T1_Builder builder, FT_Pos x, FT_Pos y)
static FT_Error skip_literal_string(FT_Byte **acur, FT_Byte *limit)
t1_builder_init(T1_Builder builder, FT_Face face, FT_Size size, FT_GlyphSlot glyph, FT_Bool hinting)
#define T1_MAX_TABLE_ELEMENTS
ps_table_done(PS_Table table)
t1_builder_add_point1(T1_Builder builder, FT_Pos x, FT_Pos y)
cff_check_points(CFF_Builder *builder, FT_Int count)
static FT_Error reallocate_t1_table(PS_Table table, FT_Offset new_size)
t1_builder_check_points(T1_Builder builder, FT_Int count)
ps_parser_to_coord_array(PS_Parser parser, FT_Int max_coords, FT_Short *coords)
ps_table_release(PS_Table table)
ps_parser_load_field_table(PS_Parser parser, const T1_Field field, void **objects, FT_UInt max_objects, FT_ULong *pflags)
ps_builder_add_point(PS_Builder *builder, FT_Pos x, FT_Pos y, FT_Byte flag)
static FT_Error skip_procedure(FT_Byte **acur, FT_Byte *limit)
ps_parser_to_int(PS_Parser parser)
ps_parser_to_token(PS_Parser parser, T1_Token token)
ps_parser_skip_spaces(PS_Parser parser)
static FT_Int ps_tofixedarray(FT_Byte **acur, FT_Byte *limit, FT_Int max_values, FT_Fixed *values, FT_Int power_ten)
t1_builder_done(T1_Builder builder)
cff_builder_start_point(CFF_Builder *builder, FT_Pos x, FT_Pos y)
ps_parser_to_bytes(PS_Parser parser, FT_Byte *bytes, FT_Offset max_bytes, FT_ULong *pnum_bytes, FT_Bool delimiters)
ps_table_new(PS_Table table, FT_Int count, FT_Memory memory)
t1_builder_add_point(T1_Builder builder, FT_Pos x, FT_Pos y, FT_Byte flag)
t1_decrypt(FT_Byte *buffer, FT_Offset length, FT_UShort seed)
t1_make_subfont(FT_Face face, PS_Private priv, CFF_SubFont subfont)
static FT_Int ps_tocoordarray(FT_Byte **acur, FT_Byte *limit, FT_Int max_coords, FT_Short *coords)
static void shift_elements(PS_Table table, FT_Byte *old_base)
t1_builder_add_contour(T1_Builder builder)
ps_parser_done(PS_Parser parser)
ps_builder_done(PS_Builder *builder)
ps_builder_add_point1(PS_Builder *builder, FT_Pos x, FT_Pos y)
ps_table_add(PS_Table table, FT_Int idx, void *object, FT_UInt length)
static int ps_tobool(FT_Byte **acur, FT_Byte *limit)
cff_builder_done(CFF_Builder *builder)
cff_builder_init(CFF_Builder *builder, TT_Face face, CFF_Size size, CFF_GlyphSlot glyph, FT_Bool hinting)
cff_builder_add_contour(CFF_Builder *builder)
ps_parser_to_fixed_array(PS_Parser parser, FT_Int max_values, FT_Fixed *values, FT_Int power_ten)
cff_builder_close_contour(CFF_Builder *builder)
ps_builder_start_point(PS_Builder *builder, FT_Pos x, FT_Pos y)
static void skip_spaces(FT_Byte **acur, FT_Byte *limit)
ps_parser_load_field(PS_Parser parser, const T1_Field field, void **objects, FT_UInt max_objects, FT_ULong *pflags)
static void skip_comment(FT_Byte **acur, FT_Byte *limit)
ps_builder_check_points(PS_Builder *builder, FT_Int count)
CFF_Decoder_Get_Glyph_Callback get_glyph_callback
CFF_Decoder_Free_Glyph_Callback free_glyph_callback
CFF_SubFont current_subfont
FT_Pos family_other_blues[10]
FT_Byte num_family_other_blues
FT_Fixed expansion_factor
FT_Size_Internal internal
FT_Service_PsCMaps psnames