2017-01-23 20:41:43 +01:00
|
|
|
/*
|
|
|
|
* Copyright © 2017 Google, Inc.
|
|
|
|
*
|
|
|
|
* This is part of HarfBuzz, a text shaping library.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, without written agreement and without
|
|
|
|
* license or royalty fees, to use, copy, modify, and distribute this
|
|
|
|
* software and its documentation for any purpose, provided that the
|
|
|
|
* above copyright notice and the following two paragraphs appear in
|
|
|
|
* all copies of this software.
|
|
|
|
*
|
|
|
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
|
|
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
|
|
|
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
* DAMAGE.
|
|
|
|
*
|
|
|
|
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
|
|
|
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
|
|
|
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
|
|
|
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
|
|
|
*
|
|
|
|
* Google Author(s): Behdad Esfahbod
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HB_OT_VAR_HVAR_TABLE_HH
|
|
|
|
#define HB_OT_VAR_HVAR_TABLE_HH
|
|
|
|
|
2018-08-26 07:36:36 +02:00
|
|
|
#include "hb-ot-layout-common.hh"
|
2017-01-23 20:41:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
namespace OT {
|
|
|
|
|
|
|
|
|
|
|
|
struct DeltaSetIndexMap
|
|
|
|
{
|
2018-12-16 20:08:10 +01:00
|
|
|
bool sanitize (hb_sanitize_context_t *c) const
|
2017-01-23 20:41:43 +01:00
|
|
|
{
|
|
|
|
TRACE_SANITIZE (this);
|
|
|
|
return_trace (c->check_struct (this) &&
|
2018-11-12 20:23:31 +01:00
|
|
|
c->check_range (mapDataZ.arrayZ,
|
|
|
|
mapCount,
|
|
|
|
get_width ()));
|
2017-01-23 20:41:43 +01:00
|
|
|
}
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
template <typename T>
|
|
|
|
bool serialize (hb_serialize_context_t *c, const T &plan)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
2019-02-22 00:47:27 +01:00
|
|
|
unsigned int width = plan.get_width ();
|
|
|
|
unsigned int inner_bit_count = plan.get_inner_bit_count ();
|
|
|
|
auto map = plan.get_output_map ();
|
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
TRACE_SERIALIZE (this);
|
2019-02-22 00:47:27 +01:00
|
|
|
if (unlikely (map.length && ((((inner_bit_count-1)&~0xF)!=0) || (((width-1)&~0x3)!=0))))
|
2019-02-21 00:48:29 +01:00
|
|
|
return_trace (false);
|
|
|
|
if (unlikely (!c->extend_min (*this))) return_trace (false);
|
|
|
|
|
|
|
|
format.set (((width-1)<<4)|(inner_bit_count-1));
|
2019-02-22 00:47:27 +01:00
|
|
|
mapCount.set (map.length);
|
|
|
|
HBUINT8 *p = c->allocate_size<HBUINT8> (width * map.length);
|
2019-02-21 00:48:29 +01:00
|
|
|
if (unlikely (!p)) return_trace (false);
|
2019-02-22 00:47:27 +01:00
|
|
|
for (unsigned int i = 0; i < map.length; i++)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
2019-02-22 00:47:27 +01:00
|
|
|
unsigned int v = map[i];
|
2019-02-21 00:48:29 +01:00
|
|
|
unsigned int outer = v >> 16;
|
|
|
|
unsigned int inner = v & 0xFFFF;
|
|
|
|
unsigned int u = (outer << inner_bit_count)|inner;
|
|
|
|
for (unsigned int w = width; w > 0;)
|
|
|
|
{
|
2019-02-22 00:47:27 +01:00
|
|
|
p[--w].set (u);
|
|
|
|
u >>= 8;
|
2019-02-21 00:48:29 +01:00
|
|
|
}
|
|
|
|
p += width;
|
|
|
|
}
|
|
|
|
return_trace (true);
|
|
|
|
}
|
|
|
|
|
2017-01-23 20:56:08 +01:00
|
|
|
unsigned int map (unsigned int v) const /* Returns 16.16 outer.inner. */
|
|
|
|
{
|
|
|
|
/* If count is zero, pass value unchanged. This takes
|
|
|
|
* care of direct mapping for advance map. */
|
|
|
|
if (!mapCount)
|
|
|
|
return v;
|
|
|
|
|
|
|
|
if (v >= mapCount)
|
|
|
|
v = mapCount - 1;
|
|
|
|
|
|
|
|
unsigned int u = 0;
|
|
|
|
{ /* Fetch it. */
|
|
|
|
unsigned int w = get_width ();
|
2018-09-10 23:02:24 +02:00
|
|
|
const HBUINT8 *p = mapDataZ.arrayZ + w * v;
|
2017-01-23 20:56:08 +01:00
|
|
|
for (; w; w--)
|
|
|
|
u = (u << 8) + *p++;
|
|
|
|
}
|
|
|
|
|
|
|
|
{ /* Repack it. */
|
2019-02-22 00:47:27 +01:00
|
|
|
unsigned int n = get_inner_bit_count ();
|
2017-01-23 20:56:08 +01:00
|
|
|
unsigned int outer = u >> n;
|
|
|
|
unsigned int inner = u & ((1 << n) - 1);
|
|
|
|
u = (outer<<16) | inner;
|
|
|
|
}
|
|
|
|
|
|
|
|
return u;
|
|
|
|
}
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
unsigned int get_map_count () const { return mapCount; }
|
|
|
|
unsigned int get_width () const { return ((format >> 4) & 3) + 1; }
|
|
|
|
unsigned int get_inner_bit_count () const { return (format & 0xF) + 1; }
|
2017-01-23 20:56:08 +01:00
|
|
|
|
|
|
|
protected:
|
2018-01-10 03:07:30 +01:00
|
|
|
HBUINT16 format; /* A packed field that describes the compressed
|
2017-01-23 20:56:08 +01:00
|
|
|
* representation of delta-set indices. */
|
2018-01-10 03:07:30 +01:00
|
|
|
HBUINT16 mapCount; /* The number of mapping entries. */
|
2018-09-10 23:02:24 +02:00
|
|
|
UnsizedArrayOf<HBUINT8>
|
|
|
|
mapDataZ; /* The delta-set index mapping data. */
|
2017-01-23 20:56:08 +01:00
|
|
|
|
2017-01-23 20:41:43 +01:00
|
|
|
public:
|
2018-09-10 23:02:24 +02:00
|
|
|
DEFINE_SIZE_ARRAY (4, mapDataZ);
|
2017-01-23 20:41:43 +01:00
|
|
|
};
|
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
struct index_map_subset_plan_t
|
|
|
|
{
|
|
|
|
void init (const DeltaSetIndexMap &index_map,
|
|
|
|
hb_vector_t<hb_map2_t> &inner_remaps,
|
|
|
|
const hb_subset_plan_t *plan)
|
|
|
|
{
|
2019-02-22 00:47:27 +01:00
|
|
|
map_count = 0;
|
|
|
|
outer_bit_count = 0;
|
|
|
|
inner_bit_count = 0;
|
|
|
|
max_inners.init ();
|
|
|
|
output_map.init ();
|
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
/* Identity map */
|
|
|
|
if (&index_map == &Null(DeltaSetIndexMap))
|
|
|
|
return;
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
unsigned int last_val = (unsigned int)-1;
|
2019-02-21 00:48:29 +01:00
|
|
|
hb_codepoint_t last_gid = (hb_codepoint_t)-1;
|
2019-02-22 00:47:27 +01:00
|
|
|
hb_codepoint_t gid = (hb_codepoint_t)index_map.get_map_count ();
|
2019-02-21 00:48:29 +01:00
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
outer_bit_count = (index_map.get_width () * 8) - index_map.get_inner_bit_count ();
|
2019-02-21 00:48:29 +01:00
|
|
|
max_inners.resize (inner_remaps.length);
|
2019-02-22 00:47:27 +01:00
|
|
|
for (unsigned i = 0; i < inner_remaps.length; i++) max_inners[i] = 0;
|
2019-02-21 00:48:29 +01:00
|
|
|
|
|
|
|
/* Search backwards for a map value different from the last map value */
|
2019-02-22 00:47:27 +01:00
|
|
|
for (; gid > 0; gid--)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
|
|
|
hb_codepoint_t old_gid;
|
2019-02-22 00:47:27 +01:00
|
|
|
if (!plan->old_gid_for_new_gid (gid - 1, &old_gid))
|
2019-02-21 00:48:29 +01:00
|
|
|
continue;
|
|
|
|
|
|
|
|
unsigned int v = index_map.map (old_gid);
|
|
|
|
if (last_gid == (hb_codepoint_t)-1)
|
|
|
|
{
|
2019-02-22 00:47:27 +01:00
|
|
|
last_val = v;
|
|
|
|
last_gid = gid;
|
2019-02-21 00:48:29 +01:00
|
|
|
continue;
|
|
|
|
}
|
2019-02-22 00:47:27 +01:00
|
|
|
if (v != last_val) break;
|
2019-02-21 00:48:29 +01:00
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
last_gid = gid;
|
2019-02-21 00:48:29 +01:00
|
|
|
}
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
map_count = last_gid + 1;
|
|
|
|
for (gid = 0; gid < map_count; gid++)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
|
|
|
hb_codepoint_t old_gid;
|
2019-02-22 00:47:27 +01:00
|
|
|
if (!plan->old_gid_for_new_gid (gid, &old_gid))
|
2019-02-21 00:48:29 +01:00
|
|
|
continue;
|
|
|
|
unsigned int v = index_map.map (old_gid);
|
|
|
|
unsigned int outer = v >> 16;
|
|
|
|
unsigned int inner = v & 0xFFFF;
|
|
|
|
if (inner > max_inners[outer]) max_inners[outer] = inner;
|
|
|
|
inner_remaps[outer].add (inner);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
void fini (void)
|
|
|
|
{
|
|
|
|
max_inners.fini ();
|
|
|
|
output_map.fini ();
|
|
|
|
}
|
2019-02-21 00:48:29 +01:00
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
void remap (const hb_subset_plan_t *plan,
|
|
|
|
const DeltaSetIndexMap *input_map,
|
|
|
|
const hb_vector_t<hb_map2_t> &inner_remaps)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
|
|
|
for (unsigned int i = 0; i < max_inners.length; i++)
|
|
|
|
{
|
|
|
|
unsigned int bit_count = hb_bit_storage (inner_remaps[i][max_inners[i]]);
|
|
|
|
if (bit_count > inner_bit_count) inner_bit_count = bit_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
output_map.resize (map_count);
|
2019-02-22 00:47:27 +01:00
|
|
|
for (hb_codepoint_t gid = 0; gid < output_map.length; gid++)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
2019-02-22 00:47:27 +01:00
|
|
|
hb_codepoint_t old_gid = 0;
|
|
|
|
(void)plan->old_gid_for_new_gid (gid, &old_gid);
|
|
|
|
unsigned int v = input_map->map (old_gid);
|
2019-02-21 00:48:29 +01:00
|
|
|
unsigned int outer = v >> 16;
|
2019-02-22 00:47:27 +01:00
|
|
|
output_map[gid] = (outer << 16) | (inner_remaps[outer][v & 0xFFFF]);
|
2019-02-21 00:48:29 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
unsigned int get_inner_bit_count (void) const { return inner_bit_count; }
|
2019-02-21 00:48:29 +01:00
|
|
|
unsigned int get_width (void) const { return ((outer_bit_count + inner_bit_count + 7) / 8); }
|
|
|
|
unsigned int get_map_count (void) const { return map_count; }
|
|
|
|
|
|
|
|
unsigned int get_size (void) const
|
|
|
|
{ return (map_count? (DeltaSetIndexMap::min_size + get_width () * map_count): 0); }
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
hb_array_t<const unsigned int> get_output_map (void) const { return output_map.as_array (); }
|
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
protected:
|
|
|
|
unsigned int map_count;
|
|
|
|
hb_vector_t<unsigned int>
|
|
|
|
max_inners;
|
|
|
|
unsigned int outer_bit_count;
|
|
|
|
unsigned int inner_bit_count;
|
2019-02-22 00:47:27 +01:00
|
|
|
hb_vector_t<unsigned int>
|
|
|
|
output_map;
|
2019-02-21 00:48:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct hvarvvar_subset_plan_t
|
|
|
|
{
|
|
|
|
hvarvvar_subset_plan_t() : inner_remaps (), index_map_plans () {}
|
|
|
|
~hvarvvar_subset_plan_t() { fini (); }
|
|
|
|
|
|
|
|
void init (const hb_array_t<const DeltaSetIndexMap *> &index_maps,
|
|
|
|
const VariationStore &_var_store,
|
|
|
|
const hb_subset_plan_t *plan)
|
|
|
|
{
|
|
|
|
index_map_plans.resize (index_maps.length);
|
2019-02-22 00:47:27 +01:00
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
var_store = &_var_store;
|
|
|
|
inner_remaps.resize (var_store->get_sub_table_count ());
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < inner_remaps.length; i++)
|
|
|
|
inner_remaps[i].init ();
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < index_maps.length; i++)
|
|
|
|
index_map_plans[i].init (*index_maps[i], inner_remaps, plan);
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < inner_remaps.length; i++)
|
|
|
|
if (inner_remaps[i].get_count () > 0) inner_remaps[i].reorder ();
|
|
|
|
|
|
|
|
for (unsigned int i = 0; i < index_maps.length; i++)
|
2019-02-22 00:47:27 +01:00
|
|
|
index_map_plans[i].remap (plan, index_maps[i], inner_remaps);
|
2019-02-21 00:48:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void fini (void)
|
|
|
|
{
|
|
|
|
inner_remaps.fini_deep ();
|
|
|
|
index_map_plans.fini_deep ();
|
|
|
|
}
|
|
|
|
|
|
|
|
hb_vector_t<hb_map2_t> inner_remaps;
|
|
|
|
hb_vector_t<index_map_subset_plan_t>
|
|
|
|
index_map_plans;
|
|
|
|
const VariationStore *var_store;
|
|
|
|
};
|
2017-01-23 20:41:43 +01:00
|
|
|
|
|
|
|
/*
|
2018-04-12 11:08:19 +02:00
|
|
|
* HVAR -- Horizontal Metrics Variations
|
|
|
|
* https://docs.microsoft.com/en-us/typography/opentype/spec/hvar
|
|
|
|
* VVAR -- Vertical Metrics Variations
|
|
|
|
* https://docs.microsoft.com/en-us/typography/opentype/spec/vvar
|
2017-01-23 20:41:43 +01:00
|
|
|
*/
|
|
|
|
#define HB_OT_TAG_HVAR HB_TAG('H','V','A','R')
|
|
|
|
#define HB_OT_TAG_VVAR HB_TAG('V','V','A','R')
|
|
|
|
|
|
|
|
struct HVARVVAR
|
|
|
|
{
|
2019-01-22 12:08:57 +01:00
|
|
|
static constexpr hb_tag_t HVARTag = HB_OT_TAG_HVAR;
|
|
|
|
static constexpr hb_tag_t VVARTag = HB_OT_TAG_VVAR;
|
2017-01-23 20:41:43 +01:00
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
enum index_map_index_t {
|
|
|
|
ADV_INDEX,
|
|
|
|
LSB_INDEX,
|
|
|
|
RSB_INDEX,
|
|
|
|
TSB_INDEX,
|
|
|
|
VORG_INDEX
|
|
|
|
};
|
|
|
|
|
2018-12-16 20:08:10 +01:00
|
|
|
bool sanitize (hb_sanitize_context_t *c) const
|
2017-01-23 20:41:43 +01:00
|
|
|
{
|
|
|
|
TRACE_SANITIZE (this);
|
|
|
|
return_trace (version.sanitize (c) &&
|
|
|
|
likely (version.major == 1) &&
|
|
|
|
varStore.sanitize (c, this) &&
|
|
|
|
advMap.sanitize (c, this) &&
|
|
|
|
lsbMap.sanitize (c, this) &&
|
|
|
|
rsbMap.sanitize (c, this));
|
|
|
|
}
|
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
bool serialize_index_maps (hb_serialize_context_t *c,
|
2019-02-22 00:47:27 +01:00
|
|
|
const hb_array_t<index_map_subset_plan_t> &im_plans)
|
2019-02-21 00:48:29 +01:00
|
|
|
{
|
|
|
|
TRACE_SUBSET (this);
|
2019-02-22 00:47:27 +01:00
|
|
|
if (im_plans[ADV_INDEX].get_map_count () == 0)
|
|
|
|
advMap.set (0);
|
|
|
|
else if (unlikely (!advMap.serialize (c, this).serialize (c, im_plans[ADV_INDEX])))
|
2019-02-21 00:48:29 +01:00
|
|
|
return_trace (false);
|
2019-02-22 00:47:27 +01:00
|
|
|
if (im_plans[LSB_INDEX].get_map_count () == 0)
|
|
|
|
lsbMap.set (0);
|
|
|
|
else if (unlikely (!lsbMap.serialize (c, this).serialize (c, im_plans[LSB_INDEX])))
|
2019-02-21 00:48:29 +01:00
|
|
|
return_trace (false);
|
2019-02-22 00:47:27 +01:00
|
|
|
if (im_plans[RSB_INDEX].get_map_count () == 0)
|
|
|
|
rsbMap.set (0);
|
|
|
|
else if (unlikely (!rsbMap.serialize (c, this).serialize (c, im_plans[RSB_INDEX])))
|
2019-02-21 00:48:29 +01:00
|
|
|
return_trace (false);
|
2019-02-22 00:47:27 +01:00
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
return_trace (true);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
bool _subset (hb_subset_context_t *c) const
|
|
|
|
{
|
|
|
|
TRACE_SUBSET (this);
|
|
|
|
hvarvvar_subset_plan_t hvar_plan;
|
|
|
|
hb_vector_t<const DeltaSetIndexMap *>
|
|
|
|
index_maps;
|
|
|
|
|
|
|
|
index_maps.push (&(this+advMap));
|
|
|
|
index_maps.push (&(this+lsbMap));
|
|
|
|
index_maps.push (&(this+rsbMap));
|
|
|
|
hvar_plan.init (index_maps.as_array (), this+varStore, c->plan);
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
T *out = c->serializer->allocate_min<T> ();
|
2019-02-21 00:48:29 +01:00
|
|
|
if (unlikely (!out)) return_trace (false);
|
|
|
|
|
|
|
|
out->version.major.set (1);
|
|
|
|
out->version.minor.set (0);
|
|
|
|
|
2019-02-22 00:47:27 +01:00
|
|
|
if (!unlikely (out->varStore.serialize (c->serializer, out)
|
2019-02-21 00:48:29 +01:00
|
|
|
.serialize (c->serializer, hvar_plan.var_store, hvar_plan.inner_remaps.as_array ())))
|
|
|
|
return_trace (false);
|
|
|
|
|
|
|
|
return_trace (out->T::serialize_index_maps (c->serializer,
|
2019-02-22 00:47:27 +01:00
|
|
|
hvar_plan.index_map_plans.as_array ()));
|
2019-02-21 00:48:29 +01:00
|
|
|
}
|
|
|
|
|
2018-12-16 20:08:10 +01:00
|
|
|
float get_advance_var (hb_codepoint_t glyph,
|
|
|
|
const int *coords, unsigned int coord_count) const
|
2017-01-23 20:56:08 +01:00
|
|
|
{
|
|
|
|
unsigned int varidx = (this+advMap).map (glyph);
|
|
|
|
return (this+varStore).get_delta (varidx, coords, coord_count);
|
|
|
|
}
|
|
|
|
|
2018-12-17 19:01:01 +01:00
|
|
|
bool has_sidebearing_deltas () const { return lsbMap && rsbMap; }
|
2017-01-23 20:56:08 +01:00
|
|
|
|
2017-01-23 20:41:43 +01:00
|
|
|
protected:
|
|
|
|
FixedVersion<>version; /* Version of the metrics variation table
|
|
|
|
* initially set to 0x00010000u */
|
|
|
|
LOffsetTo<VariationStore>
|
|
|
|
varStore; /* Offset to item variation store table. */
|
|
|
|
LOffsetTo<DeltaSetIndexMap>
|
|
|
|
advMap; /* Offset to advance var-idx mapping. */
|
|
|
|
LOffsetTo<DeltaSetIndexMap>
|
|
|
|
lsbMap; /* Offset to lsb/tsb var-idx mapping. */
|
|
|
|
LOffsetTo<DeltaSetIndexMap>
|
|
|
|
rsbMap; /* Offset to rsb/bsb var-idx mapping. */
|
|
|
|
|
|
|
|
public:
|
|
|
|
DEFINE_SIZE_STATIC (20);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct HVAR : HVARVVAR {
|
2019-01-22 12:08:57 +01:00
|
|
|
static constexpr hb_tag_t tableTag = HB_OT_TAG_HVAR;
|
2019-02-21 00:48:29 +01:00
|
|
|
bool subset (hb_subset_context_t *c) const { return HVARVVAR::_subset<HVAR> (c); }
|
2017-01-23 20:41:43 +01:00
|
|
|
};
|
|
|
|
struct VVAR : HVARVVAR {
|
2019-01-22 12:08:57 +01:00
|
|
|
static constexpr hb_tag_t tableTag = HB_OT_TAG_VVAR;
|
2017-01-23 20:41:43 +01:00
|
|
|
|
2018-12-16 20:08:10 +01:00
|
|
|
bool sanitize (hb_sanitize_context_t *c) const
|
2017-01-23 20:41:43 +01:00
|
|
|
{
|
|
|
|
TRACE_SANITIZE (this);
|
|
|
|
return_trace (static_cast<const HVARVVAR *> (this)->sanitize (c) &&
|
|
|
|
vorgMap.sanitize (c, this));
|
|
|
|
}
|
|
|
|
|
2019-02-21 00:48:29 +01:00
|
|
|
bool subset (hb_subset_context_t *c) const { return HVARVVAR::_subset<VVAR> (c); }
|
|
|
|
|
2017-01-23 20:41:43 +01:00
|
|
|
protected:
|
|
|
|
LOffsetTo<DeltaSetIndexMap>
|
|
|
|
vorgMap; /* Offset to vertical-origin var-idx mapping. */
|
|
|
|
|
|
|
|
public:
|
|
|
|
DEFINE_SIZE_STATIC (24);
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace OT */
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* HB_OT_VAR_HVAR_TABLE_HH */
|