Creating a label with SystemFont

Creating a label with SystemFont
0
#1

I just realized I had been using “createWithSystemFont” in my game with a .ttf file, but everything is working as expected, is there anything different going on behind the scenes ? and should I change all my labels to createWithTTF ?

auto fourthlabel = Label::createWithSystemFont(“Level 1”, “fonts/Marker Felt.ttf”, 65);

0 Likes

#2

Both methods should works ok: createWithSystemFont and createWithTTF
Often I use createWithSystemFont if i need a generic font that supports ALL languages (english, chinese, etc.). For example, if the variable text can be in all languages, i use:

Label::createWithSystemFont(text, "Arial", 14);

Because maybe my TTF file not supports all characters/languages.

2 Likes

#3

I use ttf for English and system for generic also. @tranthor has the right idea :slight_smile:

0 Likes

#4

in the book “Building android games with cocos2d-x” “Creating system fonts” it says “it is recommended you use this kind of label only for testing purposes, since it would decrease the frameworks flexibility because the selected font may not be available on the user’s Android” ???

0 Likes