20#include FT_INTERNAL_CALC_H
21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_POSTSCRIPT_HINTS_H
23#include FT_INTERNAL_HASH_H
32#define Fix2Int( f ) ( (FT_Int)(FT_Short)( (f) >> 16 ) )
41#define FT_COMPONENT trace_t1decode
136 FT_Service_PsCMaps psnames =
decoder->psnames;
140 if ( charcode < 0 || charcode > 255 )
143 glyph_name = psnames->adobe_std_strings(
144 psnames->adobe_std_encoding[charcode]);
152 name[0] == glyph_name[0] &&
161#ifdef T1_CONFIG_OPTION_OLD_ENGINE
186 FT_Service_PsCMaps psnames =
decoder->psnames;
190 if ( charcode < 0 || charcode > 255 )
193 glyph_name = psnames->adobe_std_strings(
194 psnames->adobe_std_encoding[charcode]);
202 name[0] == glyph_name[0] &&
253 FT_Int bchar_index, achar_index;
260#ifdef FT_CONFIG_OPTION_INCREMENTAL
267 FT_ERROR((
"t1operator_seac: invalid nested seac\n" ));
271 if (
decoder->builder.metrics_only )
273 FT_ERROR((
"t1operator_seac: unexpected seac\n" ));
278 adx +=
decoder->builder.left_bearing.x;
282#ifdef FT_CONFIG_OPTION_INCREMENTAL
283 if (
decoder->glyph_names == 0 &&
284 !
face->root.internal->incremental_interface )
286 if (
decoder->glyph_names == 0 )
290 " glyph names table not available in this font\n" ));
294#ifdef FT_CONFIG_OPTION_INCREMENTAL
295 if (
face->root.internal->incremental_interface )
304 bchar_index = t1_lookup_glyph_by_stdcharcode(
decoder, bchar );
305 achar_index = t1_lookup_glyph_by_stdcharcode(
decoder, achar );
308 if ( bchar_index < 0 || achar_index < 0 )
311 " invalid seac character code arguments\n" ));
317 if (
decoder->builder.no_recurse )
329 subg = loader->current.subglyphs;
332 subg->index = bchar_index;
340 subg->index = achar_index;
347 glyph->
subglyphs = loader->base.subglyphs;
348 glyph->
format = FT_GLYPH_FORMAT_COMPOSITE;
350 loader->current.num_subglyphs = 2;
369 left_bearing =
decoder->builder.left_bearing;
372 decoder->builder.left_bearing.x = 0;
373 decoder->builder.left_bearing.y = 0;
375 decoder->builder.pos_x = adx - asb;
391 decoder->builder.left_bearing = left_bearing;
431 FT_Int known_othersubr_result_cnt = 0;
432 FT_Int unknown_othersubr_result_cnt = 0;
438#ifdef FT_DEBUG_LEVEL_TRACE
448 seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
470 "Start charstring\n" ));
472 zone->base = charstring_base;
473 limit =
zone->limit = charstring_base + charstring_len;
478 x = orig_x = builder->
pos_x;
479 y = orig_y = builder->
pos_y;
495 FT_ASSERT( known_othersubr_result_cnt == 0 ||
496 unknown_othersubr_result_cnt == 0 );
498#ifdef FT_DEBUG_LEVEL_TRACE
575 FT_ERROR((
"t1_decoder_parse_charstrings:"
576 " invalid escape (12+EOF)\n" ));
611 FT_ERROR((
"t1_decoder_parse_charstrings:"
612 " invalid escape (12+%d)\n",
621 FT_ERROR((
"t1_decoder_parse_charstrings:"
622 " unexpected EOF in integer\n" ));
626 value = (FT_Int32)( ( (FT_UInt32)
ip[0] << 24 ) |
627 ( (FT_UInt32)
ip[1] << 16 ) |
628 ( (FT_UInt32)
ip[2] << 8 ) |
643 FT_ERROR((
"t1_decoder_parse_charstrings:"
644 " no `div' after large integer\n" ));
661 value = (FT_Int32)
ip[-1] - 139;
666 FT_ERROR((
"t1_decoder_parse_charstrings:"
667 " unexpected EOF in integer\n" ));
672 value = ( (
ip[-2] - 247 ) * 256 ) +
ip[-1] + 108;
674 value = -( ( (
ip[-2] - 251 ) * 256 ) +
ip[-1] + 108 );
682 FT_ERROR((
"t1_decoder_parse_charstrings:"
683 " invalid byte (%d)\n",
ip[-1] ));
688 if ( unknown_othersubr_result_cnt > 0 )
700 unknown_othersubr_result_cnt = 0;
707 FT_ERROR((
"t1_decoder_parse_charstrings:"
708 " no `div' after large integer\n" ));
722 FT_ERROR((
"t1_decoder_parse_charstrings: stack overflow\n" ));
726#ifdef FT_DEBUG_LEVEL_TRACE
742#ifdef FT_DEBUG_LEVEL_TRACE
748 goto Stack_Underflow;
767 goto Stack_Underflow;
771 known_othersubr_result_cnt = 0;
772 unknown_othersubr_result_cnt = 0;
794 goto Unexpected_OtherSubr;
797 decoder->num_flex_vectors != 7 )
799 FT_ERROR((
"t1_decoder_parse_charstrings:"
800 " unexpected flex end\n" ));
807 known_othersubr_result_cnt = 2;
812 goto Unexpected_OtherSubr;
828 goto Unexpected_OtherSubr;
832 FT_ERROR((
"t1_decoder_parse_charstrings:"
833 " missing flex start\n" ));
860 goto Unexpected_OtherSubr;
862 known_othersubr_result_cnt = 1;
889 FT_ERROR((
"t1_decoder_parse_charstrings:"
890 " unexpected multiple masters operator\n" ));
894 num_points = (
FT_UInt)subr_no - 13 + ( subr_no == 18 );
897 FT_ERROR((
"t1_decoder_parse_charstrings:"
898 " incorrect number of multiple masters arguments\n" ));
918 delta =
top + num_points;
920 for ( nn = 0; nn < num_points; nn++ )
933 known_othersubr_result_cnt = (
FT_Int)num_points;
947 goto Unexpected_OtherSubr;
953 goto Unexpected_OtherSubr;
966 goto Unexpected_OtherSubr;
970 known_othersubr_result_cnt = 1;
977 goto Unexpected_OtherSubr;
981 known_othersubr_result_cnt = 1;
988 goto Unexpected_OtherSubr;
992 known_othersubr_result_cnt = 1;
999 goto Unexpected_OtherSubr;
1003 known_othersubr_result_cnt = 1;
1015 goto Unexpected_OtherSubr;
1020 goto Unexpected_OtherSubr;
1036 goto Unexpected_OtherSubr;
1041 goto Unexpected_OtherSubr;
1046 known_othersubr_result_cnt = 1;
1063 goto Unexpected_OtherSubr;
1068 known_othersubr_result_cnt = 1;
1075 goto Unexpected_OtherSubr;
1082 if ( Rand >= 0x8000L )
1087 seed =
FT_MulFix( seed, 0x10000L - seed );
1092 known_othersubr_result_cnt = 1;
1096 if (
arg_cnt >= 0 && subr_no >= 0 )
1098 FT_ERROR((
"t1_decoder_parse_charstrings:"
1099 " unknown othersubr [%d %d], wish me luck\n",
1101 unknown_othersubr_result_cnt =
arg_cnt;
1106 Unexpected_OtherSubr:
1107 FT_ERROR((
"t1_decoder_parse_charstrings:"
1108 " invalid othersubr [%d %d]\n",
arg_cnt, subr_no ));
1112 top += known_othersubr_result_cnt;
1124 goto Stack_Underflow;
1132#ifdef FT_DEBUG_LEVEL_TRACE
1145 FT_TRACE0((
"t1_decoder_parse_charstrings:"
1146 " too much operands on the stack"
1147 " (seen %d, expected %d)\n",
1184#ifdef FT_DEBUG_LEVEL_TRACE
1186 if (
decoder->len_buildchar > 0 )
1193 for (
i = 0;
i <
decoder->len_buildchar;
i++ )
1218 orig_y =
y = builder->
pos_y;
1231 return t1operator_seac(
decoder,
1434 if ( idx < 0 || idx >=
decoder->num_subrs )
1436 FT_ERROR((
"t1_decoder_parse_charstrings:"
1437 " invalid subrs index\n" ));
1443 FT_ERROR((
"t1_decoder_parse_charstrings:"
1444 " too many nested subrs\n" ));
1471 FT_ERROR((
"t1_decoder_parse_charstrings:"
1472 " invoking empty subrs\n" ));
1485 if ( known_othersubr_result_cnt > 0 )
1487 known_othersubr_result_cnt--;
1492 if ( unknown_othersubr_result_cnt == 0 )
1494 FT_ERROR((
"t1_decoder_parse_charstrings:"
1495 " no more operands for othersubr\n" ));
1499 unknown_othersubr_result_cnt--;
1506 if ( zone <= decoder->zones )
1508 FT_ERROR((
"t1_decoder_parse_charstrings:"
1509 " unexpected return\n" ));
1587 if (
decoder->flex_state != 1 )
1589 FT_ERROR((
"t1_decoder_parse_charstrings:"
1590 " unexpected `setcurrentpoint'\n" ));
1608 FT_ERROR((
"t1_decoder_parse_charstrings:"
1609 " unhandled opcode %d\n",
op ));
1620#ifdef FT_DEBUG_LEVEL_TRACE
1638 return FT_THROW( Stack_Underflow );
1671#ifdef FT_DEBUG_LEVEL_TRACE
1684 "Start charstring: get width\n" ));
1686 zone->base = charstring_base;
1687 limit =
zone->limit = charstring_base + charstring_len;
1698#ifdef FT_DEBUG_LEVEL_TRACE
1740 FT_ERROR((
"t1_decoder_parse_metrics:"
1741 " invalid escape (12+EOF)\n" ));
1759 FT_ERROR((
"t1_decoder_parse_metrics:"
1760 " unexpected EOF in integer\n" ));
1764 value = (FT_Int32)( ( (FT_UInt32)
ip[0] << 24 ) |
1765 ( (FT_UInt32)
ip[1] << 16 ) |
1766 ( (FT_UInt32)
ip[2] << 8 ) |
1779 FT_ERROR((
"t1_decoder_parse_metrics:"
1780 " large integer found for width\n" ));
1785 value = (FT_Int32)( (FT_UInt32)
value << 16 );
1794 value = (FT_Int32)
ip[-1] - 139;
1799 FT_ERROR((
"t1_decoder_parse_metrics:"
1800 " unexpected EOF in integer\n" ));
1805 value = ( (
ip[-2] - 247 ) * 256 ) +
ip[-1] + 108;
1807 value = -( ( (
ip[-2] - 251 ) * 256 ) +
ip[-1] + 108 );
1810 value = (FT_Int32)( (FT_UInt32)
value << 16 );
1814 FT_ERROR((
"t1_decoder_parse_metrics:"
1815 " invalid byte (%d)\n",
ip[-1] ));
1829 FT_ERROR((
"t1_decoder_parse_metrics: stack overflow\n" ));
1833#ifdef FT_DEBUG_LEVEL_TRACE
1848 goto Stack_Underflow;
1850#ifdef FT_DEBUG_LEVEL_TRACE
1854 " too much operands on the stack"
1855 " (seen %d, expected %d)\n",
1899 FT_ERROR((
"t1_decoder_parse_metrics:"
1900 " unhandled opcode %d\n",
op ));
1911 FT_ERROR((
"t1_decoder_parse_metrics:"
1912 " no width, found op %d instead\n",
1918 return FT_THROW( Stack_Underflow );
1939 FT_Service_PsCMaps psnames;
1946 " the `psnames' module is not available\n" ));
1947 return FT_THROW( Unimplemented_Feature );
1960 decoder->glyph_names = glyph_names;
1961 decoder->hint_mode = hint_mode;
1963 decoder->parse_callback = parse_callback;
1980 if (
decoder->cf2_instance.finalizer )
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
#define T1_MAX_CHARSTRINGS_OPERANDS
#define T1_MAX_SUBRS_CALLS
enum FT_Render_Mode_ FT_Render_Mode
FT_DivFix(FT_Long a, FT_Long b)
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS
struct FT_GlyphSlotRec_ * FT_GlyphSlot
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES
FT_MulFix(FT_Long a, FT_Long b)
#define FT_ASSERT(condition)
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE5(varformat)
#define FT_TRACE4(varformat)
cannot open resource broken file module version is too low unimplemented feature broken offset within table missing module invalid glyph index unsupported glyph image format invalid outline too many hints invalid object handle invalid module handle invalid size handle invalid charmap handle invalid stream handle too many extensions unlisted object invalid stream seek invalid stream read invalid frame operation invalid frame read raster corrupted negative height while rastering invalid opcode stack overflow bad argument invalid reference found ENDF opcode in execution stream invalid code range too many function definitions SFNT font table missing name table missing horizontal PostScript(post) table missing" ) FT_ERRORDEF_( Invalid_Horiz_Metrics
FT_GlyphLoader_Add(FT_GlyphLoader loader)
FT_GlyphLoader_Prepare(FT_GlyphLoader loader)
FT_GlyphLoader_CheckSubGlyphs(FT_GlyphLoader loader, FT_UInt n_subs)
size_t * ft_hash_num_lookup(FT_Int num, FT_Hash hash)
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_SET_ERROR(expression)
#define FT_ARRAY_ZERO(dest, count)
#define FT_FACE_FIND_GLOBAL_SERVICE(face, ptr, id)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble GLdouble top
GLenum GLuint GLint GLenum face
GLboolean GLenum GLenum GLvoid * values
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
const struct T1_Hints_FuncsRec_ * T1_Hints_Funcs
typedefFT_BEGIN_HEADER struct PSH_GlobalsRec_ * PSH_Globals
int jpeg_marker_parser_method routine
static char memory[1024 *256]
FT_Error(* T1_Decoder_Callback)(T1_Decoder decoder, FT_UInt glyph_index)
FT_CALLBACK_TABLE_DEF const T1_Decoder_FuncsRec t1_decoder_funcs
t1_builder_close_contour(T1_Builder builder)
t1_builder_start_point(T1_Builder builder, FT_Pos x, FT_Pos y)
t1_builder_init(T1_Builder builder, FT_Face face, FT_Size size, FT_GlyphSlot glyph, FT_Bool hinting)
t1_builder_add_point1(T1_Builder builder, FT_Pos x, FT_Pos y)
t1_builder_check_points(T1_Builder builder, FT_Int count)
t1_builder_done(T1_Builder builder)
t1_builder_add_point(T1_Builder builder, FT_Pos x, FT_Pos y, FT_Byte flag)
FT_Slot_Internal internal
T1_ParseState parse_state
T1_Hints_SetStemFunc stem
T1_Hints_SetStem3Func stem3
static const FT_Int t1_args_count[op_max]
t1_decoder_parse_metrics(T1_Decoder decoder, FT_Byte *charstring_base, FT_UInt charstring_len)
enum T1_Operator_ T1_Operator
t1_decoder_done(T1_Decoder decoder)
t1_decoder_init(T1_Decoder decoder, FT_Face face, FT_Size size, FT_GlyphSlot slot, FT_Byte **glyph_names, PS_Blend blend, FT_Bool hinting, FT_Render_Mode hint_mode, T1_Decoder_Callback parse_callback)
t1_lookup_glyph_by_stdcharcode_ps(PS_Decoder *decoder, FT_Int charcode)
struct T1_FaceRec_ * T1_Face
static unsigned arg_cnt(const DISPPARAMS *dp)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList