[metrics] Implement synthetic slant for caret slope
Part of https://github.com/harfbuzz/harfbuzz/pull/3338
This commit is contained in:
parent
fc329f665f
commit
fa008a021f
|
@ -167,10 +167,18 @@ hb_ot_metrics_get_position (hb_font_t *font,
|
|||
unsigned rise = face->table.hhea->caretSlopeRise;
|
||||
unsigned upem = face->get_upem ();
|
||||
unsigned mult = rise < upem ? upem / rise : 1;
|
||||
|
||||
if (metrics_tag == HB_OT_METRICS_TAG_HORIZONTAL_CARET_RISE)
|
||||
return mult * GET_METRIC_Y (hhea, caretSlopeRise);
|
||||
else
|
||||
return mult * GET_METRIC_X (hhea, caretSlopeRun);
|
||||
{
|
||||
unsigned run = mult * GET_METRIC_X (hhea, caretSlopeRun);
|
||||
|
||||
if (font->slant)
|
||||
run += _hb_roundf (mult * GET_METRIC_Y (hhea, caretSlopeRise) * font->slant);
|
||||
|
||||
return run;
|
||||
}
|
||||
}
|
||||
case HB_OT_METRICS_TAG_HORIZONTAL_CARET_OFFSET: return GET_METRIC_X (hhea, caretOffset);
|
||||
|
||||
|
|
Loading…
Reference in New Issue