本文整理汇总了C++中FT_TRACE3函数的典型用法代码示例。如果您正苦于以下问题:C++ FT_TRACE3函数的具体用法?C++ FT_TRACE3怎么用?C++ FT_TRACE3使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FT_TRACE3函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tt_face_load_gasp
tt_face_load_gasp( TT_Face face,
FT_Stream stream )
{
FT_Error error;
FT_Memory memory = stream->memory;
FT_UInt j,num_ranges;
TT_GaspRange gaspranges;
/* the gasp table is optional */
error = face->goto_table( face, TTAG_gasp, stream, 0 );
if ( error )
goto Exit;
if ( FT_FRAME_ENTER( 4L ) )
goto Exit;
face->gasp.version = FT_GET_USHORT();
face->gasp.numRanges = FT_GET_USHORT();
FT_FRAME_EXIT();
/* only support versions 0 and 1 of the table */
if ( face->gasp.version >= 2 )
{
face->gasp.numRanges = 0;
error = SFNT_Err_Invalid_Table;
goto Exit;
}
num_ranges = face->gasp.numRanges;
FT_TRACE3(( "numRanges: %u\n", num_ranges ));
if ( FT_QNEW_ARRAY( gaspranges, num_ranges ) ||
FT_FRAME_ENTER( num_ranges * 4L ) )
goto Exit;
face->gasp.gaspRanges = gaspranges;
for ( j = 0; j < num_ranges; j++ )
{
gaspranges[j].maxPPEM = FT_GET_USHORT();
gaspranges[j].gaspFlag = FT_GET_USHORT();
FT_TRACE3(( "gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\n",
j,
gaspranges[j].maxPPEM,
gaspranges[j].gaspFlag ));
}
FT_FRAME_EXIT();
Exit:
return error;
}
示例2: tt_face_load_generic_header
static FT_Error
tt_face_load_generic_header( TT_Face face,
FT_Stream stream,
FT_ULong tag )
{
FT_Error error;
TT_Header* header;
static const FT_Frame_Field header_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_Header
FT_FRAME_START( 54 ),
FT_FRAME_ULONG ( Table_Version ),
FT_FRAME_ULONG ( Font_Revision ),
FT_FRAME_LONG ( CheckSum_Adjust ),
FT_FRAME_LONG ( Magic_Number ),
FT_FRAME_USHORT( Flags ),
FT_FRAME_USHORT( Units_Per_EM ),
FT_FRAME_LONG ( Created[0] ),
FT_FRAME_LONG ( Created[1] ),
FT_FRAME_LONG ( Modified[0] ),
FT_FRAME_LONG ( Modified[1] ),
FT_FRAME_SHORT ( xMin ),
FT_FRAME_SHORT ( yMin ),
FT_FRAME_SHORT ( xMax ),
FT_FRAME_SHORT ( yMax ),
FT_FRAME_USHORT( Mac_Style ),
FT_FRAME_USHORT( Lowest_Rec_PPEM ),
FT_FRAME_SHORT ( Font_Direction ),
FT_FRAME_SHORT ( Index_To_Loc_Format ),
FT_FRAME_SHORT ( Glyph_Data_Format ),
FT_FRAME_END
};
error = face->goto_table( face, tag, stream, 0 );
if ( error )
goto Exit;
header = &face->header;
if ( FT_STREAM_READ_FIELDS( header_fields, header ) )
goto Exit;
FT_TRACE3(( "Units per EM: %4u\n", header->Units_Per_EM ));
FT_TRACE3(( "IndexToLoc: %4d\n", header->Index_To_Loc_Format ));
Exit:
return error;
}
示例3: otv_JSTF_validate
otv_JSTF_validate( FT_Bytes table,
FT_Bytes gsub,
FT_Bytes gpos,
FT_UInt glyph_count,
FT_Validator ftvalid )
{
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt JstfScriptCount;
otvalid->root = ftvalid;
FT_TRACE3(( "validating JSTF table\n" ));
OTV_INIT;
OTV_LIMIT_CHECK( 6 );
if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
FT_INVALID_FORMAT;
JstfScriptCount = FT_NEXT_USHORT( p );
FT_TRACE3(( " (JstfScriptCount = %d)\n", JstfScriptCount ));
OTV_LIMIT_CHECK( JstfScriptCount * 6 );
if ( gsub )
otvalid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub );
else
otvalid->extra1 = 0;
if ( gpos )
otvalid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos );
else
otvalid->extra2 = 0;
otvalid->glyph_count = glyph_count;
/* JstfScriptRecord */
for ( ; JstfScriptCount > 0; JstfScriptCount-- )
{
p += 4; /* skip JstfScriptTag */
/* JstfScript */
otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), otvalid );
}
FT_TRACE4(( "\n" ));
}
示例4: otv_MATH_validate
otv_MATH_validate( FT_Bytes table,
FT_UInt glyph_count,
FT_Validator ftvalid )
{
OTV_ValidatorRec validrec;
OTV_Validator valid = &validrec;
FT_Bytes p = table;
FT_UInt MathConstants, MathGlyphInfo, MathVariants;
valid->root = ftvalid;
FT_TRACE3(( "validating MATH table\n" ));
OTV_INIT;
OTV_LIMIT_CHECK( 10 );
if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
FT_INVALID_FORMAT;
MathConstants = FT_NEXT_USHORT( p );
MathGlyphInfo = FT_NEXT_USHORT( p );
MathVariants = FT_NEXT_USHORT( p );
valid->glyph_count = glyph_count;
otv_MathConstants_validate( table + MathConstants,
valid );
otv_MathGlyphInfo_validate( table + MathGlyphInfo,
valid );
otv_MathVariants_validate ( table + MathVariants,
valid );
FT_TRACE4(( "\n" ));
}
示例5: gxv_bsln_validate
gxv_bsln_validate( FT_Bytes table,
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_bsln_DataRec bslnrec;
GXV_bsln_Data bsln = &bslnrec;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
FT_UShort format;
FT_UShort defaultBaseline;
GXV_Validate_Func fmt_funcs_table [] =
{
gxv_bsln_parts_fmt0_validate,
gxv_bsln_parts_fmt1_validate,
gxv_bsln_parts_fmt2_validate,
gxv_bsln_parts_fmt3_validate,
};
valid->root = ftvalid;
valid->table_data = bsln;
valid->face = face;
FT_TRACE3(( "validating `bsln' table\n" ));
GXV_INIT;
GXV_LIMIT_CHECK( 4 + 2 + 2 );
version = FT_NEXT_ULONG( p );
format = FT_NEXT_USHORT( p );
defaultBaseline = FT_NEXT_USHORT( p );
/* only version 1.0 is defined (1996) */
if ( version != 0x00010000UL )
FT_INVALID_FORMAT;
/* only format 1, 2, 3 are defined (1996) */
GXV_TRACE(( " (format = %d)\n", format ));
if ( format > 3 )
FT_INVALID_FORMAT;
if ( defaultBaseline > 31 )
FT_INVALID_FORMAT;
bsln->defaultBaseline = defaultBaseline;
fmt_funcs_table[format]( p, limit, valid );
FT_TRACE4(( "\n" ));
}
示例6: gxv_opbd_validate
gxv_opbd_validate( FT_Bytes table,
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec gxvalidrec;
GXV_Validator gxvalid = &gxvalidrec;
GXV_opbd_DataRec opbdrec;
GXV_opbd_Data opbd = &opbdrec;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
gxvalid->root = ftvalid;
gxvalid->table_data = opbd;
gxvalid->face = face;
FT_TRACE3(( "validating `opbd' table\n" ));
GXV_INIT;
GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU;
GXV_LIMIT_CHECK( 4 + 2 );
version = FT_NEXT_ULONG( p );
GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p );
/* only 0x00010000 is defined (1996) */
GXV_TRACE(( "(version=0x%08x)\n", version ));
if ( 0x00010000UL != version )
FT_INVALID_FORMAT;
/* only values 0 and 1 are defined (1996) */
GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) ));
if ( 0x0001 < GXV_OPBD_DATA( format ) )
FT_INVALID_FORMAT;
gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
gxvalid->lookupval_func = gxv_opbd_LookupValue_validate;
gxvalid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
gxv_LookupTable_validate( p, limit, gxvalid );
p += gxvalid->subtable_length;
if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
{
GXV_TRACE((
"found overlap between LookupTable and opbd_value array\n" ));
FT_INVALID_OFFSET;
}
FT_TRACE4(( "\n" ));
}
示例7: tt_face_load_post
tt_face_load_post( TT_Face face,
FT_Stream stream )
{
FT_Error error;
TT_Postscript* post = &face->postscript;
static const FT_Frame_Field post_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_Postscript
FT_FRAME_START( 32 ),
FT_FRAME_ULONG( FormatType ),
FT_FRAME_ULONG( italicAngle ),
FT_FRAME_SHORT( underlinePosition ),
FT_FRAME_SHORT( underlineThickness ),
FT_FRAME_ULONG( isFixedPitch ),
FT_FRAME_ULONG( minMemType42 ),
FT_FRAME_ULONG( maxMemType42 ),
FT_FRAME_ULONG( minMemType1 ),
FT_FRAME_ULONG( maxMemType1 ),
FT_FRAME_END
};
error = face->goto_table( face, TTAG_post, stream, 0 );
if ( error )
return error;
if ( FT_STREAM_READ_FIELDS( post_fields, post ) )
return error;
/* we don't load the glyph names, we do that in another */
/* module (ttpost). */
FT_TRACE3(( "FormatType: 0x%x\n", post->FormatType ));
FT_TRACE3(( "isFixedPitch: %s\n", post->isFixedPitch
? " yes" : " no" ));
return SFNT_Err_Ok;
}
示例8: gxv_lcar_validate
gxv_lcar_validate( FT_Bytes table,
FT_Face face,
FT_Validator ftvalid )
{
FT_Bytes p = table;
FT_Bytes limit = 0;
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
GXV_lcar_DataRec lcarrec;
GXV_lcar_Data lcar = &lcarrec;
FT_Fixed version;
valid->root = ftvalid;
valid->table_data = lcar;
valid->face = face;
FT_TRACE3(( "validating `lcar' table\n" ));
GXV_INIT;
GXV_LIMIT_CHECK( 4 + 2 );
version = FT_NEXT_ULONG( p );
GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p );
if ( version != 0x00010000UL)
FT_INVALID_FORMAT;
if ( GXV_LCAR_DATA( format ) > 1 )
FT_INVALID_FORMAT;
valid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;
valid->lookupval_func = gxv_lcar_LookupValue_validate;
valid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;
gxv_LookupTable_validate( p, limit, valid );
FT_TRACE4(( "\n" ));
}
示例9: otv_GSUB_validate
otv_GSUB_validate( FT_Bytes table,
FT_UInt glyph_count,
FT_Validator ftvalid )
{
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt ScriptList, FeatureList, LookupList;
otvalid->root = ftvalid;
FT_TRACE3(( "validating GSUB table\n" ));
OTV_INIT;
OTV_LIMIT_CHECK( 10 );
if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
FT_INVALID_FORMAT;
ScriptList = FT_NEXT_USHORT( p );
FeatureList = FT_NEXT_USHORT( p );
LookupList = FT_NEXT_USHORT( p );
otvalid->type_count = 8;
otvalid->type_funcs = (OTV_Validate_Func*)otv_gsub_validate_funcs;
otvalid->glyph_count = glyph_count;
otv_LookupList_validate( table + LookupList,
otvalid );
otv_FeatureList_validate( table + FeatureList, table + LookupList,
otvalid );
otv_ScriptList_validate( table + ScriptList, table + FeatureList,
otvalid );
FT_TRACE4(( "\n" ));
}
示例10: gxv_mort_validate
gxv_mort_validate( FT_Bytes table,
FT_Face face,
FT_Validator ftvalid )
{
GXV_ValidatorRec validrec;
GXV_Validator valid = &validrec;
FT_Bytes p = table;
FT_Bytes limit = 0;
FT_ULong version;
FT_ULong nChains;
FT_ULong i;
valid->root = ftvalid;
valid->face = face;
limit = valid->root->limit;
FT_TRACE3(( "validating `mort' table\n" ));
GXV_INIT;
GXV_LIMIT_CHECK( 4 + 4 );
version = FT_NEXT_ULONG( p );
nChains = FT_NEXT_ULONG( p );
if (version != 0x00010000UL)
FT_INVALID_FORMAT;
for ( i = 0; i < nChains; i++ )
{
GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
gxv_mort_chain_validate( p, limit, valid );
p += valid->subtable_length;
}
FT_TRACE4(( "\n" ));
}
示例11: otv_BASE_validate
otv_BASE_validate( FT_Bytes table,
FT_Validator ftvalid )
{
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt table_size;
OTV_OPTIONAL_TABLE( HorizAxis );
OTV_OPTIONAL_TABLE( VertAxis );
otvalid->root = ftvalid;
FT_TRACE3(( "validating BASE table\n" ));
OTV_INIT;
OTV_LIMIT_CHECK( 6 );
if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
FT_INVALID_FORMAT;
table_size = 6;
OTV_OPTIONAL_OFFSET( HorizAxis );
OTV_SIZE_CHECK( HorizAxis );
if ( HorizAxis )
otv_Axis_validate( table + HorizAxis, otvalid );
OTV_OPTIONAL_OFFSET( VertAxis );
OTV_SIZE_CHECK( VertAxis );
if ( VertAxis )
otv_Axis_validate( table + VertAxis, otvalid );
FT_TRACE4(( "\n" ));
}
示例12: sfnt_open_font
/* synthesized into a TTC with one offset table. */
static FT_Error
sfnt_open_font(FT_Stream stream,
TT_Face face)
{
FT_Memory memory = stream->memory;
FT_Error error;
FT_ULong tag, offset;
static const FT_Frame_Field ttc_header_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TTC_HeaderRec
FT_FRAME_START(8),
FT_FRAME_LONG(version),
FT_FRAME_LONG(count),
FT_FRAME_END
};
face->ttc_header.tag = 0;
face->ttc_header.version = 0;
face->ttc_header.count = 0;
offset = FT_STREAM_POS();
if (FT_READ_ULONG(tag))
return error;
if (tag != 0x00010000UL &&
tag != TTAG_ttcf &&
tag != TTAG_OTTO &&
tag != TTAG_true &&
tag != TTAG_typ1 &&
tag != 0x00020000UL)
return SFNT_Err_Unknown_File_Format;
face->ttc_header.tag = TTAG_ttcf;
if (tag == TTAG_ttcf)
{
FT_Int n;
FT_TRACE3(("sfnt_open_font: file is a collection\n"));
if (FT_STREAM_READ_FIELDS(ttc_header_fields, &face->ttc_header))
return error;
/* now read the offsets of each font in the file */
if (FT_NEW_ARRAY(face->ttc_header.offsets, face->ttc_header.count))
return error;
if (FT_FRAME_ENTER(face->ttc_header.count * 4L))
return error;
for (n = 0; n < face->ttc_header.count; n++)
face->ttc_header.offsets[n] = FT_GET_ULONG();
FT_FRAME_EXIT();
}
else
{
FT_TRACE3(("sfnt_open_font: synthesize TTC\n"));
face->ttc_header.version = 1 << 16;
face->ttc_header.count = 1;
if (FT_NEW(face->ttc_header.offsets))
return error;
face->ttc_header.offsets[0] = offset;
}
return error;
}
示例13: tt_face_load_os2
//.........这里部分代码省略.........
FT_FRAME_SHORT ( ySuperscriptXSize ),
FT_FRAME_SHORT ( ySuperscriptYSize ),
FT_FRAME_SHORT ( ySuperscriptXOffset ),
FT_FRAME_SHORT ( ySuperscriptYOffset ),
FT_FRAME_SHORT ( yStrikeoutSize ),
FT_FRAME_SHORT ( yStrikeoutPosition ),
FT_FRAME_SHORT ( sFamilyClass ),
FT_FRAME_BYTE ( panose[0] ),
FT_FRAME_BYTE ( panose[1] ),
FT_FRAME_BYTE ( panose[2] ),
FT_FRAME_BYTE ( panose[3] ),
FT_FRAME_BYTE ( panose[4] ),
FT_FRAME_BYTE ( panose[5] ),
FT_FRAME_BYTE ( panose[6] ),
FT_FRAME_BYTE ( panose[7] ),
FT_FRAME_BYTE ( panose[8] ),
FT_FRAME_BYTE ( panose[9] ),
FT_FRAME_ULONG ( ulUnicodeRange1 ),
FT_FRAME_ULONG ( ulUnicodeRange2 ),
FT_FRAME_ULONG ( ulUnicodeRange3 ),
FT_FRAME_ULONG ( ulUnicodeRange4 ),
FT_FRAME_BYTE ( achVendID[0] ),
FT_FRAME_BYTE ( achVendID[1] ),
FT_FRAME_BYTE ( achVendID[2] ),
FT_FRAME_BYTE ( achVendID[3] ),
FT_FRAME_USHORT( fsSelection ),
FT_FRAME_USHORT( usFirstCharIndex ),
FT_FRAME_USHORT( usLastCharIndex ),
FT_FRAME_SHORT ( sTypoAscender ),
FT_FRAME_SHORT ( sTypoDescender ),
FT_FRAME_SHORT ( sTypoLineGap ),
FT_FRAME_USHORT( usWinAscent ),
FT_FRAME_USHORT( usWinDescent ),
FT_FRAME_END
};
const FT_Frame_Field os2_fields_extra[] =
{
FT_FRAME_START( 8 ),
FT_FRAME_ULONG( ulCodePageRange1 ),
FT_FRAME_ULONG( ulCodePageRange2 ),
FT_FRAME_END
};
const FT_Frame_Field os2_fields_extra2[] =
{
FT_FRAME_START( 10 ),
FT_FRAME_SHORT ( sxHeight ),
FT_FRAME_SHORT ( sCapHeight ),
FT_FRAME_USHORT( usDefaultChar ),
FT_FRAME_USHORT( usBreakChar ),
FT_FRAME_USHORT( usMaxContext ),
FT_FRAME_END
};
/* We now support old Mac fonts where the OS/2 table doesn't */
/* exist. Simply put, we set the `version' field to 0xFFFF */
/* and test this value each time we need to access the table. */
error = face->goto_table( face, TTAG_OS2, stream, 0 );
if ( error )
goto Exit;
os2 = &face->os2;
if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )
goto Exit;
os2->ulCodePageRange1 = 0;
os2->ulCodePageRange2 = 0;
os2->sxHeight = 0;
os2->sCapHeight = 0;
os2->usDefaultChar = 0;
os2->usBreakChar = 0;
os2->usMaxContext = 0;
if ( os2->version >= 0x0001 )
{
/* only version 1 tables */
if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) )
goto Exit;
if ( os2->version >= 0x0002 )
{
/* only version 2 tables */
if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )
goto Exit;
}
}
FT_TRACE3(( "sTypoAscender: %4d\n", os2->sTypoAscender ));
FT_TRACE3(( "sTypoDescender: %4d\n", os2->sTypoDescender ));
FT_TRACE3(( "usWinAscent: %4u\n", os2->usWinAscent ));
FT_TRACE3(( "usWinDescent: %4u\n", os2->usWinDescent ));
FT_TRACE3(( "fsSelection: 0x%2x\n", os2->fsSelection ));
Exit:
return error;
}
示例14: tt_face_load_maxp
tt_face_load_maxp( TT_Face face,
FT_Stream stream )
{
FT_Error error;
TT_MaxProfile* maxProfile = &face->max_profile;
const FT_Frame_Field maxp_fields[] =
{
#undef FT_STRUCTURE
#define FT_STRUCTURE TT_MaxProfile
FT_FRAME_START( 6 ),
FT_FRAME_LONG ( version ),
FT_FRAME_USHORT( numGlyphs ),
FT_FRAME_END
};
const FT_Frame_Field maxp_fields_extra[] =
{
FT_FRAME_START( 26 ),
FT_FRAME_USHORT( maxPoints ),
FT_FRAME_USHORT( maxContours ),
FT_FRAME_USHORT( maxCompositePoints ),
FT_FRAME_USHORT( maxCompositeContours ),
FT_FRAME_USHORT( maxZones ),
FT_FRAME_USHORT( maxTwilightPoints ),
FT_FRAME_USHORT( maxStorage ),
FT_FRAME_USHORT( maxFunctionDefs ),
FT_FRAME_USHORT( maxInstructionDefs ),
FT_FRAME_USHORT( maxStackElements ),
FT_FRAME_USHORT( maxSizeOfInstructions ),
FT_FRAME_USHORT( maxComponentElements ),
FT_FRAME_USHORT( maxComponentDepth ),
FT_FRAME_END
};
error = face->goto_table( face, TTAG_maxp, stream, 0 );
if ( error )
goto Exit;
if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) )
goto Exit;
maxProfile->maxPoints = 0;
maxProfile->maxContours = 0;
maxProfile->maxCompositePoints = 0;
maxProfile->maxCompositeContours = 0;
maxProfile->maxZones = 0;
maxProfile->maxTwilightPoints = 0;
maxProfile->maxStorage = 0;
maxProfile->maxFunctionDefs = 0;
maxProfile->maxInstructionDefs = 0;
maxProfile->maxStackElements = 0;
maxProfile->maxSizeOfInstructions = 0;
maxProfile->maxComponentElements = 0;
maxProfile->maxComponentDepth = 0;
if ( maxProfile->version >= 0x10000L )
{
if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) )
goto Exit;
/* XXX: an adjustment that is necessary to load certain */
/* broken fonts like `Keystrokes MT' :-( */
/* */
/* We allocate 64 function entries by default when */
/* the maxFunctionDefs field is null. */
if ( maxProfile->maxFunctionDefs == 0 )
maxProfile->maxFunctionDefs = 64;
/* we add 4 phantom points later */
if ( maxProfile->maxTwilightPoints > ( 0xFFFFU - 4 ) )
{
FT_TRACE0(( "tt_face_load_maxp:"
" too much twilight points in `maxp' table;\n"
" "
" some glyphs might be rendered incorrectly\n" ));
maxProfile->maxTwilightPoints = 0xFFFFU - 4;
}
}
FT_TRACE3(( "numGlyphs: %u\n", maxProfile->numGlyphs ));
Exit:
return error;
}
示例15: otv_GDEF_validate
otv_GDEF_validate( FT_Bytes table,
FT_Bytes gsub,
FT_Bytes gpos,
FT_UInt glyph_count,
FT_Validator ftvalid )
{
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt table_size;
FT_UShort version;
FT_Bool need_MarkAttachClassDef = 1;
OTV_OPTIONAL_TABLE( GlyphClassDef );
OTV_OPTIONAL_TABLE( AttachListOffset );
OTV_OPTIONAL_TABLE( LigCaretListOffset );
OTV_OPTIONAL_TABLE( MarkAttachClassDef );
OTV_OPTIONAL_TABLE( MarkGlyphSetsDef );
OTV_OPTIONAL_TABLE32( itemVarStore );
otvalid->root = ftvalid;
FT_TRACE3(( "validating GDEF table\n" ));
OTV_INIT;
OTV_LIMIT_CHECK( 4 );
if ( FT_NEXT_USHORT( p ) != 1 ) /* majorVersion */
FT_INVALID_FORMAT;
version = FT_NEXT_USHORT( p ); /* minorVersion */
table_size = 10;
switch ( version )
{
case 0:
/* MarkAttachClassDef has been added to the OpenType */
/* specification without increasing GDEF's version, */
/* so we use this ugly hack to find out whether the */
/* table is needed actually. */
need_MarkAttachClassDef = FT_BOOL(
otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) ||
otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) );
if ( need_MarkAttachClassDef )
{
OTV_LIMIT_CHECK( 8 );
table_size += 2;
}
else
OTV_LIMIT_CHECK( 6 ); /* OpenType < 1.2 */
break;
case 2:
OTV_LIMIT_CHECK( 10 );
table_size += 4;
break;
case 3:
OTV_LIMIT_CHECK( 14 );
table_size += 8;
break;
default:
FT_INVALID_FORMAT;
}
otvalid->glyph_count = glyph_count;
OTV_OPTIONAL_OFFSET( GlyphClassDef );
OTV_SIZE_CHECK( GlyphClassDef );
if ( GlyphClassDef )
otv_ClassDef_validate( table + GlyphClassDef, otvalid );
OTV_OPTIONAL_OFFSET( AttachListOffset );
OTV_SIZE_CHECK( AttachListOffset );
if ( AttachListOffset )
{
OTV_NEST2( AttachList, AttachPoint );
OTV_RUN( table + AttachListOffset, otvalid );
}
OTV_OPTIONAL_OFFSET( LigCaretListOffset );
OTV_SIZE_CHECK( LigCaretListOffset );
if ( LigCaretListOffset )
{
OTV_NEST3( LigCaretList, LigGlyph, CaretValue );
OTV_RUN( table + LigCaretListOffset, otvalid );
}
if ( need_MarkAttachClassDef )
{
OTV_OPTIONAL_OFFSET( MarkAttachClassDef );
OTV_SIZE_CHECK( MarkAttachClassDef );
if ( MarkAttachClassDef )
otv_ClassDef_validate( table + MarkAttachClassDef, otvalid );
//.........这里部分代码省略.........