PageRenderTime 38ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/gfx/ots/src/layout.h

http://github.com/zpao/v8monkey
C Header | 68 lines | 42 code | 19 blank | 7 comment | 0 complexity | 3aebaeb2318e166d7c23596c29527f6e MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-3.0, AGPL-1.0, LGPL-2.1, BSD-3-Clause, GPL-2.0, JSON, Apache-2.0, 0BSD
  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
  3. // found in the LICENSE file.
  4. #ifndef OTS_LAYOUT_H_
  5. #define OTS_LAYOUT_H_
  6. #include "ots.h"
  7. // Utility functions for OpenType layout common table formats.
  8. // http://www.microsoft.com/typography/otspec/chapter2.htm
  9. namespace ots {
  10. struct LookupSubtableParser {
  11. struct TypeParser {
  12. uint16_t type;
  13. bool (*parse)(const OpenTypeFile *file, const uint8_t *data,
  14. const size_t length);
  15. };
  16. size_t num_types;
  17. uint16_t extension_type;
  18. const TypeParser *parsers;
  19. bool Parse(const OpenTypeFile *file, const uint8_t *data,
  20. const size_t length, const uint16_t lookup_type) const;
  21. };
  22. bool ParseScriptListTable(const uint8_t *data, const size_t length,
  23. const uint16_t num_features);
  24. bool ParseFeatureListTable(const uint8_t *data, const size_t length,
  25. const uint16_t num_lookups,
  26. uint16_t *num_features);
  27. bool ParseLookupListTable(OpenTypeFile *file, const uint8_t *data,
  28. const size_t length,
  29. const LookupSubtableParser* parser,
  30. uint16_t* num_lookups);
  31. bool ParseClassDefTable(const uint8_t *data, size_t length,
  32. const uint16_t num_glyphs,
  33. const uint16_t num_classes);
  34. bool ParseCoverageTable(const uint8_t *data, size_t length,
  35. const uint16_t num_glyphs);
  36. bool ParseDeviceTable(const uint8_t *data, size_t length);
  37. // Parser for 'Contextual' subtable shared by GSUB/GPOS tables.
  38. bool ParseContextSubtable(const uint8_t *data, const size_t length,
  39. const uint16_t num_glyphs,
  40. const uint16_t num_lookups);
  41. // Parser for 'Chaining Contextual' subtable shared by GSUB/GPOS tables.
  42. bool ParseChainingContextSubtable(const uint8_t *data, const size_t length,
  43. const uint16_t num_glyphs,
  44. const uint16_t num_lookups);
  45. bool ParseExtensionSubtable(const OpenTypeFile *file,
  46. const uint8_t *data, const size_t length,
  47. const LookupSubtableParser* parser);
  48. } // namespace ots
  49. #endif // OTS_LAYOUT_H_