diff options
Diffstat (limited to 'gfx/ots/src/cmap.h')
-rw-r--r-- | gfx/ots/src/cmap.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gfx/ots/src/cmap.h b/gfx/ots/src/cmap.h index 5b09556b7..feddbc696 100644 --- a/gfx/ots/src/cmap.h +++ b/gfx/ots/src/cmap.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2009-2017 The OTS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -35,9 +35,11 @@ struct OpenTypeCMAPSubtableVSRecord { std::vector<OpenTypeCMAPSubtableVSMapping> mappings; }; -struct OpenTypeCMAP { - OpenTypeCMAP() - : subtable_0_3_4_data(NULL), +class OpenTypeCMAP : public Table { + public: + explicit OpenTypeCMAP(Font *font, uint32_t tag) + : Table(font, tag, tag), + subtable_0_3_4_data(NULL), subtable_0_3_4_length(0), subtable_0_5_14_length(0), subtable_3_0_4_data(NULL), @@ -46,6 +48,10 @@ struct OpenTypeCMAP { subtable_3_1_4_length(0) { } + bool Parse(const uint8_t *data, size_t length); + bool Serialize(OTSStream *out); + + private: // Platform 0, Encoding 3, Format 4, Unicode BMP table. const uint8_t *subtable_0_3_4_data; size_t subtable_0_3_4_length; @@ -67,6 +73,13 @@ struct OpenTypeCMAP { std::vector<OpenTypeCMAPSubtableRange> subtable_3_10_13; // Platform 1, Encoding 0, Format 0, Mac Roman table. std::vector<uint8_t> subtable_1_0_0; + + bool ParseFormat4(int platform, int encoding, const uint8_t *data, + size_t length, uint16_t num_glyphs); + bool Parse31012(const uint8_t *data, size_t length, uint16_t num_glyphs); + bool Parse31013(const uint8_t *data, size_t length, uint16_t num_glyphs); + bool Parse0514(const uint8_t *data, size_t length, uint16_t num_glyphs); + bool Parse100(const uint8_t *data, size_t length); }; } // namespace ots |