hb-ot-hhea-table.hh revision 13240:8c09472c3de2
126219Swpaul/*
226219Swpaul * Copyright �� 2011,2012  Google, Inc.
326219Swpaul *
492990Sobrien *  This is part of HarfBuzz, a text shaping library.
592990Sobrien *
692990Sobrien * Permission is hereby granted, without written agreement and without
7261046Smav * license or royalty fees, to use, copy, modify, and distribute this
8261046Smav * software and its documentation for any purpose, provided that the
9261046Smav * above copyright notice and the following two paragraphs appear in
10261046Smav * all copies of this software.
11261046Smav *
12261046Smav * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13261046Smav * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14261046Smav * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15261046Smav * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16261046Smav * DAMAGE.
17261046Smav *
18261046Smav * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19261046Smav * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20261046Smav * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
2126219Swpaul * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22261046Smav * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23261046Smav *
24261046Smav * Google Author(s): Behdad Esfahbod
25261046Smav */
26261046Smav
27261046Smav#ifndef HB_OT_HHEA_TABLE_HH
28261046Smav#define HB_OT_HHEA_TABLE_HH
29261046Smav
30261046Smav#include "hb-open-type-private.hh"
31261046Smav
32261046Smav
3326219Swpaulnamespace OT {
3426219Swpaul
3574462Salfred
3626219Swpaul/*
3726219Swpaul * hhea -- The Horizontal Header Table
3826219Swpaul * vhea -- The Vertical Header Table
3926219Swpaul */
4026219Swpaul
4126219Swpaul#define HB_OT_TAG_hhea HB_TAG('h','h','e','a')
4274462Salfred#define HB_OT_TAG_vhea HB_TAG('v','h','e','a')
4326219Swpaul
4426219Swpaul
4526219Swpaulstruct _hea
4626219Swpaul{
4774462Salfred  static const hb_tag_t tableTag = HB_TAG('_','h','e','a');
4826219Swpaul
4926219Swpaul  static const hb_tag_t hheaTag = HB_OT_TAG_hhea;
5026219Swpaul  static const hb_tag_t vheaTag = HB_OT_TAG_vhea;
5126219Swpaul
5226219Swpaul  inline bool sanitize (hb_sanitize_context_t *c) const
5326219Swpaul  {
5426219Swpaul    TRACE_SANITIZE (this);
5526219Swpaul    return_trace (c->check_struct (this) && likely (version.major == 1));
56173763Sjb  }
5726219Swpaul
5826219Swpaul  public:
5926219Swpaul  FixedVersion  version;                /* 0x00010000u for version 1.0. */
60173763Sjb  FWORD         ascender;               /* Typographic ascent. */
6126219Swpaul  FWORD         descender;              /* Typographic descent. */
6226219Swpaul  FWORD         lineGap;                /* Typographic line gap. */
6374462Salfred  UFWORD        advanceMax;             /* Maximum advance width/height value in
6474462Salfred                                         * metrics table. */
6574462Salfred  FWORD         minLeadingBearing;      /* Minimum left/top sidebearing value in
6674462Salfred                                         * metrics table. */
6774462Salfred  FWORD         minTrailingBearing;     /* Minimum right/bottom sidebearing value;
6874462Salfred                                         * calculated as Min(aw - lsb -
6926219Swpaul                                         * (xMax - xMin)) for horizontal. */
7026219Swpaul  FWORD         maxExtent;              /* horizontal: Max(lsb + (xMax - xMin)),
7174462Salfred                                         * vertical: minLeadingBearing+(yMax-yMin). */
7274462Salfred  SHORT         caretSlopeRise;         /* Used to calculate the slope of the
7326219Swpaul                                         * cursor (rise/run); 1 for vertical caret,
7426219Swpaul                                         * 0 for horizontal.*/
7526219Swpaul  SHORT         caretSlopeRun;          /* 0 for vertical caret, 1 for horizontal. */
7626219Swpaul  SHORT         caretOffset;            /* The amount by which a slanted
7726219Swpaul                                         * highlight on a glyph needs
7826219Swpaul                                         * to be shifted to produce the
7926219Swpaul                                         * best appearance. Set to 0 for
8026219Swpaul                                         * non-slanted fonts. */
8126219Swpaul  SHORT         reserved1;              /* Set to 0. */
8292889Sobrien  SHORT         reserved2;              /* Set to 0. */
8392889Sobrien  SHORT         reserved3;              /* Set to 0. */
8426219Swpaul  SHORT         reserved4;              /* Set to 0. */
8526219Swpaul  SHORT         metricDataFormat;       /* 0 for current format. */
8626219Swpaul  USHORT        numberOfLongMetrics;    /* Number of LongMetric entries in metric
8726219Swpaul                                         * table. */
8874462Salfred  public:
8974462Salfred  DEFINE_SIZE_STATIC (36);
9074462Salfred};
9174462Salfred
9226219Swpaulstruct hhea : _hea {
9326219Swpaul  static const hb_tag_t tableTag        = HB_OT_TAG_hhea;
94};
95struct vhea : _hea {
96  static const hb_tag_t tableTag        = HB_OT_TAG_vhea;
97};
98
99
100} /* namespace OT */
101
102
103#endif /* HB_OT_HHEA_TABLE_HH */
104