1 /* 2 * Copyright 2022 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_hmtx_DEFINED 9 #define SkOTTable_hmtx_DEFINED 10 11 #include "src/base/SkEndian.h" 12 #include "src/sfnt/SkOTTableTypes.h" 13 14 #pragma pack(push, 1) 15 16 struct SkOTTableHorizontalMetrics { 17 static const SK_OT_CHAR TAG0 = 'h'; 18 static const SK_OT_CHAR TAG1 = 'm'; 19 static const SK_OT_CHAR TAG2 = 't'; 20 static const SK_OT_CHAR TAG3 = 'x'; 21 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableHorizontalMetrics>::value; 22 23 struct FullMetric { 24 SK_OT_USHORT advanceWidth; 25 SK_OT_SHORT lsb; 26 } longHorMetric[1/*hhea::numberOfHMetrics*/]; 27 struct ShortMetric { 28 SK_OT_SHORT lsb; 29 }; /* maxp::numGlyphs - hhea::numberOfHMetrics */ 30 }; 31 32 #pragma pack(pop) 33 34 #endif 35