From 02e0e9394b42d8f5290a2e9699890b180c09d151 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 19 May 2023 13:18:06 -0600 Subject: [PATCH] [layout] Fetch default font extents if localized extents not found --- src/hb-ot-layout.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 1ef9ac50f..bc0937e6b 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -2068,6 +2068,12 @@ choose_base_tags (hb_script_t script, * Fetches script/language-specific font extents. These values are * looked up in the `BASE` table's `MinMax` records. * + * If no such extents are found, the default extents for the font are + * fetched. As such, the return value of this function can for the + * most part be ignored. Note that the per-script/language extents + * do not have a line-gap value, and the line-gap is set to zero in + * that case. + * * Return value: `true` if found script/language-specific font extents. * * XSince: REPLACEME @@ -2092,6 +2098,7 @@ hb_ot_layout_get_font_extents (hb_font_t *font, return true; } + hb_font_get_extents_for_direction (font, direction, extents); return false; } @@ -2106,6 +2113,12 @@ hb_ot_layout_get_font_extents (hb_font_t *font, * Fetches script/language-specific font extents. These values are * looked up in the `BASE` table's `MinMax` records. * + * If no such extents are found, the default extents for the font are + * fetched. As such, the return value of this function can for the + * most part be ignored. Note that the per-script/language extents + * do not have a line-gap value, and the line-gap is set to zero in + * that case. + * * Return value: `true` if found script/language-specific font extents. * * XSince: REPLACEME