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 ttpload
80 face->glyf_offset = 0;
86#ifdef FT_CONFIG_OPTION_INCREMENTAL
87 if (
face->root.internal->incremental_interface )
88 face->glyf_offset = 0;
102 if (
face->header.Index_To_Loc_Format != 0 )
106 if ( table_len >= 0x40000L )
109 table_len = 0x3FFFFL;
111 face->num_locations = table_len >>
shift;
117 if ( table_len >= 0x20000L )
120 table_len = 0x1FFFFL;
122 face->num_locations = table_len >>
shift;
127 FT_TRACE2((
"glyph count mismatch! loca: %d, maxp: %d\n",
128 face->num_locations - 1,
face->root.num_glyphs ));
150 if ( diff > 0 && diff < dist )
163 if ( new_loca_len <= (
FT_ULong)dist )
166 table_len = new_loca_len;
168 FT_TRACE2((
"adjusting num_locations to %d\n",
169 face->num_locations ));
173 face->root.num_glyphs =
face->num_locations
176 FT_TRACE2((
"adjusting num_glyphs to %d\n",
177 face->root.num_glyphs ));
208 if ( gindex < face->num_locations )
210 if (
face->header.Index_To_Loc_Format != 0 )
212 p =
face->glyph_locations + gindex * 4;
213 p_limit =
face->glyph_locations +
face->num_locations * 4;
218 if (
p + 4 <= p_limit )
223 p =
face->glyph_locations + gindex * 2;
224 p_limit =
face->glyph_locations +
face->num_locations * 2;
229 if (
p + 2 <= p_limit )
238 if ( pos1 >
face->glyf_len )
241 " too large offset (0x%08lx) found for glyph index %ld,\n"
243 " exceeding the end of `glyf' table (0x%08lx)\n",
244 pos1, gindex,
face->glyf_len ));
249 if ( pos2 >
face->glyf_len )
252 if ( gindex ==
face->num_locations - 2 )
255 " too large size (%ld bytes) found for glyph index %ld,\n"
257 " truncating at the end of `glyf' table to %ld bytes\n",
258 pos2 - pos1, gindex,
face->glyf_len - pos1 ));
259 pos2 =
face->glyf_len;
264 " too large offset (0x%08lx) found for glyph index %ld,\n"
266 " exceeding the end of `glyf' table (0x%08lx)\n",
267 pos2, gindex + 1,
face->glyf_len ));
282 *asize = (
FT_UInt)( pos2 - pos1 );
297 face->num_locations = 0;
325#ifdef TT_USE_BYTECODE_INTERPRETER
346 face->cvt_size = table_len / 2;
366#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
408#ifdef TT_USE_BYTECODE_INTERPRETER
421 face->font_program_size = 0;
428 face->font_program_size = table_len;
432 FT_TRACE2((
"loaded, %12d bytes\n",
face->font_program_size ));
472#ifdef TT_USE_BYTECODE_INTERPRETER
484 face->cvt_program_size = 0;
491 face->cvt_program_size = table_len;
495 FT_TRACE2((
"loaded, %12d bytes\n",
face->cvt_program_size ));
551 p =
face->hdmx_table;
572 if ( record_size >= 0xFFFF0000UL )
573 record_size &= 0xFFFFU;
576 if ( num_records > 255 ||
578 ( record_size > 0x10001L ||
579 record_size < 4 ) ) )
588 for ( nn = 0; nn < num_records; nn++ )
590 if (
p + record_size >
limit )
593 face->hdmx_record_sizes[nn] =
p[0];
597 face->hdmx_record_count = nn;
599 face->hdmx_record_size = record_size;
606 face->hdmx_table_size = 0;
639 for ( nn = 0; nn <
face->hdmx_record_count; nn++ )
640 if (
face->hdmx_record_sizes[nn] == ppem )
643 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)