TrueType Font Text

Description

Internally AppGameKit Studio represents fonts using images, whereby each character is placed onto an image and can then be utilised by the text commands.

For many situations the usage of the default font will be more than adequate, especially when displaying information on screen to assist with debugging. However, many games may require an extra element of customization that necessitates the use of different looking fonts.

TrueType Fonts

With just one command you can improve the quality of the text in AppGameKit Studio. We recommend you use this in all of your projects to ensure they look their best.


This one command UseNewDefaultFonts() will change the text system to start using TrueType Fonts. Here's some code to illustrate:

UseNewDefaultFonts(1)
do
	Print ("True Type Fonts look GREAT!")
    Sync ( )
loop

Will produce this result:

Let's say you want to use a different TrueType Font to match the style of your app. All that's required is for the TrueType font to be copied into the media folder of your project and then you use the Load Font() command to load it at the start of your project and then use SetPrintFont() to ensure all future Print() commands use the new style font. Take a look at this small example and note the command line FontID=LoadFont("comicbd.ttf"), this is where the font is loaded.

UseNewDefaultFonts(1)
FontID=LoadFont("comicbd.ttf")
SetPrintFont(FontID)
SetPrintSize(10)
do
	Print("This test is using COMIC Sans!")
	Sync()
loop

Will produce this result:

Conclusion

To create more pleasing and professional results, use the TrueType font support built into AppGameKit Studio.