| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef OTS_LAYOUT_H_ | 5 #ifndef OTS_LAYOUT_H_ |
| 6 #define OTS_LAYOUT_H_ | 6 #define OTS_LAYOUT_H_ |
| 7 | 7 |
| 8 #include "ots.h" | 8 #include "ots.h" |
| 9 | 9 |
| 10 // Utility functions for OpenType layout common table formats. | 10 // Utility functions for OpenType layout common table formats. |
| 11 // http://www.microsoft.com/typography/otspec/chapter2.htm | 11 // http://www.microsoft.com/typography/otspec/chapter2.htm |
| 12 | 12 |
| 13 namespace ots { | 13 namespace ots { |
| 14 | 14 |
| 15 struct LookupTypeParser { |
| 16 uint16_t type; |
| 17 bool (*parse)(const OpenTypeFile *file, const uint8_t *data, |
| 18 const size_t length); |
| 19 }; |
| 20 |
| 21 bool ParseScriptListTable(const uint8_t *data, const size_t length, |
| 22 const uint16_t num_features); |
| 23 |
| 24 bool ParseFeatureListTable(const uint8_t *data, const size_t length, |
| 25 const uint16_t num_lookups, |
| 26 uint16_t* num_features); |
| 27 |
| 28 bool ParseLookupListTable(OpenTypeFile *file, const uint8_t *data, |
| 29 const size_t length, const size_t num_types, |
| 30 const LookupTypeParser* parsers, |
| 31 uint16_t *num_lookups); |
| 32 |
| 15 bool ParseClassDefTable(const uint8_t *data, size_t length, | 33 bool ParseClassDefTable(const uint8_t *data, size_t length, |
| 16 const uint16_t num_glyphs, | 34 const uint16_t num_glyphs, |
| 17 const uint16_t num_classes); | 35 const uint16_t num_classes); |
| 18 | 36 |
| 19 bool ParseCoverageTable(const uint8_t *data, size_t length, | 37 bool ParseCoverageTable(const uint8_t *data, size_t length, |
| 20 const uint16_t num_glyphs); | 38 const uint16_t num_glyphs); |
| 21 | 39 |
| 40 bool ParseDeviceTable(const uint8_t *data, size_t length); |
| 41 |
| 22 } // namespace ots | 42 } // namespace ots |
| 23 | 43 |
| 24 #endif // OTS_LAYOUT_H_ | 44 #endif // OTS_LAYOUT_H_ |
| 25 | 45 |
| OLD | NEW |