Fonts

This section deals with the functions available for fonts.

GameMaker: Studio has a number of functions that can be used to get information about the included font assets, as well as a further set of functions that can be used to change, add or remove fonts from your game at run-time. In particular the function font_add() can be used to add non-standard fonts, like Asian glyph fonts, in *.ttf format.

It is worth noting is that if you add a font to your game that doesn't have the glyphs required by the text you wish to write, then the unicode character 9647 (▯) is used to substitute those missing glyphs when rendering it in the draw event. So if your font doesn't have, for example, the ° symbol, then writing 90° will actually produce 90▯.

Font Information

The following functions can be used to get information about font resources:

  1. font_get_name
  2. font_get_fontname
  3. font_get_first
  4. font_get_last
  5. font_get_italic
  6. font_get_bold
  7. font_get_size
  8. font_get_texture
  9. font_get_uvs

Font Manipulation

The following functions can be used to change and manipulate fonts during a game:

  1. font_set_cache_size
  2. font_exists
  3. font_add
  4. font_add_sprite
  5. font_add_sprite_ext
  6. font_replace
  7. font_replace_sprite
  8. font_replace_sprite_ext
  9. font_delete


Back: Game Assets
© Copyright YoYo Games Ltd. 2018 All Rights Reserved