michael@0: // Copyright (c) 2009 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef OTS_CMAP_H_ michael@0: #define OTS_CMAP_H_ michael@0: michael@0: #include michael@0: michael@0: #include "ots.h" michael@0: michael@0: namespace ots { michael@0: michael@0: struct OpenTypeCMAPSubtableRange { michael@0: uint32_t start_range; michael@0: uint32_t end_range; michael@0: uint32_t start_glyph_id; michael@0: }; michael@0: michael@0: struct OpenTypeCMAPSubtableVSRange { michael@0: uint32_t unicode_value; michael@0: uint8_t additional_count; michael@0: }; michael@0: michael@0: struct OpenTypeCMAPSubtableVSMapping { michael@0: uint32_t unicode_value; michael@0: uint16_t glyph_id; michael@0: }; michael@0: michael@0: struct OpenTypeCMAPSubtableVSRecord { michael@0: uint32_t var_selector; michael@0: uint32_t default_offset; michael@0: uint32_t non_default_offset; michael@0: std::vector ranges; michael@0: std::vector mappings; michael@0: }; michael@0: michael@0: struct OpenTypeCMAP { michael@0: OpenTypeCMAP() michael@0: : subtable_0_3_4_data(NULL), michael@0: subtable_0_3_4_length(0), michael@0: subtable_0_5_14_length(0), michael@0: subtable_3_0_4_data(NULL), michael@0: subtable_3_0_4_length(0), michael@0: subtable_3_1_4_data(NULL), michael@0: subtable_3_1_4_length(0) { michael@0: } michael@0: michael@0: // Platform 0, Encoding 3, Format 4, Unicode BMP table. michael@0: const uint8_t *subtable_0_3_4_data; michael@0: size_t subtable_0_3_4_length; michael@0: michael@0: // Platform 0, Encoding 5, Format 14, Unicode Variation Sequence table. michael@0: size_t subtable_0_5_14_length; michael@0: std::vector subtable_0_5_14; michael@0: michael@0: // Platform 3, Encoding 0, Format 4, MS Symbol table. michael@0: const uint8_t *subtable_3_0_4_data; michael@0: size_t subtable_3_0_4_length; michael@0: // Platform 3, Encoding 1, Format 4, MS Unicode BMP table. michael@0: const uint8_t *subtable_3_1_4_data; michael@0: size_t subtable_3_1_4_length; michael@0: michael@0: // Platform 3, Encoding 10, Format 12, MS Unicode UCS-4 table. michael@0: std::vector subtable_3_10_12; michael@0: // Platform 3, Encoding 10, Format 13, MS UCS-4 Fallback table. michael@0: std::vector subtable_3_10_13; michael@0: // Platform 1, Encoding 0, Format 0, Mac Roman table. michael@0: std::vector subtable_1_0_0; michael@0: }; michael@0: michael@0: } // namespace ots michael@0: michael@0: #endif