Closed olliwang closed 4 years ago
How will this affect how western multiline text is rendered? i.e. the nanovg demo.
This doesn't affect western multiline at all.
PS. In my previous PR of fixing font size, the font size now matches what you saw on other native apps. The font used by the demo was affected by this because the font sizes were set to a value bigger than they actually were. I'm still fixing the font sizes and will submit another PR later.
Just submitted a PR to fix demo's font size. #564
The result looks exactly the same with or without this PR's changes of fixing the line gap issue.
BEFORE:
AFTER:
Thanks for the fix!
Thanks for the quick merging. Cheers! 🥂
iOS uses the
Hiragino Sans
font as the default Japanese font. However, this font abuses theline gap
property like many fonts.line gap
as theline height
.line gap
to 200.Back to the
Hiragino
font. The font family always setsline gap
to 500 no matter what while thefont height (ascent - descent)
is only 1000. Which causes the spaces between lines are super big.As mentioned here https://stackoverflow.com/questions/5414730/custom-installed-font-not-displayed-correctly-in-uilabel, Apple ignores the
line gap
property since iOS 7, and a workaround to fix this issue is to add theline gap
to theascent
and we'll be fine to ignore theline gap
property. Now the result looks much normal.This change doesn't affect the alignment, either.