[kerx] Start fleshing out Format6

This commit is contained in:
Behdad Esfahbod 2018-10-10 19:58:20 -04:00
parent f6aaad9b4f
commit 22955b23cd
2 changed files with 36 additions and 9 deletions

View File

@ -225,6 +225,13 @@ struct KerxSubTableFormat4
struct KerxSubTableFormat6 struct KerxSubTableFormat6
{ {
enum Flags
{
ValuesAreLong = 0x00000001,
};
inline bool is_long (void) const { return flags & ValuesAreLong; }
inline bool apply (hb_aat_apply_context_t *c) const inline bool apply (hb_aat_apply_context_t *c) const
{ {
TRACE_APPLY (this); TRACE_APPLY (this);
@ -241,10 +248,16 @@ struct KerxSubTableFormat6
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) && return_trace (likely (c->check_struct (this) &&
rowIndexTable.sanitize (c, this) && is_long () ?
columnIndexTable.sanitize (c, this) && (
kerningArray.sanitize (c, this) && u.l.rowIndexTable.sanitize (c, this) &&
kerningVector.sanitize (c, this))); u.l.columnIndexTable.sanitize (c, this) &&
u.l.kerningArray.sanitize (c, this)
) : (
u.s.rowIndexTable.sanitize (c, this) &&
u.s.columnIndexTable.sanitize (c, this) &&
u.s.kerningArray.sanitize (c, this)
)));
} }
protected: protected:
@ -252,12 +265,23 @@ struct KerxSubTableFormat6
HBUINT32 flags; HBUINT32 flags;
HBUINT16 rowCount; HBUINT16 rowCount;
HBUINT16 columnCount; HBUINT16 columnCount;
LOffsetTo<Lookup<HBUINT16> > rowIndexTable; union
LOffsetTo<Lookup<HBUINT16> > columnIndexTable; {
LOffsetTo<Lookup<HBUINT16> > kerningArray; struct
LOffsetTo<Lookup<HBUINT16> > kerningVector; {
LOffsetTo<Lookup<HBUINT16> > rowIndexTable;
LOffsetTo<Lookup<HBUINT16> > columnIndexTable;
LOffsetTo<FWORD> kerningArray;
} s;
struct
{
LOffsetTo<Lookup<HBUINT32> > rowIndexTable;
LOffsetTo<Lookup<HBUINT32> > columnIndexTable;
LOffsetTo<FWORD32> kerningArray;
} l;
} u;
public: public:
DEFINE_SIZE_STATIC (36); DEFINE_SIZE_STATIC (32);
}; };
struct KerxTable struct KerxTable

View File

@ -92,6 +92,9 @@ typedef IntType<uint32_t, 3> HBUINT24; /* 24-bit unsigned integer. */
/* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */ /* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */
typedef HBINT16 FWORD; typedef HBINT16 FWORD;
/* 32-bit signed integer (HBINT32) that describes a quantity in FUnits. */
typedef HBINT32 FWORD32;
/* 16-bit unsigned integer (HBUINT16) that describes a quantity in FUnits. */ /* 16-bit unsigned integer (HBUINT16) that describes a quantity in FUnits. */
typedef HBUINT16 UFWORD; typedef HBUINT16 UFWORD;