未验证 提交 211da5ef 编写于 作者: E Ebrahim Byagowi 提交者: GitHub

[aat] Cosmetic changes (#964)

上级 f8bb582b
...@@ -52,10 +52,10 @@ struct gcid ...@@ -52,10 +52,10 @@ struct gcid
HBUINT16 format; /* Data format (set to 0) */ HBUINT16 format; /* Data format (set to 0) */
HBUINT32 size; /* Size of the table, including header */ HBUINT32 size; /* Size of the table, including header */
HBUINT16 registry; /* The registry ID */ HBUINT16 registry; /* The registry ID */
uint8_t registryName[64]; HBUINT8 registryName[64];
/* The registry name in ASCII */ /* The registry name in ASCII */
HBUINT16 order; /* The order ID */ HBUINT16 order; /* The order ID */
uint8_t orderName[64]; /* The order name in ASCII */ HBUINT8 orderName[64]; /* The order name in ASCII */
HBUINT16 supplementVersion; HBUINT16 supplementVersion;
/* The supplement version */ /* The supplement version */
ArrayOf<HBUINT16> ArrayOf<HBUINT16>
......
...@@ -64,11 +64,12 @@ struct ankr ...@@ -64,11 +64,12 @@ struct ankr
} }
protected: protected:
HBUINT16 version; /* Version number (set to zero) */ HBUINT16 version; /* Version number (set to zero) */
HBUINT16 flags; /* Flags (currently unused; set to zero) */ HBUINT16 flags; /* Flags (currently unused; set to zero) */
LOffsetTo<Lookup<HBUINT16> > lookupTable; /* Offset to the table's lookup table */ LOffsetTo<Lookup<HBUINT16> >
LOffsetTo<ArrayOf<Anchor, HBUINT32> > lookupTable; /* Offset to the table's lookup table */
anchors; /* Offset to the glyph data table */ LOffsetTo<LArrayOf<Anchor> >
anchors; /* Offset to the glyph data table */
public: public:
DEFINE_SIZE_STATIC (12); DEFINE_SIZE_STATIC (12);
......
...@@ -511,11 +511,11 @@ struct StateTable ...@@ -511,11 +511,11 @@ struct StateTable
protected: protected:
HBUINT32 nClasses; /* Number of classes, which is the number of indices HBUINT32 nClasses; /* Number of classes, which is the number of indices
* in a single line in the state array. */ * in a single line in the state array. */
OffsetTo<Lookup<HBUINT16>, HBUINT32> LOffsetTo<Lookup<HBUINT16> >
classTable; /* Offset to the class table. */ classTable; /* Offset to the class table. */
OffsetTo<UnsizedArrayOf<HBUINT16>, HBUINT32> LOffsetTo<UnsizedArrayOf<HBUINT16> >
stateArrayTable;/* Offset to the state array. */ stateArrayTable;/* Offset to the state array. */
OffsetTo<UnsizedArrayOf<Entry<Extra> >, HBUINT32> LOffsetTo<UnsizedArrayOf<Entry<Extra> > >
entryTable; /* Offset to the entry array. */ entryTable; /* Offset to the entry array. */
public: public:
......
...@@ -71,21 +71,22 @@ struct KerxSubTableFormat0 ...@@ -71,21 +71,22 @@ struct KerxSubTableFormat0
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && return_trace (c->check_struct (this) &&
c->check_array (records, records[0].static_size, nPairs)); recordsZ.sanitize (c, nPairs));
} }
protected: protected:
// TODO(ebraminio): A custom version of "BinSearchArrayOf<KerxPair> pairs;" is // TODO(ebraminio): A custom version of "BinSearchArrayOf<KerxPair> pairs;" is
// needed here to use HBUINT32 instead // needed here to use HBUINT32 instead
HBUINT32 nPairs; /* The number of kerning pairs in this subtable */ 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, 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. */ * 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 HBUINT32 entrySelector; /* This is calculated as log2 of the largest power of two less
* than or equal to the value of nPairs. */ * 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. */ HBUINT32 rangeShift; /* The value of nPairs minus the largest power of two less than or equal to nPairs. */
KerxFormat0Records records[VAR]; /* VAR=nPairs */ UnsizedArrayOf<KerxFormat0Records>
recordsZ; /* VAR=nPairs */
public: public:
DEFINE_SIZE_ARRAY (16, records); DEFINE_SIZE_ARRAY (16, recordsZ);
}; };
struct KerxSubTableFormat1 struct KerxSubTableFormat1
...@@ -94,7 +95,7 @@ struct KerxSubTableFormat1 ...@@ -94,7 +95,7 @@ struct KerxSubTableFormat1
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && return_trace (c->check_struct (this) &&
stateHeader.sanitize (c)); stateHeader.sanitize (c));
} }
protected: protected:
...@@ -196,10 +197,10 @@ struct KerxSubTableFormat6 ...@@ -196,10 +197,10 @@ struct KerxSubTableFormat6
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (c->check_struct (this) && return_trace (c->check_struct (this) &&
rowIndexTable.sanitize (c, this) && rowIndexTable.sanitize (c, this) &&
columnIndexTable.sanitize (c, this) && columnIndexTable.sanitize (c, this) &&
kerningArray.sanitize (c, this) && kerningArray.sanitize (c, this) &&
kerningVector.sanitize (c, this)); kerningVector.sanitize (c, this));
} }
protected: protected:
......
...@@ -462,11 +462,11 @@ struct LigatureSubtable ...@@ -462,11 +462,11 @@ struct LigatureSubtable
protected: protected:
StateTable<EntryData> machine; StateTable<EntryData> machine;
OffsetTo<UnsizedArrayOf<HBUINT32>, HBUINT32> LOffsetTo<UnsizedArrayOf<HBUINT32> >
ligAction; /* Offset to the ligature action table. */ ligAction; /* Offset to the ligature action table. */
OffsetTo<UnsizedArrayOf<HBUINT16>, HBUINT32> LOffsetTo<UnsizedArrayOf<HBUINT16> >
component; /* Offset to the component table. */ component; /* Offset to the component table. */
OffsetTo<UnsizedArrayOf<GlyphID>, HBUINT32> LOffsetTo<UnsizedArrayOf<GlyphID> >
ligature; /* Offset to the actual ligature lists. */ ligature; /* Offset to the actual ligature lists. */
public: public:
DEFINE_SIZE_STATIC (28); DEFINE_SIZE_STATIC (28);
......
...@@ -122,12 +122,12 @@ struct TrackData ...@@ -122,12 +122,12 @@ struct TrackData
} }
protected: protected:
HBUINT16 nTracks; /* Number of separate tracks included in this table. */ HBUINT16 nTracks; /* Number of separate tracks included in this table. */
HBUINT16 nSizes; /* Number of point sizes included in this table. */ HBUINT16 nSizes; /* Number of point sizes included in this table. */
LOffsetTo<UnsizedArrayOf<Fixed> > /* Offset to array[nSizes] of size values. */ LOffsetTo<UnsizedArrayOf<Fixed> >
sizeTable; sizeTable; /* Offset to array[nSizes] of size values. */
UnsizedArrayOf<TrackTableEntry> UnsizedArrayOf<TrackTableEntry>
trackTable; /* Array[nTracks] of TrackTableEntry records. */ trackTable; /* Array[nTracks] of TrackTableEntry records. */
public: public:
DEFINE_SIZE_ARRAY (8, trackTable); DEFINE_SIZE_ARRAY (8, trackTable);
......
...@@ -37,14 +37,14 @@ struct FTStringRange ...@@ -37,14 +37,14 @@ struct FTStringRange
inline bool sanitize (hb_sanitize_context_t *c, const void *base) const inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
{ {
TRACE_SANITIZE (this); 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: protected:
OffsetTo<UnsizedArrayOf<HBUINT8> > OffsetTo<UnsizedArrayOf<HBUINT8> >
tag; /* Offset from the start of the table to tag; /* Offset from the start of the table to
* the beginning of the string */ * the beginning of the string */
HBUINT16 length; /* String length (in bytes) */ HBUINT16 length; /* String length (in bytes) */
public: public:
DEFINE_SIZE_STATIC (4); DEFINE_SIZE_STATIC (4);
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册