# How do you increase the spacing on text within LibGDX labels

So I'm following along with some tutorials for creating an application with LibGDX, and when I go to print parts of the UI to the screen, the text is all bunched up. How do I increase the spacing, or is it due to something else I've done?

....
game = gam;
stage = new Stage(new StretchViewport(800, 400));
Gdx.input.setInputProcessor(stage);
uiSkin = new Skin(Gdx.files.internal("uiskin.json"), new TextureAtlas(Gdx.files.internal("uiskin.atlas")));
Label nameLabel = new Label("Name:", uiSkin);
TextField nameText = new TextField("", uiSkin);
TextField addressText = new TextField("", uiSkin);

table = new Table();
table.row();
table.setFillParent(true);
table.setDebug(true);


Okay, feeling silly now. It was due to the fact that I set such an odd aspect ratio when I initialised my Stage. I passed in half the width and height of the phone screen instead, and it comes up a lot neater.

• Your viewport size ratio should match the one of the device screen :) Nov 23 '16 at 13:15
• I haven't been able to mark my own answer as accepted cause I don't have enough points to do so until after 2 days, but the problem has been solved Nov 25 '16 at 12:38
• All right :) Don't forget to come back and accept it! Nov 25 '16 at 12:38

For later questions, to answer them directly - there are parameters in fonts that are responsible for line height and it's spacing in LibGDX.

You can find it in your .fnt file and BitmapFontData.

.fnt file:

BitmapFontData:

• Spacing seems to be totally ignored. I tried setting it to 2000 even and it didn't change at all. Jun 10 '20 at 11:01