Table of Contents

Interface IImGuiFonts

Namespace
BSGameLib.Game
Assembly
BSGameLib.Game.dll

Chooses what ImGui can draw beyond its built-in font.

public interface IImGuiFonts

Remarks

ImGui bakes every glyph it will ever draw into one texture up front, and its built-in font has Latin letters only, so text in any other script comes out blank unless a font with those glyphs is baked in too. The font given here is merged into the built-in one: its glyphs fill in what the built-in font lacks, so English looks the same as before and another script draws in this font. A game passes the font its current language names.

Properties

FontPath

The TrueType font whose glyphs are merged in, or null for the built-in font alone.

string FontPath { get; }

Property Value

string

Script

Which script's glyphs are taken from FontPath: one of LanguageScripts's names.

string Script { get; }

Property Value

string

Methods

UseFont(string, string)

Merges a font's glyphs for a script into ImGui's font. Takes effect at the start of the next frame, when the font texture is rebuilt. A font that cannot be read is logged and leaves the built-in font alone.

void UseFont(string fontPath, string script)

Parameters

fontPath string

A .ttf or .otf file, or null to go back to the built-in font.

script string

A name from LanguageScripts; null or unknown means Latin.