diff options
| author | YAMAMOTO Mitsuharu | 2022-08-11 18:16:24 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2022-08-11 18:16:24 +0900 |
| commit | ae348b719e8f1c29c3ee6ed5d723326b3bc54883 (patch) | |
| tree | c41366d18978bf1fff250e6390149365862b03dc /src | |
| parent | 648acc8848422ef07fd1620a4ce1444d636db27b (diff) | |
| download | emacs-ae348b719e8f1c29c3ee6ed5d723326b3bc54883.tar.gz emacs-ae348b719e8f1c29c3ee6ed5d723326b3bc54883.zip | |
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) | |||
| 568 | 568 | ||
| 569 | ftcrfont_info->ft_size = ft_face->size; | 569 | ftcrfont_info->ft_size = ft_face->size; |
| 570 | hb_font_t *hb_font = fthbfont_begin_hb_font (font, position_unit); | 570 | hb_font_t *hb_font = fthbfont_begin_hb_font (font, position_unit); |
| 571 | if (ftcrfont_info->bitmap_position_unit) | 571 | /* HarfBuzz 5 correctly scales bitmap-only fonts without position |
| 572 | unit adjustment. | ||
| 573 | (https://github.com/harfbuzz/harfbuzz/issues/489) */ | ||
| 574 | if (!hb_version_atleast (5, 0, 0) | ||
| 575 | && ftcrfont_info->bitmap_position_unit) | ||
| 572 | *position_unit = ftcrfont_info->bitmap_position_unit; | 576 | *position_unit = ftcrfont_info->bitmap_position_unit; |
| 573 | 577 | ||
| 574 | return hb_font; | 578 | return hb_font; |