[aat] Cosmetic changes (#964)

This commit is contained in:
Ebrahim Byagowi 2018-04-11 17:41:24 +04:30 committed by GitHub
parent f8bb582bcc
commit 211da5efdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 36 deletions

View File

@ -52,10 +52,10 @@ struct gcid
HBUINT16 format; /* Data format (set to 0) */
HBUINT32 size; /* Size of the table, including header */
HBUINT16 registry; /* The registry ID */
uint8_t registryName[64];
HBUINT8 registryName[64];
/* The registry name in ASCII */
HBUINT16 order; /* The order ID */
uint8_t orderName[64]; /* The order name in ASCII */
HBUINT8 orderName[64]; /* The order name in ASCII */
HBUINT16 supplementVersion;
/* The supplement version */
ArrayOf<HBUINT16>

View File

@ -64,11 +64,12 @@ struct ankr
}
protected:
HBUINT16 version; /* Version number (set to zero) */
HBUINT16 flags; /* Flags (currently unused; set to zero) */
LOffsetTo<Lookup<HBUINT16> > lookupTable; /* Offset to the table's lookup table */
LOffsetTo<ArrayOf<Anchor, HBUINT32> >
anchors; /* Offset to the glyph data table */
HBUINT16 version; /* Version number (set to zero) */
HBUINT16 flags; /* Flags (currently unused; set to zero) */
LOffsetTo<Lookup<HBUINT16> >
lookupTable; /* Offset to the table's lookup table */
LOffsetTo<LArrayOf<Anchor> >
anchors; /* Offset to the glyph data table */
public:
DEFINE_SIZE_STATIC (12);

View File

@ -511,11 +511,11 @@ struct StateTable
protected:
HBUINT32 nClasses; /* Number of classes, which is the number of indices
* in a single line in the state array. */
OffsetTo<Lookup<HBUINT16>, HBUINT32>
LOffsetTo<Lookup<HBUINT16> >
classTable; /* Offset to the class table. */
OffsetTo<UnsizedArrayOf<HBUINT16>, HBUINT32>
LOffsetTo<UnsizedArrayOf<HBUINT16> >
stateArrayTable;/* Offset to the state array. */
OffsetTo<UnsizedArrayOf<Entry<Extra> >, HBUINT32>
LOffsetTo<UnsizedArrayOf<Entry<Extra> > >
entryTable; /* Offset to the entry array. */
public:

View File

@ -71,21 +71,22 @@ struct KerxSubTableFormat0
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
c->check_array (records, records[0].static_size, nPairs));
recordsZ.sanitize (c, nPairs));
}
protected:
// TODO(ebraminio): A custom version of "BinSearchArrayOf<KerxPair> pairs;" is
// needed here to use HBUINT32 instead
HBUINT32 nPairs; /* The number of kerning pairs in this subtable */
HBUINT32 searchRange; /* The largest power of two less than or equal to the value of nPairs,
* multiplied by the size in bytes of an entry in the subtable. */
HBUINT32 entrySelector; /* This is calculated as log2 of the largest power of two less
* than or equal to the value of nPairs. */
HBUINT32 rangeShift; /* The value of nPairs minus the largest power of two less than or equal to nPairs. */
KerxFormat0Records records[VAR]; /* VAR=nPairs */
HBUINT32 nPairs; /* The number of kerning pairs in this subtable */
HBUINT32 searchRange; /* The largest power of two less than or equal to the value of nPairs,
* multiplied by the size in bytes of an entry in the subtable. */
HBUINT32 entrySelector; /* This is calculated as log2 of the largest power of two less
* than or equal to the value of nPairs. */
HBUINT32 rangeShift; /* The value of nPairs minus the largest power of two less than or equal to nPairs. */
UnsizedArrayOf<KerxFormat0Records>
recordsZ; /* VAR=nPairs */
public:
DEFINE_SIZE_ARRAY (16, records);
DEFINE_SIZE_ARRAY (16, recordsZ);
};
struct KerxSubTableFormat1
@ -94,7 +95,7 @@ struct KerxSubTableFormat1
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
stateHeader.sanitize (c));
stateHeader.sanitize (c));
}
protected:
@ -196,10 +197,10 @@ struct KerxSubTableFormat6
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) &&
rowIndexTable.sanitize (c, this) &&
columnIndexTable.sanitize (c, this) &&
kerningArray.sanitize (c, this) &&
kerningVector.sanitize (c, this));
rowIndexTable.sanitize (c, this) &&
columnIndexTable.sanitize (c, this) &&
kerningArray.sanitize (c, this) &&
kerningVector.sanitize (c, this));
}
protected:

View File

@ -462,11 +462,11 @@ struct LigatureSubtable
protected:
StateTable<EntryData> machine;
OffsetTo<UnsizedArrayOf<HBUINT32>, HBUINT32>
LOffsetTo<UnsizedArrayOf<HBUINT32> >
ligAction; /* Offset to the ligature action table. */
OffsetTo<UnsizedArrayOf<HBUINT16>, HBUINT32>
LOffsetTo<UnsizedArrayOf<HBUINT16> >
component; /* Offset to the component table. */
OffsetTo<UnsizedArrayOf<GlyphID>, HBUINT32>
LOffsetTo<UnsizedArrayOf<GlyphID> >
ligature; /* Offset to the actual ligature lists. */
public:
DEFINE_SIZE_STATIC (28);

View File

@ -122,12 +122,12 @@ struct TrackData
}
protected:
HBUINT16 nTracks; /* Number of separate tracks included in this table. */
HBUINT16 nSizes; /* Number of point sizes included in this table. */
LOffsetTo<UnsizedArrayOf<Fixed> > /* Offset to array[nSizes] of size values. */
sizeTable;
HBUINT16 nTracks; /* Number of separate tracks included in this table. */
HBUINT16 nSizes; /* Number of point sizes included in this table. */
LOffsetTo<UnsizedArrayOf<Fixed> >
sizeTable; /* Offset to array[nSizes] of size values. */
UnsizedArrayOf<TrackTableEntry>
trackTable; /* Array[nTracks] of TrackTableEntry records. */
trackTable; /* Array[nTracks] of TrackTableEntry records. */
public:
DEFINE_SIZE_ARRAY (8, trackTable);

View File

@ -37,14 +37,14 @@ struct FTStringRange
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && tag (base).sanitize (c, length));
return_trace (c->check_struct (this) && (base+tag).sanitize (c, length));
}
protected:
OffsetTo<UnsizedArrayOf<HBUINT8> >
tag; /* Offset from the start of the table to
* the beginning of the string */
HBUINT16 length; /* String length (in bytes) */
tag; /* Offset from the start of the table to
* the beginning of the string */
HBUINT16 length; /* String length (in bytes) */
public:
DEFINE_SIZE_STATIC (4);
};