Cocos2d 字体扩展问题
下午好,运动会!
我有一个快速的疑问。 我正在使用 COCOS2D,我需要知道是否可以使用除“.fnt”之外的其他扩展类型的字体。 因为我用了一些但没有任何运气。
我正在使用这段代码来制作“制作人员名单”场景:
CCBitmapFontAtlas* l_026 = [CCBitmapFontAtlas bitmapFontAtlasWithString:@"Look for our apps in the AppStore" fntFile:@"fission.fnt"];
如果不是,我可以使用哪个? 您知道有什么字体转换器可以将“普通字体”更改为“.fnt”吗?
谢谢!
Good afternoon, sports!
I have a fast doubt.
I'm using COCOS2D and i need to know if i can use other extension type of font other than ".fnt".
Because i used a few and didn't have any luck.
I'm using this piece of code to make a "credits" scene:
CCBitmapFontAtlas* l_026 = [CCBitmapFontAtlas bitmapFontAtlasWithString:@"Look for our apps in the AppStore" fntFile:@"fission.fnt"];
If it isn't which can i use?
And it is do you know any font converter to change "normal fonts" to ".fnt"
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为最好的字体程序是:Glyph Designer。它价格便宜,而且很容易制作出漂亮的字体。
我使用 CCLabelBMFont 但我很确定它基本上是相同的东西。
The best font program in my opinion is: Glyph Designer. It is inexpensive and very easy to make great looking fonts.
I use CCLabelBMFont but I'm pretty sure it is basically the same thing.
如果您有一些现金可以花,您可以按照 Aaron 的建议使用 Glyph Designer。但您也可以使用名为 Hiero 的免费 Java 工具。不过,您可能需要进行一些调整才能获得您想要的结果。
该工具将输出 2 个文件:一个
.png
和另一个.fnt
。将这些文件添加到您的 Xcode 项目中,并使用如下简单的行来使用它:请注意,每对 fnt/png 文件的字体大小是固定的,因此如果您想要使用不同的字体,则必须创建多对文件尺寸。此外,您还需要单独的视网膜和非视网膜显示模式对。
If you have some cash to spend you can use Glyph Designer as suggested by Aaron. But you can also use a free Java tool named Hiero. You might have to do some tweaking to get the result you want though.
The tool will output 2 files: one
.png
and another.fnt
. Add these files into your Xcode project and use it using simple lines like below:Do note though that the size of the font from each pair of fnt/png files is fixed, so you have to create multiple pairs if you want to have different font sizes. Also, you need separate pair for Retina and non-Retina display modes.