[metrics] Simplify
This commit is contained in:
parent
f1ba1f940f
commit
f7d49d9c2b
|
@ -163,10 +163,15 @@ hb_ot_metrics_get_position (hb_font_t *font,
|
||||||
|
|
||||||
case HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE:
|
case HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE:
|
||||||
case HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN:
|
case HB_OT_METRICS_TAG_HORIZONTAL_CARET_RUN:
|
||||||
|
{
|
||||||
|
unsigned mult = 1u;
|
||||||
|
|
||||||
|
if (font->slant)
|
||||||
{
|
{
|
||||||
unsigned rise = face->table.hhea->caretSlopeRise;
|
unsigned rise = face->table.hhea->caretSlopeRise;
|
||||||
unsigned upem = face->get_upem ();
|
unsigned upem = face->get_upem ();
|
||||||
unsigned mult = (font->slant && rise && rise < upem) ? hb_min (upem / rise, 256u) : 1u;
|
mult = (rise && rise < upem) ? hb_min (upem / rise, 256u) : 1u;
|
||||||
|
}
|
||||||
|
|
||||||
if (metrics_tag == HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE)
|
if (metrics_tag == HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE)
|
||||||
return mult * GET_METRIC_Y (hhea, caretSlopeRise);
|
return mult * GET_METRIC_Y (hhea, caretSlopeRise);
|
||||||
|
|
Loading…
Reference in New Issue