# Is reusing BitmapFonts possible in GDX?

I'm loading multiple labels (100+) with different font types (max 10), but they have different sizes.

As I read the code and did the research, it's not possible to 'reuse' the font.

For instance, I have 5 labels made with GILL_SANS font but these labels must have different scales (font scales).

Should I really make 5 different BitmapFont objects for different scales (AND LOAD THESE TERRIBLE GRAPHICS AGAIN AND AGAIN) or is there any way to optimize this (without loading .fnt and .png again)?

One load takes 2mbs of RAM (huge png) + ~2ms which is unacceptable for 100 labels.

Edit I've check that. Label caches fonts so you can scale the same font and use setFontScale() on each label. But what about TextField?

• One thing could be just load those letter that you are using – Alex Sifuentes Nov 3 '16 at 20:36

The best way to achieve this is to copy the whole Textfield class, add some variables like:
float fontScaleX, fontScaleY;
and scale and unscale them in draw().