memononen / fontstash

Light-weight online font texture atlas builder
zlib License
688 stars 88 forks source link

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

Open tailangjun opened 7 years ago

tailangjun commented 7 years ago

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?

tailangjun commented 7 years ago

华文黑体.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.

memononen commented 7 years ago

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.

tailangjun commented 7 years ago

1.use PingFang Regular.ttf usepingfang

2.华文黑体.ttf usehuawen

tailangjun commented 7 years ago

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