I'm looking to have several icons within a label; for example a coin instead of a dollar sign. I'm using a TTF font, and as much as I'd like to keep it that way (simply because I've heard it's "better"), I've looked into using a Bitmap Font Generator to embed images and replacing some unicode characters with arbitrary icons specific to my game. Seems like you're not able to preserve color that way.

Here's an example tool I've looked at, Bitmap Font Generator, from the cocos2dx docs.

My question is there some other way to embed icons with color in either a TTF or BMP font, other than replacing arbitrary characters with icons?

  • \$\begingroup\$ In filling out the tags for this question, I've found 'Spritefonts' so I'm looking into that. I'm on C++ Cocos2d-x Android, if that's relevant. \$\endgroup\$ – TankorSmash Oct 31 '16 at 0:24
  • \$\begingroup\$ Whether you can use colors in your bitmap font only depends on the actual implementation. It's no generic limitation. Of course it can't be done using a TTF. You'd have to store the font as a texture resource. \$\endgroup\$ – Mario Oct 31 '16 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.