180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru/*
280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Copyright 2012 Google Inc.
380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru *
480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * Use of this source code is governed by a BSD-style license that can be
580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru * found in the LICENSE file.
680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru */
780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#ifndef SkOTTable_hhea_DEFINED
980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#define SkOTTable_hhea_DEFINED
1080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkEndian.h"
1280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkOTTableTypes.h"
1380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include "SkTypedEnum.h"
1480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#pragma pack(push, 1)
1680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
1780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Querustruct SkOTTableHorizontalHeader {
1880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static const SK_OT_CHAR TAG0 = 'h';
1980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static const SK_OT_CHAR TAG1 = 'h';
2080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static const SK_OT_CHAR TAG2 = 'e';
2180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static const SK_OT_CHAR TAG3 = 'a';
2280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalHeader>::value;
2380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
2480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_Fixed version;
2580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    static const SK_OT_Fixed version1 = SkTEndian_SwapBE32(0x00010000);
2680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_FWORD Ascender;
2780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_FWORD Descender;
2880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_FWORD LineGap;
2980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_UFWORD advanceWidthMax;
3080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_FWORD minLeftSideBearing;
3180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_FWORD minRightSideBearing;
3280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_FWORD xMaxExtent;
3380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT caretSlopeRise;
3480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT caretSlopeRun;
3580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT caretOffset;
3680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT Reserved24;
3780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT Reserved26;
3880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT Reserved28;
3980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_SHORT Reserved30;
4080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    struct MetricDataFormat {
4180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        SK_TYPED_ENUM(Value, SK_OT_SHORT,
4280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru            ((CurrentFormat, SkTEndian_SwapBE16(0)))
4380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru            SK_SEQ_END,
4480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru        (value)SK_SEQ_END)
4580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    } metricDataFormat;
4680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru    SK_OT_USHORT numberOfHMetrics;
4780bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru};
4880bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
4980bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#pragma pack(pop)
5080bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
5180bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
5280bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#include <stddef.h>
5380bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste QueruSK_COMPILE_ASSERT(offsetof(SkOTTableHorizontalHeader, numberOfHMetrics) == 34, SkOTTableHorizontalHeader_numberOfHMetrics_not_at_34);
5480bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste QueruSK_COMPILE_ASSERT(sizeof(SkOTTableHorizontalHeader) == 36, sizeof_SkOTTableHorizontalHeader_not_36);
5580bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru
5680bacfeb4bda06541e8695bd502229727bccfeaJean-Baptiste Queru#endif
57