Inherits: Font < Resource < Reference < Object

Category: Core

Brief Description

DynamicFont renders vector font files at runtime.

Member Functions

void add_fallback ( DynamicFontData data )
DynamicFontData get_fallback ( int idx ) const
int get_fallback_count ( ) const
void remove_fallback ( int idx )
void set_fallback ( int idx, DynamicFontData data )

Member Variables

  • int extra_spacing_bottom - Extra spacing at the bottom in pixels.
  • int extra_spacing_char - Extra character spacing in pixels.
  • int extra_spacing_space - Extra space spacing in pixels.
  • int extra_spacing_top - Extra spacing at the top in pixels.
  • DynamicFontData font_data - The font data.
  • int size - The font size.
  • bool use_filter - If true filtering is used.
  • bool use_mipmaps - If true mipmapping is used.


enum SpacingType

  • SPACING_TOP = 0 — Spacing at the top.
  • SPACING_BOTTOM = 1 — Spacing at the bottom.
  • SPACING_CHAR = 2 — Character spacing.
  • SPACING_SPACE = 3 — Space spacing.


DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like BitmapFont. This trades the faster loading time of BitmapFonts for the ability to change font parameters like size and spacing during runtime. DynamicFontData is used for referencing the font file paths.

Member Function Description

Adds a fallback font.

Returns the fallback font at index idx.

  • int get_fallback_count ( ) const

Returns the number of fallback fonts.

  • void remove_fallback ( int idx )

Removes the fallback font at index idx.

Sets the fallback font at index idx.