From d52ea2a42ce9332564cc2f049734545796e0c79b Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 18 Feb 2020 15:46:02 +0330 Subject: [PATCH] [glyf] minor --- src/hb-ot-glyf-table.hh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 0a62c6cc1..6019866a2 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -962,10 +962,9 @@ struct glyf ? face->table.vmtx->get_advance (gid) : face->table.hmtx->get_advance (gid); - if (is_vertical) - return roundf (phantoms[PHANTOM_TOP].y - phantoms[PHANTOM_BOTTOM].y); - else - return roundf (phantoms[PHANTOM_RIGHT].x - phantoms[PHANTOM_LEFT].x); + return is_vertical + ? roundf (phantoms[PHANTOM_TOP].y - phantoms[PHANTOM_BOTTOM].y) + : roundf (phantoms[PHANTOM_RIGHT].x - phantoms[PHANTOM_LEFT].x); } int get_side_bearing_var (hb_font_t *font, hb_codepoint_t gid, bool is_vertical) const @@ -974,9 +973,13 @@ struct glyf contour_point_t phantoms[PHANTOM_COUNT]; if (unlikely (!get_points (font, gid, points_aggregator_t (font, &extents, phantoms)))) - return is_vertical ? face->table.vmtx->get_side_bearing (gid) : face->table.hmtx->get_side_bearing (gid); + return is_vertical + ? face->table.vmtx->get_side_bearing (gid) + : face->table.hmtx->get_side_bearing (gid); - return is_vertical ? ceil (phantoms[PHANTOM_TOP].y) - extents.y_bearing : floor (phantoms[PHANTOM_LEFT].x); + return is_vertical + ? ceil (phantoms[PHANTOM_TOP].y) - extents.y_bearing + : floor (phantoms[PHANTOM_LEFT].x); } #endif