diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2018-01-10 11:09:53 +0100 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2018-01-10 13:58:41 +0100 |
commit | 80fd5743200cbe221ae3adf057fe0e5ef54a894c (patch) | |
tree | f6b3a7b23062f327d8601d62b67a874ac6a78d86 | |
parent | 71e0ed9cbad8438239dcedf1bcfa8e19b9dfdc89 (diff) | |
download | harfbuzz-80fd5743200cbe221ae3adf057fe0e5ef54a894c.tar.gz |
[aat] Add Class subtable thingy
From old 'mort' table.
-rw-r--r-- | src/hb-aat-layout-common-private.hh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/hb-aat-layout-common-private.hh b/src/hb-aat-layout-common-private.hh index c3058682..4b96ee6c 100644 --- a/src/hb-aat-layout-common-private.hh +++ b/src/hb-aat-layout-common-private.hh @@ -424,6 +424,30 @@ struct Lookup }; +struct Class +{ + inline unsigned int get_class (hb_codepoint_t glyph_id) const + { + return firstGlyph <= glyph_id && glyph_id - firstGlyph < glyphCount ? classArrayZ[glyph_id - firstGlyph] : 1; + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && classArrayZ.sanitize (c, glyphCount)); + } + + protected: + GlyphID firstGlyph; /* First glyph index included in the trimmed array. */ + HBUINT16 glyphCount; /* Total number of glyphs (equivalent to the last + * glyph minus the value of firstGlyph plus 1). */ + UnsizedArrayOf<HBUINT8> + classArrayZ; /* The class codes (indexed by glyph index minus + * firstGlyph). */ + public: + DEFINE_SIZE_ARRAY (4, classArrayZ); +}; + } /* namespace AAT */ |