提交 2bd953ff 编写于 作者: B Behdad Esfahbod

[metrics] Fix weird use of xor

I believe that was a try to use one approach as fallback to other.  But
felt wrong.  Just believe what's in OS/2 table to be correct.
上级 9675a067
...@@ -55,14 +55,14 @@ hb_ot_metrics_get_position_internal (hb_face_t *face, ...@@ -55,14 +55,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 + face->table.MVAR->get_var (metrics_tag, nullptr, 0)), true)) (position && (*position = face->table.TABLE->ATTR + face->table.MVAR->get_var (metrics_tag, nullptr, 0)), true))
case HB_OT_METRICS_HORIZONTAL_ASCENDER: case HB_OT_METRICS_HORIZONTAL_ASCENDER:
return (face->table.OS2->is_typo_metrics () ^ GET_METRIC (hhea, ascender)) || return face->table.OS2->use_typo_metrics () ?
GET_METRIC (OS2, sTypoAscender); GET_METRIC (OS2, sTypoAscender) : GET_METRIC (hhea, ascender);
case HB_OT_METRICS_HORIZONTAL_DESCENDER: case HB_OT_METRICS_HORIZONTAL_DESCENDER:
return (face->table.OS2->is_typo_metrics () ^ GET_METRIC (hhea, descender)) || return face->table.OS2->use_typo_metrics () ?
GET_METRIC (OS2, sTypoDescender); GET_METRIC (OS2, sTypoDescender) : GET_METRIC (hhea, descender);
case HB_OT_METRICS_HORIZONTAL_LINE_GAP: case HB_OT_METRICS_HORIZONTAL_LINE_GAP:
return (face->table.OS2->is_typo_metrics () ^ GET_METRIC (hhea, lineGap)) || return face->table.OS2->use_typo_metrics () ?
GET_METRIC (OS2, sTypoLineGap); GET_METRIC (OS2, sTypoLineGap) : 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);
......
...@@ -119,7 +119,7 @@ struct OS2 ...@@ -119,7 +119,7 @@ struct OS2
bool is_italic () const { return fsSelection & ITALIC; } bool is_italic () const { return fsSelection & ITALIC; }
bool is_oblique () const { return fsSelection & OBLIQUE; } bool is_oblique () const { return fsSelection & OBLIQUE; }
bool is_typo_metrics () const { return fsSelection & USE_TYPO_METRICS; } bool use_typo_metrics () const { return fsSelection & USE_TYPO_METRICS; }
enum width_class_t { enum width_class_t {
FWIDTH_ULTRA_CONDENSED = 1, /* 50% */ FWIDTH_ULTRA_CONDENSED = 1, /* 50% */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册