glyf.h 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (c) 2009-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. #ifndef OTS_GLYF_H_
  5. #define OTS_GLYF_H_
  6. #include <new>
  7. #include <utility>
  8. #include <vector>
  9. #include "ots.h"
  10. namespace ots {
  11. class OpenTypeMAXP;
  12. class OpenTypeGLYF : public Table {
  13. public:
  14. explicit OpenTypeGLYF(Font *font, uint32_t tag)
  15. : Table(font, tag, tag), maxp(NULL) { }
  16. bool Parse(const uint8_t *data, size_t length);
  17. bool Serialize(OTSStream *out);
  18. private:
  19. bool ParseFlagsForSimpleGlyph(Buffer &glyph,
  20. uint32_t num_flags,
  21. uint32_t *flag_index,
  22. uint32_t *coordinates_length);
  23. bool ParseSimpleGlyph(Buffer &glyph, int16_t num_contours);
  24. bool ParseCompositeGlyph(Buffer &glyph);
  25. OpenTypeMAXP* maxp;
  26. std::vector<std::pair<const uint8_t*, size_t> > iov;
  27. };
  28. } // namespace ots
  29. #endif // OTS_GLYF_H_