unreal.Font

class unreal.Font(outer: Optional[Object] = None, name: Union[Name, str] = 'None')

Bases: Object

A font object, for use by Slate, UMG, and Canvas.

A font can either be:
  • Runtime cached - The font contains a series of TTF files that combine to form a composite font. The glyphs are cached on demand when required at runtime.

  • Offline cached - The font contains a series of textures containing pre-baked cached glyphs and their associated texture coordinates.

C++ Source:

  • Module: Engine

  • File: Font.h

Editor Properties: (see get_editor_property/set_editor_property)

  • ascent (float): [Read-Write] Ascent: todo: document

  • characters (Array[FontCharacter]): [Read-Write] Characters: List of characters in the font. For a MultiFont, this will include all characters in all sub-fonts! Thus,

    the number of characters in this array isn’t necessary the number of characters available in the font

  • descent (float): [Read-Write] Descent: todo: document

  • em_scale (float): [Read-Write] Em Scale: Font metrics.

  • font_cache_type (FontCacheType): [Read-Write] Font Cache Type: What kind of font caching should we use? This controls which options we see

  • import_options (FontImportOptionsData): [Read-Write] Import Options: Options used when importing this font

  • kerning (int32): [Read-Write] Kerning: Default horizontal spacing between characters when rendering text with this font

  • leading (float): [Read-Write] Leading: todo: document

  • legacy_font_name (Name): [Read-Write] Legacy Font Name: The default font name to use for legacy Canvas APIs that don’t specify a font name

  • legacy_font_size (int32): [Read-Write] Legacy Font Size: The default size of the font used for legacy Canvas APIs that don’t specify a font size

  • scaling_factor (float): [Read-Write] Scaling Factor: Scale to apply to the font.