diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2022-08-11 18:16:24 +0900 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2022-08-11 18:16:24 +0900 |
commit | ae348b719e8f1c29c3ee6ed5d723326b3bc54883 (patch) | |
tree | c41366d18978bf1fff250e6390149365862b03dc /src | |
parent | 648acc8848422ef07fd1620a4ce1444d636db27b (diff) | |
download | emacs-ae348b719e8f1c29c3ee6ed5d723326b3bc54883.tar.gz |
Fix wrong metrics for bitmap-only fonts with HarfBuzz 5
* src/ftcrfont.c (ftcrhbfont_begin_hb_font): Always use the standard
position unit value on HarfBuzz 5 and later regardless of whether the
font is bitmap-only or not. (Bug#57066)
Diffstat (limited to 'src')
-rw-r--r-- | src/ftcrfont.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ftcrfont.c b/src/ftcrfont.c index 39ea068556b..d5d3e440af6 100644 --- a/src/ftcrfont.c +++ b/src/ftcrfont.c @@ -568,7 +568,11 @@ ftcrhbfont_begin_hb_font (struct font *font, double *position_unit) ftcrfont_info->ft_size = ft_face->size; hb_font_t *hb_font = fthbfont_begin_hb_font (font, position_unit); - if (ftcrfont_info->bitmap_position_unit) + /* HarfBuzz 5 correctly scales bitmap-only fonts without position + unit adjustment. + (https://github.com/harfbuzz/harfbuzz/issues/489) */ + if (!hb_version_atleast (5, 0, 0) + && ftcrfont_info->bitmap_position_unit) *position_unit = ftcrfont_info->bitmap_position_unit; return hb_font; |