Introduction
Depending on the genre of your awesome game project, you may need to show the user more or less text. Role-playing games and some adventures tend to be very text-heavy, while action games … well, they let the guns do the talking. However, in all likeness, all of these will require some font rendering, even if it is just for the menus or the game scores.
This chapter will start with the very basics of how to generate a Libgdx-compatible font and render some text with it on the screen. We will then move on to effects such as drop shadows or outlines, both using prebaked techniques and shaders. Additionally, we will tackle the font-scaling problem and offer a practical solution using distance field fonts.
By the time you finish reading and practicing with the samples, you will be able to handle most font-rendering issues in your game without too much trouble.