memononen / fontstash

Light-weight online font texture atlas builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set the same size, use different ttf file, the text size of the display difference

tailangjun opened this issue · comments

In order to show Simplified Chinese, I tried several different ttf files. I found that set the same size, use different ttf file, the text size of the display difference. Should we need to read out some parameters from ttf file and set to fontstash?

华文黑体.ttf is bigger than UILabel, use the same fontsize.
诺基亚致美粗黑.ttf is same size with UILabel font size, , use the same fontsize.
PingFang Regular.ttf is smaller than UILabel, use the same fontsize.

Can you send a screenshot? Can you see the same difference in a text editor? I'm not sure about chinese characters, but western fonts can have different x-height and k-height. Which makes the fonts look different visually even if the size is the same.

1.use PingFang Regular.ttf
usepingfang

2.华文黑体.ttf
usehuawen

the PingFang Regular.ttf you can achieve use the following link.
https://github.com/ctrngk/backup/blob/master/PingFang%20Regular.ttf