OLD | NEW |
1 // Copyright 2013 Google Inc. All Rights Reserved. | 1 // Copyright 2013 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }; | 54 }; |
55 std::map<uint32_t, Table> tables; | 55 std::map<uint32_t, Table> tables; |
56 std::vector<uint32_t> OutputOrderedTags() const; | 56 std::vector<uint32_t> OutputOrderedTags() const; |
57 | 57 |
58 Table* FindTable(uint32_t tag); | 58 Table* FindTable(uint32_t tag); |
59 const Table* FindTable(uint32_t tag) const; | 59 const Table* FindTable(uint32_t tag) const; |
60 }; | 60 }; |
61 | 61 |
62 // Accomodates both singular (OTF, TTF) and collection (TTC) fonts | 62 // Accomodates both singular (OTF, TTF) and collection (TTC) fonts |
63 struct FontCollection { | 63 struct FontCollection { |
| 64 uint32_t flavor; |
64 uint32_t header_version; | 65 uint32_t header_version; |
65 // (offset, first use of table*) pairs | 66 // (offset, first use of table*) pairs |
66 std::map<uint32_t, Font::Table*> tables; | 67 std::map<uint32_t, Font::Table*> tables; |
67 std::vector<Font> fonts; | 68 std::vector<Font> fonts; |
68 }; | 69 }; |
69 | 70 |
70 // Parses the font from the given data. Returns false on parsing failure or | 71 // Parses the font from the given data. Returns false on parsing failure or |
71 // buffer overflow. The font is valid only so long the input data pointer is | 72 // buffer overflow. The font is valid only so long the input data pointer is |
72 // valid. Does NOT support collections. | 73 // valid. Does NOT support collections. |
73 bool ReadFont(const uint8_t* data, size_t len, Font* font); | 74 bool ReadFont(const uint8_t* data, size_t len, Font* font); |
(...skipping 29 matching lines...) Expand all Loading... |
103 // with the given index. Returns false if the glyph is not found. | 104 // with the given index. Returns false if the glyph is not found. |
104 bool GetGlyphData(const Font& font, int glyph_index, | 105 bool GetGlyphData(const Font& font, int glyph_index, |
105 const uint8_t** glyph_data, size_t* glyph_size); | 106 const uint8_t** glyph_data, size_t* glyph_size); |
106 | 107 |
107 // Removes the digital signature (DSIG) table | 108 // Removes the digital signature (DSIG) table |
108 bool RemoveDigitalSignature(Font* font); | 109 bool RemoveDigitalSignature(Font* font); |
109 | 110 |
110 } // namespace woff2 | 111 } // namespace woff2 |
111 | 112 |
112 #endif // WOFF2_FONT_H_ | 113 #endif // WOFF2_FONT_H_ |
OLD | NEW |