21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
23#include FT_TRUETYPE_TAGS_H
36#define FT_COMPONENT trace_ttload
61#ifdef FT_DEBUG_LEVEL_TRACE
66 FT_TRACE4((
"tt_face_lookup_table: %08p, `%c%c%c%c' -- ",
82 if (
entry->Length != 0 )
87#ifdef FT_DEBUG_LEVEL_TRACE
93#ifdef FT_DEBUG_LEVEL_TRACE
176 FT_UInt has_head = 0, has_sing = 0, has_meta = 0;
182#define FT_STRUCTURE TT_TableRec
196 for ( nn = 0; nn <
sfnt->num_tables; nn++ )
205 " can read only %d table%s in font (instead of %d)\n",
206 nn, nn == 1 ?
"" :
"s",
sfnt->num_tables ));
207 sfnt->num_tables = nn;
215 FT_TRACE2((
"check_table_dir: table entry %d invalid\n", nn ));
230 FT_TRACE2((
"check_table_dir: table entry %d invalid\n", nn ));
242#ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
256 if (
table.Length < 0x36 )
259 " `head' or `bhed' table too small\n" ));
268 if ( magic != 0x5F0F3CF5UL )
270 " invalid magic number in `head' or `bhed' table\n"));
281 *
valid = valid_entries;
283 if ( !valid_entries )
285 FT_TRACE2((
"check_table_dir: no valid tables found\n" ));
291 if ( has_head || ( has_sing && has_meta ) )
299#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
300 FT_TRACE2((
" neither `head', `bhed', nor `sing' table found\n" ));
302 FT_TRACE2((
" neither `head' nor `sing' table found\n" ));
346#define FT_STRUCTURE SFNT_HeaderRec
369 if (
sfnt.search_range != 1 << (
sfnt.entry_selector + 4 ) ||
370 sfnt.search_range +
sfnt.range_shift !=
sfnt.num_tables << 4 )
371 return FT_THROW( Unknown_File_Format );
376 FT_TRACE2((
"-- Number of tables: %10u\n",
sfnt.num_tables ));
377 FT_TRACE2((
"-- Format version: 0x%08lx\n",
sfnt.format_tag ));
386 " invalid table directory for TrueType\n" ));
391 valid_entries =
sfnt.num_tables;
393 face->num_tables = valid_entries;
404 " tag offset length checksum\n"
405 " ----------------------------------\n" ));
408 for ( nn = 0; nn <
sfnt.num_tables; nn++ )
429#ifdef FT_DEBUG_LEVEL_TRACE
437 FT_TRACE2((
" %c%c%c%c %08lx %08lx %08lx"
438 " (sanitized; original length %08lx)",
451#ifdef FT_DEBUG_LEVEL_TRACE
453 FT_TRACE2((
" %c%c%c%c %08lx %08lx %08lx",
465 for (
i = 0;
i < valid_entries;
i++ )
475 FT_TRACE2((
" (duplicate, ignored)\n" ));
483 face->dir_tables[valid_entries++] =
entry;
488 face->num_tables = valid_entries;
492 FT_TRACE2((
"table directory loaded\n\n" ));
616#define FT_STRUCTURE TT_Header
667#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
705#define FT_STRUCTURE TT_MaxProfile
754 if ( maxProfile->
version >= 0x10000L )
772 " too much twilight points in `maxp' table;\n"
774 " some glyphs might be rendered incorrectly\n" ));
810 FT_ULong storage_start, storage_limit;
816#define FT_STRUCTURE TT_NameTableRec
828#define FT_STRUCTURE TT_NameRec
843#define FT_STRUCTURE TT_LangTagRec
871 storage_start = table_pos + 6 + 12 *
table->numNameRecords;
872 storage_limit = table_pos + table_len;
874 if ( storage_start > storage_limit )
876 FT_ERROR((
"tt_face_load_name: invalid `name' table\n" ));
883 if (
table->format == 1 )
889 storage_start += 2 + 4 *
table->numLangTagRecords;
907 entry->stringOffset += table_pos +
table->storageOffset;
908 if (
entry->stringOffset < storage_start ||
909 entry->stringOffset +
entry->stringLength > storage_limit )
912 entry->stringLength = 0;
939 if (
entry->stringLength == 0 )
943 entry->stringOffset += table_pos +
table->storageOffset;
944 if (
entry->stringOffset < storage_start ||
945 entry->stringOffset +
entry->stringLength > storage_limit )
953 if (
table->format == 1 &&
entry->languageID >= 0x8000U )
955 if (
entry->languageID - 0x8000U >=
table->numLangTagRecords ||
956 !
table->langTags[
entry->languageID - 0x8000U].stringLength )
969 table->numNameRecords,
1014 if (
table->langTags )
1026 table->numNameRecords = 0;
1027 table->numLangTagRecords = 0;
1029 table->storageOffset = 0;
1063 face->cmap_size = 0;
1097#define FT_STRUCTURE TT_OS2
1257#define FT_STRUCTURE TT_Postscript
1285 ?
" yes" :
" no" ));
1314#define FT_STRUCTURE TT_PCLT
1393 if (
face->gasp.version >= 2 )
1395 face->gasp.numRanges = 0;
1400 num_ranges =
face->gasp.numRanges;
1401 FT_TRACE3((
"numRanges: %u\n", num_ranges ));
1407 gaspranges =
face->gasp.gaspRanges;
1409 for (
j = 0;
j < num_ranges;
j++ )
1414 FT_TRACE3((
"gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n",
1416 gaspranges[
j].maxPPEM,
1417 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