From 097ecfd4a991d4fa306bab7330d9952966e94d1f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 23 Oct 2018 02:09:42 -0700 Subject: [PATCH] [VORG] Add get_y_origin() Unhooked. --- src/hb-ot-vorg-table.hh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index 3b7bf4c06..0baaf2e0e 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -39,6 +39,8 @@ namespace OT { struct VertOriginMetric { + inline int cmp (hb_codepoint_t g) const { return -glyph.cmp (g); } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -57,6 +59,15 @@ struct VORG { static const hb_tag_t tableTag = HB_OT_TAG_VORG; + inline bool has_data (void) const { return version.to_int (); } + + inline int get_y_origin (hb_codepoint_t glyph) const + { + vertYOrigins.bsearch (glyph); + + return defaultVertOriginY; + } + inline bool _subset (const hb_subset_plan_t *plan, const VORG *vorg_table, const hb_vector_t &subset_metrics, @@ -157,8 +168,9 @@ struct VORG protected: FixedVersion<> version; /* Version of VORG table. Set to 0x00010000u. */ - FWORD defaultVertOriginY; /* The default vertical origin */ - ArrayOfvertYOrigins; /* The array of vertical origins */ + FWORD defaultVertOriginY; /* The default vertical origin. */ + SortedArrayOf + vertYOrigins; /* The array of vertical origins. */ public: DEFINE_SIZE_ARRAY(8, vertYOrigins);