bungeman@google.com | f8d1aee | 2012-02-02 19:15:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 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 | |
| 8 | #ifndef SkOTTable_hhea_DEFINED |
| 9 | #define SkOTTable_hhea_DEFINED |
| 10 | |
| 11 | #include "SkEndian.h" |
| 12 | #include "SkOTTableTypes.h" |
bungeman@google.com | f8d1aee | 2012-02-02 19:15:21 +0000 | [diff] [blame] | 13 | |
| 14 | #pragma pack(push, 1) |
| 15 | |
| 16 | struct SkOTTableHorizontalHeader { |
bungeman@google.com | ec95a4a | 2012-06-25 14:26:48 +0000 | [diff] [blame] | 17 | static const SK_OT_CHAR TAG0 = 'h'; |
| 18 | static const SK_OT_CHAR TAG1 = 'h'; |
| 19 | static const SK_OT_CHAR TAG2 = 'e'; |
| 20 | static const SK_OT_CHAR TAG3 = 'a'; |
| 21 | static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalHeader>::value; |
| 22 | |
bungeman@google.com | f8d1aee | 2012-02-02 19:15:21 +0000 | [diff] [blame] | 23 | SK_OT_Fixed version; |
| 24 | static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000); |
| 25 | SK_OT_FWORD Ascender; |
| 26 | SK_OT_FWORD Descender; |
| 27 | SK_OT_FWORD LineGap; |
| 28 | SK_OT_UFWORD advanceWidthMax; |
| 29 | SK_OT_FWORD minLeftSideBearing; |
| 30 | SK_OT_FWORD minRightSideBearing; |
| 31 | SK_OT_FWORD xMaxExtent; |
| 32 | SK_OT_SHORT caretSlopeRise; |
| 33 | SK_OT_SHORT caretSlopeRun; |
| 34 | SK_OT_SHORT caretOffset; |
| 35 | SK_OT_SHORT Reserved24; |
| 36 | SK_OT_SHORT Reserved26; |
| 37 | SK_OT_SHORT Reserved28; |
| 38 | SK_OT_SHORT Reserved30; |
| 39 | struct MetricDataFormat { |
bungeman | 8fd23a8 | 2016-08-16 12:27:49 -0700 | [diff] [blame] | 40 | enum Value : SK_OT_SHORT { |
| 41 | CurrentFormat = SkTEndian_SwapBE16(0), |
| 42 | } value; |
bungeman@google.com | f8d1aee | 2012-02-02 19:15:21 +0000 | [diff] [blame] | 43 | } metricDataFormat; |
| 44 | SK_OT_USHORT numberOfHMetrics; |
| 45 | }; |
| 46 | |
| 47 | #pragma pack(pop) |
| 48 | |
| 49 | |
| 50 | #include <stddef.h> |
bungeman | 99fe822 | 2015-08-20 07:57:51 -0700 | [diff] [blame] | 51 | static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34"); |
| 52 | static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizontalHeader_not_36"); |
bungeman@google.com | f8d1aee | 2012-02-02 19:15:21 +0000 | [diff] [blame] | 53 | |
| 54 | #endif |