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 t1decode
138 FT_Service_PsCMaps psnames =
decoder->psnames;
142 if ( charcode < 0 || charcode > 255 )
145 glyph_name = psnames->adobe_std_strings(
146 psnames->adobe_std_encoding[charcode]);
154 name[0] == glyph_name[0] &&
163#ifdef T1_CONFIG_OPTION_OLD_ENGINE
191 FT_Service_PsCMaps psnames =
decoder->psnames;
195 if ( charcode < 0 || charcode > 255 )
198 glyph_name = psnames->adobe_std_strings(
199 psnames->adobe_std_encoding[charcode]);
207 name[0] == glyph_name[0] &&
264 FT_Int bchar_index, achar_index;
271#ifdef FT_CONFIG_OPTION_INCREMENTAL
278 FT_ERROR((
"t1operator_seac: invalid nested seac\n" ));
282 if (
decoder->builder.metrics_only )
284 FT_ERROR((
"t1operator_seac: unexpected seac\n" ));
289 adx +=
decoder->builder.left_bearing.x;
293#ifdef FT_CONFIG_OPTION_INCREMENTAL
294 if (
decoder->glyph_names == 0 &&
295 !
face->root.internal->incremental_interface )
297 if (
decoder->glyph_names == 0 )
301 " glyph names table not available in this font\n" ));
305#ifdef FT_CONFIG_OPTION_INCREMENTAL
306 if (
face->root.internal->incremental_interface )
315 bchar_index = t1_lookup_glyph_by_stdcharcode(
decoder, bchar );
316 achar_index = t1_lookup_glyph_by_stdcharcode(
decoder, achar );
319 if ( bchar_index < 0 || achar_index < 0 )
322 " invalid seac character code arguments\n" ));
328 if (
decoder->builder.no_recurse )
340 subg = loader->current.subglyphs;
343 subg->index = bchar_index;
351 subg->index = achar_index;
358 glyph->
subglyphs = loader->base.subglyphs;
359 glyph->
format = FT_GLYPH_FORMAT_COMPOSITE;
361 loader->current.num_subglyphs = 2;
380 left_bearing =
decoder->builder.left_bearing;
383 decoder->builder.left_bearing.x = 0;
384 decoder->builder.left_bearing.y = 0;
386 decoder->builder.pos_x = adx - asb;
402 decoder->builder.left_bearing = left_bearing;
445 FT_Int known_othersubr_result_cnt = 0;
446 FT_Int unknown_othersubr_result_cnt = 0;
452#ifdef FT_DEBUG_LEVEL_TRACE
462 seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;
483 zone->base = charstring_base;
484 limit =
zone->limit = charstring_base + charstring_len;
489 x = orig_x = builder->
pos_x;
490 y = orig_y = builder->
pos_y;
506 FT_ASSERT( known_othersubr_result_cnt == 0 ||
507 unknown_othersubr_result_cnt == 0 );
509#ifdef FT_DEBUG_LEVEL_TRACE
586 FT_ERROR((
"t1_decoder_parse_charstrings:"
587 " invalid escape (12+EOF)\n" ));
622 FT_ERROR((
"t1_decoder_parse_charstrings:"
623 " invalid escape (12+%d)\n",
632 FT_ERROR((
"t1_decoder_parse_charstrings:"
633 " unexpected EOF in integer\n" ));
637 value = (FT_Int32)( ( (FT_UInt32)
ip[0] << 24 ) |
638 ( (FT_UInt32)
ip[1] << 16 ) |
639 ( (FT_UInt32)
ip[2] << 8 ) |
654 FT_ERROR((
"t1_decoder_parse_charstrings:"
655 " no `div' after large integer\n" ));
672 value = (FT_Int32)
ip[-1] - 139;
677 FT_ERROR((
"t1_decoder_parse_charstrings:"
678 " unexpected EOF in integer\n" ));
683 value = ( (
ip[-2] - 247 ) * 256 ) +
ip[-1] + 108;
685 value = -( ( (
ip[-2] - 251 ) * 256 ) +
ip[-1] + 108 );
693 FT_ERROR((
"t1_decoder_parse_charstrings:"
694 " invalid byte (%d)\n",
ip[-1] ));
699 if ( unknown_othersubr_result_cnt > 0 )
711 unknown_othersubr_result_cnt = 0;
718 FT_ERROR((
"t1_decoder_parse_charstrings:"
719 " no `div' after large integer\n" ));
733 FT_ERROR((
"t1_decoder_parse_charstrings: stack overflow\n" ));
737#ifdef FT_DEBUG_LEVEL_TRACE
753#ifdef FT_DEBUG_LEVEL_TRACE
759 goto Stack_Underflow;
779 goto Stack_Underflow;
783 known_othersubr_result_cnt = 0;
784 unknown_othersubr_result_cnt = 0;
806 goto Unexpected_OtherSubr;
809 decoder->num_flex_vectors != 7 )
811 FT_ERROR((
"t1_decoder_parse_charstrings:"
812 " unexpected flex end\n" ));
819 known_othersubr_result_cnt = 2;
824 goto Unexpected_OtherSubr;
840 goto Unexpected_OtherSubr;
844 FT_ERROR((
"t1_decoder_parse_charstrings:"
845 " missing flex start\n" ));
872 goto Unexpected_OtherSubr;
874 known_othersubr_result_cnt = 1;
901 FT_ERROR((
"t1_decoder_parse_charstrings:"
902 " unexpected multiple masters operator\n" ));
906 num_points = (
FT_UInt)subr_no - 13 + ( subr_no == 18 );
909 FT_ERROR((
"t1_decoder_parse_charstrings:"
910 " incorrect number of multiple masters arguments\n" ));
930 delta =
top + num_points;
932 for ( nn = 0; nn < num_points; nn++ )
945 known_othersubr_result_cnt = (
FT_Int)num_points;
959 goto Unexpected_OtherSubr;
965 goto Unexpected_OtherSubr;
978 goto Unexpected_OtherSubr;
982 known_othersubr_result_cnt = 1;
989 goto Unexpected_OtherSubr;
993 known_othersubr_result_cnt = 1;
1000 goto Unexpected_OtherSubr;
1004 known_othersubr_result_cnt = 1;
1011 goto Unexpected_OtherSubr;
1015 known_othersubr_result_cnt = 1;
1027 goto Unexpected_OtherSubr;
1032 goto Unexpected_OtherSubr;
1048 goto Unexpected_OtherSubr;
1053 goto Unexpected_OtherSubr;
1058 known_othersubr_result_cnt = 1;
1075 goto Unexpected_OtherSubr;
1080 known_othersubr_result_cnt = 1;
1087 goto Unexpected_OtherSubr;
1094 if ( Rand >= 0x8000L )
1099 seed =
FT_MulFix( seed, 0x10000L - seed );
1104 known_othersubr_result_cnt = 1;
1108 if (
arg_cnt >= 0 && subr_no >= 0 )
1110 FT_ERROR((
"t1_decoder_parse_charstrings:"
1111 " unknown othersubr [%d %d], wish me luck\n",
1113 unknown_othersubr_result_cnt =
arg_cnt;
1118 Unexpected_OtherSubr:
1119 FT_ERROR((
"t1_decoder_parse_charstrings:"
1120 " invalid othersubr [%d %d]\n",
arg_cnt, subr_no ));
1124 top += known_othersubr_result_cnt;
1136 goto Stack_Underflow;
1144#ifdef FT_DEBUG_LEVEL_TRACE
1157 FT_TRACE0((
"t1_decoder_parse_charstrings:"
1158 " too much operands on the stack"
1159 " (seen %d, expected %d)\n",
1196#ifdef FT_DEBUG_LEVEL_TRACE
1198 if (
decoder->len_buildchar > 0 )
1205 for (
i = 0;
i <
decoder->len_buildchar;
i++ )
1230 orig_y =
y = builder->
pos_y;
1246 return t1operator_seac(
decoder,
1452 if ( idx < 0 || idx >=
decoder->num_subrs )
1454 FT_ERROR((
"t1_decoder_parse_charstrings:"
1455 " invalid subrs index\n" ));
1461 FT_ERROR((
"t1_decoder_parse_charstrings:"
1462 " too many nested subrs\n" ));
1489 FT_ERROR((
"t1_decoder_parse_charstrings:"
1490 " invoking empty subrs\n" ));
1503 if ( known_othersubr_result_cnt > 0 )
1505 known_othersubr_result_cnt--;
1510 if ( unknown_othersubr_result_cnt == 0 )
1512 FT_ERROR((
"t1_decoder_parse_charstrings:"
1513 " no more operands for othersubr\n" ));
1517 unknown_othersubr_result_cnt--;
1524 if ( zone <= decoder->zones )
1526 FT_ERROR((
"t1_decoder_parse_charstrings:"
1527 " unexpected return\n" ));
1605 if (
decoder->flex_state != 1 )
1607 FT_ERROR((
"t1_decoder_parse_charstrings:"
1608 " unexpected `setcurrentpoint'\n" ));
1626 FT_ERROR((
"t1_decoder_parse_charstrings:"
1627 " unhandled opcode %d\n",
op ));
1638#ifdef FT_DEBUG_LEVEL_TRACE
1656 return FT_THROW( Stack_Underflow );
1694#ifdef FT_DEBUG_LEVEL_TRACE
1706 zone->base = charstring_base;
1707 limit =
zone->limit = charstring_base + charstring_len;
1718#ifdef FT_DEBUG_LEVEL_TRACE
1760 FT_ERROR((
"t1_decoder_parse_metrics:"
1761 " invalid escape (12+EOF)\n" ));
1779 FT_ERROR((
"t1_decoder_parse_metrics:"
1780 " unexpected EOF in integer\n" ));
1784 value = (FT_Int32)( ( (FT_UInt32)
ip[0] << 24 ) |
1785 ( (FT_UInt32)
ip[1] << 16 ) |
1786 ( (FT_UInt32)
ip[2] << 8 ) |
1799 FT_ERROR((
"t1_decoder_parse_metrics:"
1800 " large integer found for width\n" ));
1805 value = (FT_Int32)( (FT_UInt32)
value << 16 );
1814 value = (FT_Int32)
ip[-1] - 139;
1819 FT_ERROR((
"t1_decoder_parse_metrics:"
1820 " unexpected EOF in integer\n" ));
1825 value = ( (
ip[-2] - 247 ) * 256 ) +
ip[-1] + 108;
1827 value = -( ( (
ip[-2] - 251 ) * 256 ) +
ip[-1] + 108 );
1830 value = (FT_Int32)( (FT_UInt32)
value << 16 );
1834 FT_ERROR((
"t1_decoder_parse_metrics:"
1835 " invalid byte (%d)\n",
ip[-1] ));
1849 FT_ERROR((
"t1_decoder_parse_metrics: stack overflow\n" ));
1853#ifdef FT_DEBUG_LEVEL_TRACE
1868 goto Stack_Underflow;
1870#ifdef FT_DEBUG_LEVEL_TRACE
1874 " too much operands on the stack"
1875 " (seen %d, expected %d)\n",
1921 FT_ERROR((
"t1_decoder_parse_metrics:"
1922 " unhandled opcode %d\n",
op ));
1933 FT_ERROR((
"t1_decoder_parse_metrics:"
1934 " no width, found op %d instead\n",
1940 return FT_THROW( Stack_Underflow );
1962 FT_Service_PsCMaps psnames;
1969 " the `psnames' module is not available\n" ));
1970 return FT_THROW( Unimplemented_Feature );
1983 decoder->glyph_names = glyph_names;
1984 decoder->hint_mode = hint_mode;
1986 decoder->parse_callback = parse_callback;
2003 if (
decoder->cf2_instance.finalizer )
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
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 T1_MAX_CHARSTRINGS_OPERANDS
#define T1_MAX_SUBRS_CALLS
#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