math_.h (2813B)
1 // Copyright (c) 2014-2017 The OTS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef OTS_MATH_H_ 6 #define OTS_MATH_H_ 7 8 #include "ots.h" 9 10 namespace ots { 11 12 class OpenTypeMATH : public Table { 13 public: 14 explicit OpenTypeMATH(Font *font, uint32_t tag) 15 : Table(font, tag, tag), 16 m_data(NULL), 17 m_length(0) { } 18 19 bool Parse(const uint8_t *data, size_t length); 20 bool Serialize(OTSStream *out); 21 bool ShouldSerialize(); 22 23 private: 24 bool ParseMathValueRecord(ots::Buffer* subtable, 25 const uint8_t *data, 26 const size_t length); 27 bool ParseMathConstantsTable(const uint8_t *data, size_t length); 28 bool ParseMathValueRecordSequenceForGlyphs(ots::Buffer* subtable, 29 const uint8_t *data, 30 const size_t length, 31 const uint16_t num_glyphs); 32 bool ParseMathItalicsCorrectionInfoTable(const uint8_t *data, 33 size_t length, 34 const uint16_t num_glyphs); 35 bool ParseMathTopAccentAttachmentTable(const uint8_t *data, 36 size_t length, 37 const uint16_t num_glyphs); 38 bool ParseMathKernTable(const uint8_t *data, size_t length); 39 bool ParseMathKernInfoTable(const uint8_t *data, 40 size_t length, 41 const uint16_t num_glyphs); 42 bool ParseMathGlyphInfoTable(const uint8_t *data, 43 size_t length, 44 const uint16_t num_glyphs); 45 bool ParseGlyphAssemblyTable(const uint8_t *data, 46 size_t length, 47 const uint16_t num_glyphs); 48 bool ParseMathGlyphConstructionTable(const uint8_t *data, 49 size_t length, 50 const uint16_t num_glyphs); 51 bool ParseMathGlyphConstructionSequence(ots::Buffer* subtable, 52 const uint8_t *data, 53 size_t length, 54 const uint16_t num_glyphs, 55 uint16_t offset_coverage, 56 uint16_t glyph_count, 57 const unsigned sequence_end); 58 bool ParseMathVariantsTable(const uint8_t *data, 59 size_t length, 60 const uint16_t num_glyphs); 61 62 const uint8_t *m_data; 63 size_t m_length; 64 }; 65 66 } // namespace ots 67 68 #endif