20 #include FT_INTERNAL_DEBUG_H
21 #include FT_INTERNAL_STREAM_H
22 #include FT_TRUETYPE_TAGS_H
35 #define FT_COMPONENT trace_ttmtx
63 #ifndef FT_CONFIG_OPTION_OLD_INTERNALS
79 ptable_offset = &face->vert_metrics_offset;
80 ptable_size = &face->vert_metrics_size;
85 ptable_offset = &face->horz_metrics_offset;
86 ptable_size = &face->horz_metrics_size;
89 error = face->goto_table( face, tag, stream, &table_size );
93 *ptable_size = table_size;
111 FT_Long num_shorts, num_longs, num_shorts_checked;
120 void* lm = &face->vertical.long_metrics;
121 void** sm = &face->vertical.short_metrics;
124 error = face->goto_table( face,
TTAG_vmtx, stream, &table_len );
128 num_longs = face->vertical.number_Of_VMetrics;
129 if ( (
FT_ULong)num_longs > table_len / 4 )
130 num_longs = (
FT_Long)( table_len / 4 );
132 face->vertical.number_Of_VMetrics = 0;
139 void* lm = &face->horizontal.long_metrics;
140 void** sm = &face->horizontal.short_metrics;
143 error = face->goto_table( face,
TTAG_hmtx, stream, &table_len );
147 num_longs = face->horizontal.number_Of_HMetrics;
148 if ( (
FT_ULong)num_longs > table_len / 4 )
149 num_longs = (
FT_Long)( table_len / 4 );
151 face->horizontal.number_Of_HMetrics = 0;
159 num_shorts = face->max_profile.numGlyphs - num_longs;
160 num_shorts_checked = ( table_len - num_longs * 4L ) / 2;
162 if ( num_shorts < 0 )
165 " %cmtx has more metrics than glyphs.\n",
166 vertical ?
'v' :
'h' ));
170 error = vertical ? SFNT_Err_Invalid_Vert_Metrics
171 : SFNT_Err_Invalid_Horiz_Metrics;
192 for ( ; cur <
limit; cur++ )
203 FT_MIN( num_shorts, num_shorts_checked );
206 for ( ; cur <
limit; cur++ )
212 if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 )
217 limit = *shorts + num_shorts;
218 for ( ; cur <
limit; cur++ )
226 face->vertical.number_Of_VMetrics = (
FT_UShort)num_longs;
228 face->horizontal.number_Of_HMetrics = (
FT_UShort)num_longs;
266 #define FT_STRUCTURE TT_HoriHeader
292 void *
v = &face->vertical;
295 error = face->goto_table( face,
TTAG_vhea, stream, 0 );
303 error = face->goto_table( face,
TTAG_hhea, stream, 0 );
307 header = &face->horizontal;
346 #ifndef FT_CONFIG_OPTION_OLD_INTERNALS
358 FT_ULong table_pos, table_size, table_end;
364 void*
v = &face->vertical;
368 table_pos = face->vert_metrics_offset;
369 table_size = face->vert_metrics_size;
373 header = &face->horizontal;
374 table_pos = face->horz_metrics_offset;
375 table_size = face->horz_metrics_size;
378 table_end = table_pos + table_size;
386 table_pos += 4 * gindex;
387 if ( table_pos + 4 > table_end )
397 table_pos += 4 * ( k - 1 );
398 if ( table_pos + 4 > table_end )
405 table_pos += 4 + 2 * ( gindex -
k );
406 if ( table_pos + 2 > table_end )
434 void*
v = &face->vertical;
435 void*
h = &face->horizontal;
443 !header->long_metrics ||
446 *abearing = *aadvance = 0;
453 *abearing = longs_m->bearing;
454 *aadvance = longs_m->advance;
GLuint const GLfloat * val
cannot open resource broken file module version is too low unimplemented feature broken offset within table missing module invalid character code cannot render this glyph format invalid composite glyph invalid pixel size invalid library handle invalid face handle invalid glyph slot handle invalid cache manager handle too many modules out of memory cannot open stream invalid stream skip invalid stream operation nested frame access raster uninitialized raster overflow too many registered caches too few arguments code overflow division by zero found debug opcode nested DEFS execution context too long too many instruction definitions horizontal header(hhea) table missing" ) FT_ERRORDEF_( Locations_Missing
GLfloat GLfloat GLfloat GLfloat h
tt_face_load_hhea(TT_Face face, FT_Stream stream, FT_Bool vertical)
tt_face_get_metrics(TT_Face face, FT_Bool vertical, FT_UInt gindex, FT_Short *abearing, FT_UShort *aadvance)
#define FT_QNEW_ARRAY(ptr, count)
#define FT_READ_USHORT(var)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
#define FT_STREAM_READ_FIELDS(fields, object)
#define FT_FRAME_USHORT(f)
#define FT_TRACE0(varformat)
GLenum const void GLbitfield GLuint GLsizei numGlyphs
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_STREAM_SEEK(position)
#define FT_NEXT_USHORT(buffer)
#define FT_TRACE3(varformat)
#define FT_FRAME_ULONG(f)
tt_face_load_hmtx(TT_Face face, FT_Stream stream, FT_Bool vertical)
#define FT_FRAME_ENTER(size)
#define FT_NEXT_SHORT(buffer)
#define FT_READ_SHORT(var)
#define FT_FRAME_SHORT(f)
#define FT_FRAME_START(size)
struct TT_LongMetricsRec_ * TT_LongMetrics