1 /* 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * 4 * This code is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License version 2 only, as 6 * published by the Free Software Foundation. Oracle designates this 7 * particular file as subject to the "Classpath" exception as provided 8 * by Oracle in the LICENSE file that accompanied this code. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 // This file is available under and governed by the GNU General Public 26 // License version 2 only, as published by the Free Software Foundation. 27 // However, the following notice accompanied the original version of this 28 // file: 29 // 30 /* 31 * Copyright © 2011,2012 Google, Inc. 32 * 33 * This is part of HarfBuzz, a text shaping library. 34 * 35 * Permission is hereby granted, without written agreement and without 36 * license or royalty fees, to use, copy, modify, and distribute this 37 * software and its documentation for any purpose, provided that the 38 * above copyright notice and the following two paragraphs appear in 39 * all copies of this software. 40 * 41 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 42 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 43 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 44 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 45 * DAMAGE. 46 * 47 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 48 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 49 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 50 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 51 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 52 * 53 * Google Author(s): Behdad Esfahbod 54 */ 55 56 #ifndef HB_OT_HHEA_TABLE_HH 57 #define HB_OT_HHEA_TABLE_HH 58 59 #include "hb-open-type-private.hh" 60 61 62 namespace OT { 63 64 65 /* 66 * hhea -- The Horizontal Header Table 67 * vhea -- The Vertical Header Table 68 */ 69 70 #define HB_OT_TAG_hhea HB_TAG('h','h','e','a') 71 #define HB_OT_TAG_vhea HB_TAG('v','h','e','a') 72 73 74 struct _hea 75 { 76 static const hb_tag_t tableTag = HB_TAG('_','h','e','a'); 77 78 static const hb_tag_t hheaTag = HB_OT_TAG_hhea; 79 static const hb_tag_t vheaTag = HB_OT_TAG_vhea; 80 81 inline bool sanitize (hb_sanitize_context_t *c) const 82 { 83 TRACE_SANITIZE (this); 84 return_trace (c->check_struct (this) && likely (version.major == 1)); 85 } 86 87 public: 88 FixedVersion version; /* 0x00010000u for version 1.0. */ 89 FWORD ascender; /* Typographic ascent. */ 90 FWORD descender; /* Typographic descent. */ 91 FWORD lineGap; /* Typographic line gap. */ 92 UFWORD advanceMax; /* Maximum advance width/height value in 93 * metrics table. */ 94 FWORD minLeadingBearing; /* Minimum left/top sidebearing value in 95 * metrics table. */ 96 FWORD minTrailingBearing; /* Minimum right/bottom sidebearing value; 97 * calculated as Min(aw - lsb - 98 * (xMax - xMin)) for horizontal. */ 99 FWORD maxExtent; /* horizontal: Max(lsb + (xMax - xMin)), 100 * vertical: minLeadingBearing+(yMax-yMin). */ 101 SHORT caretSlopeRise; /* Used to calculate the slope of the 102 * cursor (rise/run); 1 for vertical caret, 103 * 0 for horizontal.*/ 104 SHORT caretSlopeRun; /* 0 for vertical caret, 1 for horizontal. */ 105 SHORT caretOffset; /* The amount by which a slanted 106 * highlight on a glyph needs 107 * to be shifted to produce the 108 * best appearance. Set to 0 for 109 * non-slanted fonts. */ 110 SHORT reserved1; /* Set to 0. */ 111 SHORT reserved2; /* Set to 0. */ 112 SHORT reserved3; /* Set to 0. */ 113 SHORT reserved4; /* Set to 0. */ 114 SHORT metricDataFormat; /* 0 for current format. */ 115 USHORT numberOfLongMetrics; /* Number of LongMetric entries in metric 116 * table. */ 117 public: 118 DEFINE_SIZE_STATIC (36); 119 }; 120 121 struct hhea : _hea { 122 static const hb_tag_t tableTag = HB_OT_TAG_hhea; 123 }; 124 struct vhea : _hea { 125 static const hb_tag_t tableTag = HB_OT_TAG_vhea; 126 }; 127 128 129 } /* namespace OT */ 130 131 132 #endif /* HB_OT_HHEA_TABLE_HH */