Bug 472502 - line-height: normal may be too small for some fonts
Summary: line-height: normal may be too small for some fonts
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Text (show other bugs)
Version: git master (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-22 15:43 UTC by Alvin Wong
Modified: 2023-08-27 16:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshots (39.07 KB, image/png)
2023-07-22 15:43 UTC, Alvin Wong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvin Wong 2023-07-22 15:43:39 UTC
Created attachment 160450 [details]
screenshots

For example, Microsoft JhengHei (built-in Traditiona Chinese font on Windows) looks a bit too tight. FIrefox/Chrome appears to use taller metrics.

Font metrics:

Win Ascent: 2203
WIn Descent: 521
Typo Ascent: 1823
Typo Descent: -225
Typo Line Gap: 0
HHead Ascent: 2203
HHead Descent: -521
HHead Line Gap: 0
VHead Column Spacing: 0
Capital Height: 1549
X Height: 1106
Comment 1 Alvin Wong 2023-08-12 14:05:17 UTC
Looks like Source Han Sans has a similar problem.
Comment 2 Bug Janitor Service 2023-08-18 18:01:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1906
Comment 3 Alvin Wong 2023-08-27 16:47:06 UTC
Git commit 2e1bc2bfbd124693d3e7a0848788b670fd730804 by Alvin Wong.
Committed on 27/08/2023 at 18:46.
Pushed by alvinwong into branch 'master'.

text: Also consider HHEA metrics for default line height

If USE_TYPO_METRICS is not set, also get the HHEA
ascender/descender/lineGap metrics, then compare it with the OS/2 sTypo
metrics and choose the larger line height. This fixes certain fonts
having a default line height that is too tight (e.g. Microsoft JhengHei,
Source Han Sans).

M  +23   -8    libs/flake/text/KoSvgTextShape_p_layout.cpp

https://invent.kde.org/graphics/krita/-/commit/2e1bc2bfbd124693d3e7a0848788b670fd730804
Comment 4 Alvin Wong 2023-08-27 16:47:54 UTC
Git commit 5f00891204e41a0880dd593bf16b996561c55c1a by Alvin Wong.
Committed on 27/08/2023 at 18:47.
Pushed by alvinwong into branch 'krita/5.2'.

text: Also consider HHEA metrics for default line height

If USE_TYPO_METRICS is not set, also get the HHEA
ascender/descender/lineGap metrics, then compare it with the OS/2 sTypo
metrics and choose the larger line height. This fixes certain fonts
having a default line height that is too tight (e.g. Microsoft JhengHei,
Source Han Sans).
(cherry picked from commit 2e1bc2bfbd124693d3e7a0848788b670fd730804)

M  +23   -8    libs/flake/text/KoSvgTextShape_p_layout.cpp

https://invent.kde.org/graphics/krita/-/commit/5f00891204e41a0880dd593bf16b996561c55c1a