2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkOTTable_EBDT_DEFINED
9 #define SkOTTable_EBDT_DEFINED
12 #include "SkOTTableTypes.h"
13 #include "SkOTTable_head.h"
14 #include "SkOTTable_loca.h"
15 #include "SkTypedEnum.h"
19 struct SkOTTableEmbeddedBitmapData {
20 static const SK_OT_CHAR TAG0 = 'E';
21 static const SK_OT_CHAR TAG1 = 'B';
22 static const SK_OT_CHAR TAG2 = 'D';
23 static const SK_OT_CHAR TAG3 = 'T';
24 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableEmbeddedBitmapData>::value;
27 static const SK_OT_Fixed version_initial = SkTEndian_SwapBE32(0x00020000);
29 struct BigGlyphMetrics {
32 SK_OT_CHAR horiBearingX;
33 SK_OT_CHAR horiBearingY;
34 SK_OT_BYTE horiAdvance;
35 SK_OT_CHAR vertBearingX;
36 SK_OT_CHAR vertBearingY;
37 SK_OT_BYTE vertAdvance;
40 struct SmallGlyphMetrics {
48 // Small metrics, byte-aligned data.
50 SmallGlyphMetrics smallGlyphMetrics;
51 //SK_OT_BYTE[] byteAlignedBitmap;
54 // Small metrics, bit-aligned data.
56 SmallGlyphMetrics smallGlyphMetrics;
57 //SK_OT_BYTE[] bitAlignedBitmap;
60 // Format 3 is not used.
62 // EBLC metrics (IndexSubTable::header::indexFormat 2 or 5), compressed data.
65 SK_OT_ULONG whiteTreeOffset;
66 SK_OT_ULONG blackTreeOffset;
67 SK_OT_ULONG glyphDataOffset;
70 // EBLC metrics (IndexSubTable::header::indexFormat 2 or 5), bit-aligned data.
72 //SK_OT_BYTE[] bitAlignedBitmap;
75 // Big metrics, byte-aligned data.
77 BigGlyphMetrics bigGlyphMetrics;
78 //SK_OT_BYTE[] byteAlignedBitmap;
81 // Big metrics, bit-aligned data.
83 BigGlyphMetrics bigGlyphMetrics;
84 //SK_OT_BYTE[] bitAlignedBitmap;
87 struct EBDTComponent {
88 SK_OT_USHORT glyphCode; // Component glyph code
89 SK_OT_CHAR xOffset; // Position of component left
90 SK_OT_CHAR yOffset; // Position of component top
94 SmallGlyphMetrics smallMetrics; // Metrics information for the glyph
95 SK_OT_BYTE pad; // Pad to short boundary
96 SK_OT_USHORT numComponents; // Number of components
97 //EBDTComponent componentArray[numComponents]; // Glyph code, offset array
101 BigGlyphMetrics bigMetrics; // Metrics information for the glyph
102 SK_OT_USHORT numComponents; // Number of components
103 //EBDTComponent componentArray[numComponents]; // Glyph code, offset array