Poor font quality in CCLabelBMFont

为君一笑 提交于 2019-12-25 13:16:57

问题


Scaled screenshot on iPhone 5S:

CCLabelBMFont is on top and CCLabelTTF is at the bottom. Both strings use Helvetica Neue Light 17pt.

As you can see there is some kind of a stroke in the first string, but all symbols in font image are white on transparent background. Is it possible to get rid of this effect and make CCLabelBMFont look just as good as CCLabelTTF?

I used bmGlyph and other free analogs for Bitmap font creation, results were always the same.


回答1:


First, don't change the node's scale property or it will be blurry.

You need to make a HD version of the font, where the font's png filename has the -hd suffix and the font size is double that for non-Retina devices. For example:

Non-Retina font with 32pt size (if you support non-retina devices):

font.fnt
font.png

Then create a font with 64pt size and save it as:

font-hd.fnt
font-hd.png



回答2:


What a relief! Turned out it's because of Blend src property. I changed this property on my label from default in SpriteBuilder 'One' to 'Dst Alpha' and now it's impossible to see any difference between CCLabelTTF and CCLabelBMFont!



来源:https://stackoverflow.com/questions/23349585/poor-font-quality-in-cclabelbmfont

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!