SkOTTable_EBDT.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright 2014 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef SkOTTable_EBDT_DEFINED
  8. #define SkOTTable_EBDT_DEFINED
  9. #include "src/core/SkEndian.h"
  10. #include "src/sfnt/SkOTTableTypes.h"
  11. #include "src/sfnt/SkOTTable_head.h"
  12. #include "src/sfnt/SkOTTable_loca.h"
  13. #pragma pack(push, 1)
  14. struct SkOTTableEmbeddedBitmapData {
  15. static const SK_OT_CHAR TAG0 = 'E';
  16. static const SK_OT_CHAR TAG1 = 'B';
  17. static const SK_OT_CHAR TAG2 = 'D';
  18. static const SK_OT_CHAR TAG3 = 'T';
  19. static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableEmbeddedBitmapData>::value;
  20. SK_OT_Fixed version;
  21. static const SK_OT_Fixed version_initial = SkTEndian_SwapBE32(0x00020000);
  22. struct BigGlyphMetrics {
  23. SK_OT_BYTE height;
  24. SK_OT_BYTE width;
  25. SK_OT_CHAR horiBearingX;
  26. SK_OT_CHAR horiBearingY;
  27. SK_OT_BYTE horiAdvance;
  28. SK_OT_CHAR vertBearingX;
  29. SK_OT_CHAR vertBearingY;
  30. SK_OT_BYTE vertAdvance;
  31. };
  32. struct SmallGlyphMetrics {
  33. SK_OT_BYTE height;
  34. SK_OT_BYTE width;
  35. SK_OT_CHAR bearingX;
  36. SK_OT_CHAR bearingY;
  37. SK_OT_BYTE advance;
  38. };
  39. // Small metrics, byte-aligned data.
  40. struct Format1 {
  41. SmallGlyphMetrics smallGlyphMetrics;
  42. //SK_OT_BYTE[] byteAlignedBitmap;
  43. };
  44. // Small metrics, bit-aligned data.
  45. struct Format2 {
  46. SmallGlyphMetrics smallGlyphMetrics;
  47. //SK_OT_BYTE[] bitAlignedBitmap;
  48. };
  49. // Format 3 is not used.
  50. // EBLC metrics (IndexSubTable::header::indexFormat 2 or 5), compressed data.
  51. // Only used on Mac.
  52. struct Format4 {
  53. SK_OT_ULONG whiteTreeOffset;
  54. SK_OT_ULONG blackTreeOffset;
  55. SK_OT_ULONG glyphDataOffset;
  56. };
  57. // EBLC metrics (IndexSubTable::header::indexFormat 2 or 5), bit-aligned data.
  58. struct Format5 {
  59. //SK_OT_BYTE[] bitAlignedBitmap;
  60. };
  61. // Big metrics, byte-aligned data.
  62. struct Format6 {
  63. BigGlyphMetrics bigGlyphMetrics;
  64. //SK_OT_BYTE[] byteAlignedBitmap;
  65. };
  66. // Big metrics, bit-aligned data.
  67. struct Format7 {
  68. BigGlyphMetrics bigGlyphMetrics;
  69. //SK_OT_BYTE[] bitAlignedBitmap;
  70. };
  71. struct EBDTComponent {
  72. SK_OT_USHORT glyphCode; // Component glyph code
  73. SK_OT_CHAR xOffset; // Position of component left
  74. SK_OT_CHAR yOffset; // Position of component top
  75. };
  76. struct Format8 {
  77. SmallGlyphMetrics smallMetrics; // Metrics information for the glyph
  78. SK_OT_BYTE pad; // Pad to short boundary
  79. SK_OT_USHORT numComponents; // Number of components
  80. //EBDTComponent componentArray[numComponents]; // Glyph code, offset array
  81. };
  82. struct Format9 {
  83. BigGlyphMetrics bigMetrics; // Metrics information for the glyph
  84. SK_OT_USHORT numComponents; // Number of components
  85. //EBDTComponent componentArray[numComponents]; // Glyph code, offset array
  86. };
  87. };
  88. #pragma pack(pop)
  89. #endif