[ot-font] Start adding vertical support
diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index e918e3b..642c636 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -35,22 +35,25 @@
/*
* hmtx -- The Horizontal Metrics Table
+ * vmtx -- The Vertical Metrics Table
*/
#define HB_OT_TAG_hmtx HB_TAG('h','m','t','x')
+#define HB_OT_TAG_vmtx HB_TAG('v','m','t','x')
-struct LongHorMetric
+struct LongMetric
{
- USHORT advanceWidth;
- SHORT lsb;
+ USHORT advance; /* Advance width/height. */
+ SHORT lsb; /* Leading (left/top) side bearing. */
public:
DEFINE_SIZE_STATIC (4);
};
-struct hmtx
+struct _mtx
{
- static const hb_tag_t tableTag = HB_OT_TAG_hmtx;
+ static const hb_tag_t hmtxTag = HB_OT_TAG_hmtx;
+ static const hb_tag_t vmtxTag = HB_OT_TAG_vmtx;
inline bool sanitize (hb_sanitize_context_t *c) {
TRACE_SANITIZE (this);
@@ -60,7 +63,7 @@
}
public:
- LongHorMetric longHorMetric[VAR]; /* Paired advance width and left side
+ LongMetric longHorMetric[VAR]; /* Paired advance width and leading
* bearing values for each glyph. The
* value numOfHMetrics comes from
* the 'hhea' table. If the font is
@@ -68,23 +71,29 @@
* be in the array, but that entry is
* required. The last entry applies to
* all subsequent glyphs. */
- SHORT leftSideBearingX[VAR]; /* Here the advanceWidth is assumed
- * to be the same as the advanceWidth
+ SHORT leadingBearingX[VAR]; /* Here the advance is assumed
+ * to be the same as the advance
* for the last entry above. The
* number of entries in this array is
* derived from numGlyphs (from 'maxp'
- * table) minus numberOfHMetrics. This
- * generally is used with a run of
- * monospaced glyphs (e.g., Kanji
+ * table) minus numberOfLongMetrics.
+ * This generally is used with a run
+ * of monospaced glyphs (e.g., Kanji
* fonts or Courier fonts). Only one
* run is allowed and it must be at
* the end. This allows a monospaced
- * font to vary the left side bearing
+ * font to vary the side bearing
* values for each glyph. */
public:
- DEFINE_SIZE_ARRAY2 (0, longHorMetric, leftSideBearingX);
+ DEFINE_SIZE_ARRAY2 (0, longHorMetric, leadingBearingX);
};
+struct hmtx : _mtx {
+ static const hb_tag_t tableTag = HB_OT_TAG_hmtx;
+};
+struct vmtx : _mtx {
+ static const hb_tag_t tableTag = HB_OT_TAG_vmtx;
+};
} /* namespace OT */