21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
23#include FT_TRUETYPE_TAGS_H
36#define FT_COMPONENT ttload
63#ifdef FT_DEBUG_LEVEL_TRACE
68 FT_TRACE4((
"tt_face_lookup_table: %08p, `%c%c%c%c' -- ",
84 if (
entry->Length != 0 )
89#ifdef FT_DEBUG_LEVEL_TRACE
95#ifdef FT_DEBUG_LEVEL_TRACE
182 FT_UInt has_head = 0, has_sing = 0, has_meta = 0;
188#define FT_STRUCTURE TT_TableRec
202 for ( nn = 0; nn <
sfnt->num_tables; nn++ )
211 " can read only %d table%s in font (instead of %d)\n",
212 nn, nn == 1 ?
"" :
"s",
sfnt->num_tables ));
213 sfnt->num_tables = nn;
221 FT_TRACE2((
"check_table_dir: table entry %d invalid\n", nn ));
236 FT_TRACE2((
"check_table_dir: table entry %d invalid\n", nn ));
248#ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
262 if (
table.Length < 0x36 )
265 " `head' or `bhed' table too small\n" ));
274 if ( magic != 0x5F0F3CF5UL )
276 " invalid magic number in `head' or `bhed' table\n"));
287 *
valid = valid_entries;
289 if ( !valid_entries )
291 FT_TRACE2((
"check_table_dir: no valid tables found\n" ));
297 if ( has_head || ( has_sing && has_meta ) )
305#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
306 FT_TRACE2((
" neither `head', `bhed', nor `sing' table found\n" ));
308 FT_TRACE2((
" neither `head' nor `sing' table found\n" ));
355#define FT_STRUCTURE SFNT_HeaderRec
378 if (
sfnt.search_range != 1 << (
sfnt.entry_selector + 4 ) ||
379 sfnt.search_range +
sfnt.range_shift !=
sfnt.num_tables << 4 )
380 return FT_THROW( Unknown_File_Format );
385 FT_TRACE2((
"-- Number of tables: %10u\n",
sfnt.num_tables ));
386 FT_TRACE2((
"-- Format version: 0x%08lx\n",
sfnt.format_tag ));
395 " invalid table directory for TrueType\n" ));
400 valid_entries =
sfnt.num_tables;
402 face->num_tables = valid_entries;
413 " tag offset length checksum\n"
414 " ----------------------------------\n" ));
417 for ( nn = 0; nn <
sfnt.num_tables; nn++ )
438#ifdef FT_DEBUG_LEVEL_TRACE
446 FT_TRACE2((
" %c%c%c%c %08lx %08lx %08lx"
447 " (sanitized; original length %08lx)",
460#ifdef FT_DEBUG_LEVEL_TRACE
462 FT_TRACE2((
" %c%c%c%c %08lx %08lx %08lx",
474 for (
i = 0;
i < valid_entries;
i++ )
484 FT_TRACE2((
" (duplicate, ignored)\n" ));
492 face->dir_tables[valid_entries++] =
entry;
497 face->num_tables = valid_entries;
501 FT_TRACE2((
"table directory loaded\n\n" ));
632#define FT_STRUCTURE TT_Header
683#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
723#define FT_STRUCTURE TT_MaxProfile
772 if ( maxProfile->
version >= 0x10000L )
790 " too much twilight points in `maxp' table;\n"
792 " some glyphs might be rendered incorrectly\n" ));
830 FT_ULong storage_start, storage_limit;
836#define FT_STRUCTURE TT_NameTableRec
848#define FT_STRUCTURE TT_NameRec
863#define FT_STRUCTURE TT_LangTagRec
891 storage_start = table_pos + 6 + 12 *
table->numNameRecords;
892 storage_limit = table_pos + table_len;
894 if ( storage_start > storage_limit )
896 FT_ERROR((
"tt_face_load_name: invalid `name' table\n" ));
903 if (
table->format == 1 )
909 storage_start += 2 + 4 *
table->numLangTagRecords;
927 entry->stringOffset += table_pos +
table->storageOffset;
928 if (
entry->stringOffset < storage_start ||
929 entry->stringOffset +
entry->stringLength > storage_limit )
932 entry->stringLength = 0;
959 if (
entry->stringLength == 0 )
963 entry->stringOffset += table_pos +
table->storageOffset;
964 if (
entry->stringOffset < storage_start ||
965 entry->stringOffset +
entry->stringLength > storage_limit )
973 if (
table->format == 1 &&
entry->languageID >= 0x8000U )
975 if (
entry->languageID - 0x8000U >=
table->numLangTagRecords ||
976 !
table->langTags[
entry->languageID - 0x8000U].stringLength )
989 table->numNameRecords,
1035 if (
table->langTags )
1047 table->numNameRecords = 0;
1048 table->numLangTagRecords = 0;
1050 table->storageOffset = 0;
1086 face->cmap_size = 0;
1122#define FT_STRUCTURE TT_OS2
1284#define FT_STRUCTURE TT_Postscript
1312 ?
" yes" :
" no" ));
1343#define FT_STRUCTURE TT_PCLT
1424 if (
face->gasp.version >= 2 )
1426 face->gasp.numRanges = 0;
1431 num_ranges =
face->gasp.numRanges;
1432 FT_TRACE3((
"numRanges: %u\n", num_ranges ));
1438 gaspranges =
face->gasp.gaspRanges;
1440 for (
j = 0;
j < num_ranges;
j++ )
1445 FT_TRACE3((
"gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n",
1447 gaspranges[
j].maxPPEM,
1448 gaspranges[
j].gaspFlag ));
static const WCHAR version[]
#define FT_TRACE0(varformat)
#define FT_ERROR(varformat)
#define FT_TRACE3(varformat)
#define FT_TRACE2(varformat)
#define FT_TRACE4(varformat)
#define FT_NEW_ARRAY(ptr, count)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_QNEW_ARRAY(ptr, count)
#define FT_FRAME_ENTER(size)
#define FT_READ_USHORT(var)
#define FT_STREAM_SEEK(position)
#define FT_READ_ULONG(var)
#define FT_FRAME_SHORT(f)
#define FT_FRAME_ULONG(f)
#define FT_FRAME_EXTRACT(size, bytes)
#define FT_STREAM_READ_FIELDS(fields, object)
#define FT_STREAM_READ_AT(position, buffer, count)
#define FT_FRAME_BYTES(field, count)
#define FT_FRAME_START(size)
#define FT_FRAME_USHORT(f)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLuint GLuint GLsizei count
GLenum const GLvoid GLbitfield GLsizei numGlyphs
GLenum GLuint GLint GLenum face
GLuint GLsizei GLsizei * length
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
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 GLint GLint j
static char memory[1024 *256]
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
FT_UShort maxComponentElements
FT_UShort maxStackElements
FT_UShort maxInstructionDefs
FT_UShort maxTwilightPoints
FT_UShort maxCompositeContours
FT_UShort maxComponentDepth
FT_UShort maxCompositePoints
FT_UShort maxSizeOfInstructions
FT_UShort maxFunctionDefs
FT_ULong ulCodePageRange1
FT_UShort usLowerOpticalPointSize
FT_UShort usUpperOpticalPointSize
FT_ULong ulCodePageRange2
tt_face_free_name(TT_Face face)
tt_face_load_post(TT_Face face, FT_Stream stream)
tt_face_load_pclt(TT_Face face, FT_Stream stream)
tt_face_load_gasp(TT_Face face, FT_Stream stream)
tt_face_load_font_dir(TT_Face face, FT_Stream stream)
tt_face_load_head(TT_Face face, FT_Stream stream)
tt_face_load_os2(TT_Face face, FT_Stream stream)
tt_face_load_maxp(TT_Face face, FT_Stream stream)
tt_face_load_any(TT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
tt_face_goto_table(TT_Face face, FT_ULong tag, FT_Stream stream, FT_ULong *length)
static FT_Error check_table_dir(SFNT_Header sfnt, FT_Stream stream, FT_UShort *valid)
tt_face_load_cmap(TT_Face face, FT_Stream stream)
tt_face_load_name(TT_Face face, FT_Stream stream)
static FT_Error tt_face_load_generic_header(TT_Face face, FT_Stream stream, FT_ULong tag)
tt_face_lookup_table(TT_Face face, FT_ULong tag)
FT_BEGIN_HEADER struct TT_Header_ TT_Header
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
_Reserved_ PVOID Reserved
_Must_inspect_result_ _In_ ULONG Flags