Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / ots / src / cff.h
blob5584acc62931d19e698ed13767856fd16b34e96b
1 // Copyright (c) 2009 The Chromium 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.
5 #ifndef OTS_CFF_H_
6 #define OTS_CFF_H_
8 #include "ots.h"
10 #include <map>
11 #include <string>
12 #include <vector>
14 namespace ots {
16 struct CFFIndex {
17 CFFIndex()
18 : count(0), off_size(0), offset_to_next(0) {}
19 uint16_t count;
20 uint8_t off_size;
21 std::vector<uint32_t> offsets;
22 uint32_t offset_to_next;
25 struct OpenTypeCFF {
26 const uint8_t *data;
27 size_t length;
28 // Name INDEX. This name is used in name.cc as a postscript font name.
29 std::string name;
31 // The number of fonts the file has.
32 size_t font_dict_length;
33 // A map from glyph # to font #.
34 std::map<uint16_t, uint8_t> fd_select;
36 // A list of char strings.
37 std::vector<CFFIndex *> char_strings_array;
38 // A list of Local Subrs associated with FDArrays. Can be empty.
39 std::vector<CFFIndex *> local_subrs_per_font;
40 // A Local Subrs associated with Top DICT. Can be NULL.
41 CFFIndex *local_subrs;
44 } // namespace ots
46 #endif // OTS_CFF_H_