| 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 "src/base/SkEndian.h" |
| 12 |
#include "src/sfnt/SkOTTableTypes.h" |
| 13 |
|
| 14 |
#pragma pack(push, 1) |
| 15 |
|
| 16 |
struct SkOTTableHorizontalHeader { |
| 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 |
|
| 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 { |
| 40 |
enum Value : SK_OT_SHORT { |
| 41 |
CurrentFormat = SkTEndian_SwapBE16(0), |
| 42 |
} value; |
| 43 |
} metricDataFormat; |
| 44 |
SK_OT_USHORT numberOfHMetrics; |
| 45 |
}; |
| 46 |
|
| 47 |
#pragma pack(pop) |
| 48 |
|
| 49 |
|
| 50 |
#include <stddef.h> |
| 51 |
static_assert(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, "SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34"); |
| 52 |
static_assert(sizeof(SkOTTableHorizontalHeader) == 36, "sizeof_SkOTTableHorizontalHeader_not_36"); |
| 53 |
|
| 54 |
#endif |