diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-24 14:24:24 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-24 14:24:24 +0000 |
commit | ad5a13bd501e379517da1a944c104a11d951a3f5 (patch) | |
tree | d8f1c83626aeb3f60f1e69ac63ae58afb3ef0302 /gfx/ots/src/glyf.h | |
parent | 5587b6bf1af29552e102b23cfc8c602bf8728894 (diff) | |
download | UXP-ad5a13bd501e379517da1a944c104a11d951a3f5.tar UXP-ad5a13bd501e379517da1a944c104a11d951a3f5.tar.gz UXP-ad5a13bd501e379517da1a944c104a11d951a3f5.tar.lz UXP-ad5a13bd501e379517da1a944c104a11d951a3f5.tar.xz UXP-ad5a13bd501e379517da1a944c104a11d951a3f5.zip |
[OTS] Backport some upstream OTS commits.
Diffstat (limited to 'gfx/ots/src/glyf.h')
-rw-r--r-- | gfx/ots/src/glyf.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gfx/ots/src/glyf.h b/gfx/ots/src/glyf.h index 1da94e4b9..08c585df3 100644 --- a/gfx/ots/src/glyf.h +++ b/gfx/ots/src/glyf.h @@ -23,12 +23,38 @@ class OpenTypeGLYF : public Table { bool Serialize(OTSStream *out); private: + struct GidAtLevel { + uint16_t gid; + uint32_t level; + }; + + struct ComponentPointCount { + ComponentPointCount() : accumulated_component_points(0) {}; + uint32_t accumulated_component_points; + std::vector<GidAtLevel> gid_stack; + }; + bool ParseFlagsForSimpleGlyph(Buffer &glyph, uint32_t num_flags, uint32_t *flag_index, uint32_t *coordinates_length); bool ParseSimpleGlyph(Buffer &glyph, int16_t num_contours); - bool ParseCompositeGlyph(Buffer &glyph); + bool ParseCompositeGlyph( + Buffer &glyph, + ComponentPointCount* component_point_count); + + + bool TraverseComponentsCountingPoints( + Buffer& glyph, + uint16_t base_glyph_id, + uint32_t level, + ComponentPointCount* component_point_count); + + Buffer GetGlyphBufferSection( + const uint8_t *data, + size_t length, + const std::vector<uint32_t>& loca_offsets, + unsigned glyph_id); OpenTypeMAXP* maxp; |