[kern] Implement format-2 kern subtable

This commit is contained in:
Behdad Esfahbod 2017-11-06 15:40:07 -05:00
parent 82a38d1f7a
commit a615030683
1 changed files with 7 additions and 1 deletions

View File

@ -116,7 +116,13 @@ struct KernSubTableFormat2
{ {
unsigned int l = (this+leftClassTable).get_class (left); unsigned int l = (this+leftClassTable).get_class (left);
unsigned int r = (this+leftClassTable).get_class (left); unsigned int r = (this+leftClassTable).get_class (left);
return 0;//(&(this+array))[0/*XXX*/]; unsigned int offset = l * rowWidth + r * sizeof (FWORD);
const FWORD *v = &StructAtOffset<FWORD> (&(this+array), offset);
/* Untested code, as I have not been able to find ANY kern table format-2 yet. */
assert (&(this+array) <= v);
if (unlikely (v + 1 > (const FWORD *) end))
return 0;
return *v;
} }
inline bool sanitize (hb_sanitize_context_t *c) const inline bool sanitize (hb_sanitize_context_t *c) const