diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-05 10:35:10 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-05 10:35:10 +0200 |
commit | 8fcc7a52dcb731ec85270bf7d67d471b2dfaf6c5 (patch) | |
tree | d96da4833562a60146ccd993a8f7cbbbf5627068 /thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh | |
parent | f6a78f83aa4b74aa5cb80ca2e3419448b1998e4f (diff) | |
download | redot-engine-8fcc7a52dcb731ec85270bf7d67d471b2dfaf6c5.tar.gz |
harfbuzz: Update to 8.4.0
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh b/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh index 89640b43f1..48bd536121 100644 --- a/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh @@ -145,6 +145,29 @@ struct hmtxvmtx table->minTrailingBearing = min_rsb; table->maxExtent = max_extent; } + + if (T::is_horizontal) + { + const auto &OS2 = *c->plan->source->table.OS2; + if (OS2.has_data () && + table->ascender == OS2.sTypoAscender && + table->descender == OS2.sTypoDescender && + table->lineGap == OS2.sTypoLineGap) + { + table->ascender = static_cast<int> (roundf (OS2.sTypoAscender + + MVAR.get_var (HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, + c->plan->normalized_coords.arrayZ, + c->plan->normalized_coords.length))); + table->descender = static_cast<int> (roundf (OS2.sTypoDescender + + MVAR.get_var (HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER, + c->plan->normalized_coords.arrayZ, + c->plan->normalized_coords.length))); + table->lineGap = static_cast<int> (roundf (OS2.sTypoLineGap + + MVAR.get_var (HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP, + c->plan->normalized_coords.arrayZ, + c->plan->normalized_coords.length))); + } + } } #endif @@ -374,7 +397,7 @@ struct hmtxvmtx unsigned get_advance_with_var_unscaled (hb_codepoint_t glyph, hb_font_t *font, - VariationStore::cache_t *store_cache = nullptr) const + ItemVariationStore::cache_t *store_cache = nullptr) const { unsigned int advance = get_advance_without_var_unscaled (glyph); |