I am writing a game using libgdx, and I borrowed the skin.json (and related files) from a tutorial.
The font being used (default) was scaling in an ugly manner on denser screens, so I generated by own very large font - and in the game itself, I scale it to a reasonable size (basically I use BitmapFont.scale
). The font I'm now using is 3 times as large as the previous one.
I changed the reference to which font to use in the skin.json file, and as a result, all my buttons, titles and other things have a massive font being shown.
Is there a way of scaling the font in the .json file? Or anywhere else in the code? Skin doesn't have a setFont()
functionality, so I can't create a scaled BitmapFont and assign it)
Change system font size in Windows 10 In Settings, you can click Ease of Access. Click Display in the left panel. In the right window, you will see a Make text bigger option.
11) Open Steam and select Settings. 12) In Settings select Interface. 13) In Interface change the skin to 'IncFont' and click 'OK'. 14) Steam will restart with the new font size increases. If a font increase of 2 points is not enough for you, repeat step 9 adding a further 2 points. Keep repeating step 9 until you are happy with the results.
What to Know 1 The easiest way to make a font bigger onscreen is to use the keyboard shortcut for zoom; use the Ctrl or Cmd key and tap... 2 You can also use Windows or Mac Zoom settings from the Personalize or Preferences menu. 3 You may be able to make a font bigger using the settings in your favorite web browser, as well. More ...
How to Change the Font Size on My Mac Something else you can try if the other methods aren't working to increase the font size on your Mac is to adjust your computer's screen resolution: 1 From the main Apple menu, select System Preferences . 2 Choose Displays and then Display . 3 Select Scaled and then choose a lower resolution. See More....
Libgdx changed this back in April 2015 so that the set answer doesn't work anymore. Took a little bit to find the answer, so I thought I'd leave it here for others since this answer pops up first in Google.
this.getSkin().getFont("default-font").getData().setScale(0.33f,0.33f);
Documentation says that any gets will return a handle to the actual object. So changes will persist.
So I changed the font in skin.json to point to my new font.
Then I used this code
this.getSkin().getFont("default-font").setScale(0.33f, 0.33f);
To scale the 'default-font' (as defined in the skin.json) to the scale I wanted (in my case its 0.33f)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With