xcode CCLabelTTF 支持的字体?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12501567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:31:46  来源:igfitidea点击:

CCLabelTTF supported fonts?

iosxcodeios5fontscocos2d-iphone

提问by Shredder2794

Where can I find a list of supported fonts for CCLabelTTF? If I try setting the font of a CCLabel to a font like Bank Gothic xcode says that the font was unable to load. If you go to Edit>Format>Font>Show Fonts in xcode it gives you a list of the fonts in xcode and Bank Gothic is one of them so why wont it work with CCLabelTTF?

在哪里可以找到 CCLabelTTF 支持的字体列表?如果我尝试将 CCLabel 的字体设置为类似 Bank Gothic xcode 的字体,则表示该字体无法加载。如果您转到编辑>格式>字体>在 xcode 中显示字体,它会为您提供 xcode 中的字体列表,而 Bank Gothic 就是其中之一,为什么它不能与 CCLabelTTF 一起使用?

Thanks!

谢谢!

-Magnus

-马格努斯

回答by Majster

Included fonts are :

包括的字体是:

"American Typewriter"
"Arial"
"Arial Rounded MT Bold"
"Courier New"
"Georgia"
"Helvetica"
"Marker Felt"
"Times New Roman"
"Trebuchet MS"
"Verdana"
"Zapfino"

But you can add fonts very simply: Using custom fonts in Cocos2d

但是您可以非常简单地添加字体:在 Cocos2d 中使用自定义字体

回答by Morion

CCLabelTTF don't "support" any font. It just can render text with any font, that is available on the device. So, your mac has this font, but maybe, there is no such font on the iOS device. Anyway, you can add any font to the app as resource. Just don't forget to add it to the "Fonts provided by application" section of your info.plist.

CCLabelTTF 不“支持”任何字体。它只能使用设备上可用的任何字体呈现文本。所以,你的 Mac 有这种字体,但也许 iOS 设备上没有这种字体。无论如何,您可以将任何字体作为资源添加到应用程序中。只是不要忘记将其添加到 info.plist 的“应用程序提供的字体”部分。