[metrics] Fall back to hhea if OS2 metrics are empty

Reinstates previous logic, even if it might be unnecessary.
This commit is contained in:
Behdad Esfahbod 2019-07-19 11:13:50 -07:00
parent 2e5b49d11d
commit ec8dde8142
1 changed files with 6 additions and 6 deletions

View File

@ -60,14 +60,14 @@ hb_ot_metrics_get_position_internal (hb_face_t *face,
(face->table.TABLE->has_data () && \ (face->table.TABLE->has_data () && \
(position && (*position = face->table.TABLE->ATTR + GET_VAR), true)) (position && (*position = face->table.TABLE->ATTR + GET_VAR), true))
case HB_OT_METRICS_HORIZONTAL_ASCENDER: case HB_OT_METRICS_HORIZONTAL_ASCENDER:
return face->table.OS2->use_typo_metrics () ? return (face->table.OS2->use_typo_metrics () && GET_METRIC (OS2, sTypoAscender)) ||
GET_METRIC (OS2, sTypoAscender) : GET_METRIC (hhea, ascender); GET_METRIC (hhea, ascender);
case HB_OT_METRICS_HORIZONTAL_DESCENDER: case HB_OT_METRICS_HORIZONTAL_DESCENDER:
return face->table.OS2->use_typo_metrics () ? return (face->table.OS2->use_typo_metrics () && GET_METRIC (OS2, sTypoDescender)) ||
GET_METRIC (OS2, sTypoDescender) : GET_METRIC (hhea, descender); GET_METRIC (hhea, descender);
case HB_OT_METRICS_HORIZONTAL_LINE_GAP: case HB_OT_METRICS_HORIZONTAL_LINE_GAP:
return face->table.OS2->use_typo_metrics () ? return (face->table.OS2->use_typo_metrics () && GET_METRIC (OS2, sTypoLineGap)) ||
GET_METRIC (OS2, sTypoLineGap) : GET_METRIC (hhea, lineGap); GET_METRIC (hhea, lineGap);
case HB_OT_METRICS_HORIZONTAL_CLIPPING_ASCENT: return GET_METRIC (OS2, usWinAscent); case HB_OT_METRICS_HORIZONTAL_CLIPPING_ASCENT: return GET_METRIC (OS2, usWinAscent);
case HB_OT_METRICS_HORIZONTAL_CLIPPING_DESCENT: return GET_METRIC (OS2, usWinDescent); case HB_OT_METRICS_HORIZONTAL_CLIPPING_DESCENT: return GET_METRIC (OS2, usWinDescent);
case HB_OT_METRICS_VERTICAL_ASCENDER: return GET_METRIC (vhea, ascender); case HB_OT_METRICS_VERTICAL_ASCENDER: return GET_METRIC (vhea, ascender);