1

The font-awesome icons are vector based, and from my understanding vector iamges are bad in apps since they are very big (in bytes), is this true for fontawesome icons? In theory, could I use these icons in my game, not only for menu buttons and such, but also for actual game graphics?

I'm planning on doing a very simple game, and I'd hate to get stuck on the design part, not only the drawing of them, but I've had trouble with scaling of images (according to screen size) in the past, vector images would solve this.

I realize icons are not optimal for game graphics, but would it be usable?

1
  • 2
    vector iamges are bad ... they are very big (in bytes), is this true This is false. Commented Oct 7, 2015 at 10:07

1 Answer 1

3

Vector based images are usually smaller than bitmap based images, because they just contain an abstract description of the image content, that can be scaled to virtually any size.

Your graphics card does not understand these kind of image formats though. You would have to convert them to a bitmap based format first, which means you have to set a specific size for the resulting image.

LibGDX offers the FreeType extension, to convert TrueType font files (.ttf) at runtime to a BitmapFont with a specific size, which can then be rendered.

That way you will be able to generate icons on the fly for the correct display size, without having to ship many different versions of them, for different resolutions.

Sign up to request clarification or add additional context in comments.

1 Comment

Using FreeType extension for LibGDX requires you to specify which characters (and unicode) from the font you'd like to use. Yes, you can use FontAwesome in game. FreeTypeFontGenerator gen = new FreeTypeFontGenerator(Gdx.files.internal("font/fontawesome.ttf")); FreeTypeFontParameter param = new FreeTypeFontParameter(); param.size = size; param.borderColor = new Color(0.2f, 0.2f, 0.2f, 1); param.borderStraight = true; param.borderWidth = 1; param.characters = "\u0000 \uF08A\uF004"; // Normally this is ABCDEF..01234 etc. BitmapFont font = gen.generateFont(param): by Exxon08

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.