From 00e13985fbc5291850b8ea3d021e5f83c8a297e3 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sat, 20 Jul 2019 23:03:51 +0430 Subject: [PATCH] Revert hhea fallback to OS/2 to its reverse way As searching number of hhea having fonts beats the number of OS/2 having ones in macOS 10.14.2 --- src/hb-ot-metrics.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-metrics.cc b/src/hb-ot-metrics.cc index 8b98511ee..ecdba46ae 100644 --- a/src/hb-ot-metrics.cc +++ b/src/hb-ot-metrics.cc @@ -69,14 +69,14 @@ hb_ot_metrics_get_position_common (hb_font_t *font, (position && (*position = font->em_scalef_y (_fix_ascender_descender ( \ face->table.TABLE->ATTR + GET_VAR, metrics_tag))), true)) case HB_OT_METRICS_HORIZONTAL_ASCENDER: - return (!face->table.OS2->use_typo_metrics () && GET_METRIC_Y (hhea, ascender)) || - GET_METRIC_Y (OS2, sTypoAscender); + return (face->table.OS2->use_typo_metrics () && GET_METRIC_Y (OS2, sTypoAscender)) || + GET_METRIC_Y (hhea, ascender); case HB_OT_METRICS_HORIZONTAL_DESCENDER: - return (!face->table.OS2->use_typo_metrics () && GET_METRIC_Y (hhea, descender)) || - GET_METRIC_Y (OS2, sTypoDescender); + return (face->table.OS2->use_typo_metrics () && GET_METRIC_Y (OS2, sTypoDescender)) || + GET_METRIC_Y (hhea, descender); case HB_OT_METRICS_HORIZONTAL_LINE_GAP: - return (!face->table.OS2->use_typo_metrics () && GET_METRIC_Y (hhea, lineGap)) || - GET_METRIC_Y (OS2, sTypoLineGap); + return (face->table.OS2->use_typo_metrics () && GET_METRIC_Y (OS2, sTypoLineGap)) || + GET_METRIC_Y (hhea, lineGap); case HB_OT_METRICS_VERTICAL_ASCENDER: return GET_METRIC_X (vhea, ascender); case HB_OT_METRICS_VERTICAL_DESCENDER: return GET_METRIC_X (vhea, descender); case HB_OT_METRICS_VERTICAL_LINE_GAP: return GET_METRIC_X (vhea, lineGap);