20#include FT_INTERNAL_DEBUG_H
21#include FT_INTERNAL_OBJECTS_H
22#include FT_INTERNAL_STREAM_H
23#include FT_TRUETYPE_TAGS_H
27#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
41#define FT_COMPONENT trace_ttpload
78 face->glyf_offset = 0;
84#ifdef FT_CONFIG_OPTION_INCREMENTAL
85 if (
face->root.internal->incremental_interface )
86 face->glyf_offset = 0;
100 if (
face->header.Index_To_Loc_Format != 0 )
104 if ( table_len >= 0x40000L )
107 table_len = 0x3FFFFL;
109 face->num_locations = table_len >>
shift;
115 if ( table_len >= 0x20000L )
118 table_len = 0x1FFFFL;
120 face->num_locations = table_len >>
shift;
125 FT_TRACE2((
"glyph count mismatch! loca: %d, maxp: %d\n",
126 face->num_locations - 1,
face->root.num_glyphs ));
148 if ( diff > 0 && diff < dist )
161 if ( new_loca_len <= (
FT_ULong)dist )
164 table_len = new_loca_len;
166 FT_TRACE2((
"adjusting num_locations to %d\n",
167 face->num_locations ));
171 face->root.num_glyphs =
face->num_locations
174 FT_TRACE2((
"adjusting num_glyphs to %d\n",
175 face->root.num_glyphs ));
206 if ( gindex < face->num_locations )
208 if (
face->header.Index_To_Loc_Format != 0 )
210 p =
face->glyph_locations + gindex * 4;
211 p_limit =
face->glyph_locations +
face->num_locations * 4;
216 if (
p + 4 <= p_limit )
221 p =
face->glyph_locations + gindex * 2;
222 p_limit =
face->glyph_locations +
face->num_locations * 2;
227 if (
p + 2 <= p_limit )
236 if ( pos1 >
face->glyf_len )
239 " too large offset (0x%08lx) found for glyph index %ld,\n"
241 " exceeding the end of `glyf' table (0x%08lx)\n",
242 pos1, gindex,
face->glyf_len ));
247 if ( pos2 >
face->glyf_len )
250 if ( gindex ==
face->num_locations - 2 )
253 " too large size (%ld bytes) found for glyph index %ld,\n"
255 " truncating at the end of `glyf' table to %ld bytes\n",
256 pos2 - pos1, gindex,
face->glyf_len - pos1 ));
257 pos2 =
face->glyf_len;
262 " too large offset (0x%08lx) found for glyph index %ld,\n"
264 " exceeding the end of `glyf' table (0x%08lx)\n",
265 pos2, gindex + 1,
face->glyf_len ));
280 *asize = (
FT_UInt)( pos2 - pos1 );
295 face->num_locations = 0;
321#ifdef TT_USE_BYTECODE_INTERPRETER
342 face->cvt_size = table_len / 2;
362#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
402#ifdef TT_USE_BYTECODE_INTERPRETER
415 face->font_program_size = 0;
422 face->font_program_size = table_len;
426 FT_TRACE2((
"loaded, %12d bytes\n",
face->font_program_size ));
464#ifdef TT_USE_BYTECODE_INTERPRETER
476 face->cvt_program_size = 0;
483 face->cvt_program_size = table_len;
487 FT_TRACE2((
"loaded, %12d bytes\n",
face->cvt_program_size ));
541 p =
face->hdmx_table;
562 if ( record_size >= 0xFFFF0000UL )
563 record_size &= 0xFFFFU;
566 if ( num_records > 255 ||
568 ( record_size > 0x10001L ||
569 record_size < 4 ) ) )
578 for ( nn = 0; nn < num_records; nn++ )
580 if (
p + record_size >
limit )
583 face->hdmx_record_sizes[nn] =
p[0];
587 face->hdmx_record_count = nn;
589 face->hdmx_record_size = record_size;
596 face->hdmx_table_size = 0;
629 for ( nn = 0; nn <
face->hdmx_record_count; nn++ )
630 if (
face->hdmx_record_sizes[nn] == ppem )
633 if ( gindex < record_size )
#define FT_TRACE2(varformat)
#define FT_TRACE1(varformat)
#define FT_NEW_ARRAY(ptr, count)
#define FT_FRAME_ENTER(size)
#define FT_FRAME_RELEASE(bytes)
#define FT_NEXT_USHORT(buffer)
#define FT_FRAME_EXTRACT(size, bytes)
#define FT_NEXT_ULONG(buffer)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLenum GLuint GLint GLenum face
static char memory[1024 *256]
tt_face_load_prep(TT_Face face, FT_Stream stream)
tt_face_load_cvt(TT_Face face, FT_Stream stream)
tt_face_free_hdmx(TT_Face face)
tt_face_get_device_metrics(TT_Face face, FT_UInt ppem, FT_UInt gindex)
tt_face_load_fpgm(TT_Face face, FT_Stream stream)
tt_face_load_hdmx(TT_Face face, FT_Stream stream)
tt_face_done_loca(TT_Face face)
tt_face_load_loca(TT_Face face, FT_Stream stream)
tt_face_get_location(TT_Face face, FT_UInt gindex, FT_UInt *asize)