Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
fixes problems with TTCs from the TTCs speed optimization.
Browse files Browse the repository at this point in the history
Some TTCs only have CFF's (e.g. Noto),
and some others have non-uniform set of tables across members
e.g. wqy-zenhei.ttc - only one member has EBDT/EBLC tables

plus cosmetic change.

typo
  • Loading branch information
HinTak committed Jul 20, 2017
1 parent 391d23e commit dd4d37b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions OTFontFileVal/OTFontVal.cs
Expand Up @@ -220,7 +220,7 @@ public bool Validate()
// rasterization test - BW

v.OnRastTestValidationEvent_BW(true);
if ( Is_TTC_LaterIdenticalTable("glyf") )
if ( v.PeformRastTest_BW() && Is_TTC_LaterIdenticalTable("glyf") )
{
v.Info(T.T_NULL, I.glyf_I_IDENTICAL_GLYF_TABLES_IN_TTC, null, "B/W Rasterization");
}
Expand Down Expand Up @@ -278,7 +278,7 @@ public bool Validate()
// rasterization test - Grayscale

v.OnRastTestValidationEvent_Grayscale(true);
if ( Is_TTC_LaterIdenticalTable("glyf") )
if ( v.PeformRastTest_Grayscale() && Is_TTC_LaterIdenticalTable("glyf") )
{
v.Info(T.T_NULL, I.glyf_I_IDENTICAL_GLYF_TABLES_IN_TTC, null, "Grayscale Rasterization");
}
Expand Down Expand Up @@ -337,7 +337,7 @@ public bool Validate()
// rasterization test - Cleartype

v.OnRastTestValidationEvent_Cleartype(true);
if ( Is_TTC_LaterIdenticalTable("glyf") )
if ( v.PeformRastTest_Cleartype() && Is_TTC_LaterIdenticalTable("glyf") )
{
v.Info(T.T_NULL, I.glyf_I_IDENTICAL_GLYF_TABLES_IN_TTC, null, "Cleartype Rasterization");
}
Expand Down Expand Up @@ -1232,8 +1232,13 @@ protected bool Is_TTC_LaterIdenticalTable(string s)
{
// checksum not matching data is covered by check elsewhere. Assume they match.
DirectoryEntry de_current = GetDirectoryEntry(s);
if ( de_current == null )
return false;
for ( uint i = 0 ; i < GetFontIndexInFile() ; i++ )
{
if ( GetFile().GetFont(i).GetDirectoryEntry(s) == null )
return false;

if ( GetFile().GetFont(i).GetDirectoryEntry(s).checkSum
== de_current.checkSum )
{
Expand Down

0 comments on commit dd4d37b

Please sign in to comment.