[instancer ]update OS_2/post/glyf tables to accept Triple for axes positions

pull/4235/head
Qunxin Liu 2 years ago committed by Garret Rieger
parent 51c7451bb5
commit bf298e5050
  1. 2
      src/OT/glyf/glyf.hh
  2. 4
      src/hb-ot-os2-table.hh
  3. 2
      src/hb-ot-post-table.hh

@ -487,7 +487,7 @@ glyf::_create_font_for_instancing (const hb_subset_plan_t *plan) const
{
hb_variation_t var;
var.tag = _.first;
var.value = _.second;
var.value = _.second.middle;
vars.push (var);
}

@ -249,7 +249,7 @@ struct OS2
if (c->plan->user_axes_location.has (HB_TAG ('w','g','h','t')) &&
!c->plan->pinned_at_default)
{
float weight_class = c->plan->user_axes_location.get (HB_TAG ('w','g','h','t'));
float weight_class = c->plan->user_axes_location.get (HB_TAG ('w','g','h','t')).middle;
if (!c->serializer->check_assign (os2_prime->usWeightClass,
roundf (hb_clamp (weight_class, 1.0f, 1000.0f)),
HB_SERIALIZE_ERROR_INT_OVERFLOW))
@ -259,7 +259,7 @@ struct OS2
if (c->plan->user_axes_location.has (HB_TAG ('w','d','t','h')) &&
!c->plan->pinned_at_default)
{
float width = c->plan->user_axes_location.get (HB_TAG ('w','d','t','h'));
float width = c->plan->user_axes_location.get (HB_TAG ('w','d','t','h')).middle;
if (!c->serializer->check_assign (os2_prime->usWidthClass,
roundf (map_wdth_to_widthclass (width)),
HB_SERIALIZE_ERROR_INT_OVERFLOW))

@ -117,7 +117,7 @@ struct post
if (c->plan->user_axes_location.has (HB_TAG ('s','l','n','t')) &&
!c->plan->pinned_at_default)
{
float italic_angle = c->plan->user_axes_location.get (HB_TAG ('s','l','n','t'));
float italic_angle = c->plan->user_axes_location.get (HB_TAG ('s','l','n','t')).middle;
italic_angle = hb_max (-90.f, hb_min (italic_angle, 90.f));
post_prime->italicAngle.set_float (italic_angle);
}

Loading…
Cancel
Save