Font@ UI::LoadFont(const string&in filename, float size = 16.0f, const uint[]@ ranges = null, bool fallback = false, bool fallbackExtendedIcons = false, bool fallbackArial = false)
Loads a font for use in the UI API. Note that fonts can take up a lot of memory, so be careful in how many characters you request here! The defaults are usually enough. The font loads instantly (is a free call) for the following font combinations: "DroidSans-Bold.ttf" at size 16, "DroidSansMono.ttf" at size 16, "DroidSans.ttf" at size 20 or 26.
string
filename
The path of the font to load. Must be relative to the root of your plugin. For legacy reasons, this can also be the user fonts folder, or Openplanet's own fonts folder.
float
size
The size of the font in pixels. The size is automatically scaled by UI::GetScale().
const uint[]@
ranges
A range of characters to add to the font. Leave this null to use the default (0x20 through 0xFF), which is typically fine.
bool
fallback
Whether to load icon fonts as a fallback. Warning: Don't use fallback fonts if you don't need them! Fallback fonts cost a lot of memory!
bool
fallbackExtendedIcons
Whether to load extended icons (emojis & symbols) as part of the fallback. For this to work, fallback
must be true.
bool
fallbackArial
Whether to load Arial as part of the fallback. This allows for many more Unicode characters to render. For this to work, fallback
must be true.
UI::Font@
Font@ UI::LoadFont(const string&in filename, float size, int minChars, int maxChars, bool fallback = false, bool fallbackExtendedIcons = false, bool fallbackArial = false)
Loads a font for use in the UI API. Consider using the first LoadFont
overload instead of this one, as it is slightly simpler. Note that fonts can take up a lot of memory, so be careful in how many characters you request here! The defaults are usually enough. The font loads instantly (is a free call) for the following font combinations: "DroidSans-Bold.ttf" at size 16, "DroidSansMono.ttf" at size 16, "DroidSans.ttf" at size 20 or 26.
string
filename
The path of the font to load. Must be relative to the root of your plugin. For legacy reasons, this can also be the user fonts folder, or Openplanet's own fonts folder.
float
size
The size of the font in pixels. The size is automatically scaled by UI::GetScale().
int
minChars
The first character to add to the font. Use -1 to start from 0x20.
int
maxChars
The last character to add to the font. Use -1 to end at 0xFF.
bool
fallback
Whether to load icon fonts as a fallback. Warning: Don't use fallback fonts if you don't need them! Fallback fonts cost a lot of memory!
bool
fallbackExtendedIcons
Whether to load extended icons (emojis & symbols) as part of the fallback. For this to work, fallback
must be true.
bool
fallbackArial
Whether to load Arial as part of the fallback. This allows for many more Unicode characters to render. For this to work, fallback
must be true.
UI::Font@