mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[wpigui] Add font selector (#7134)
This commit is contained in:
@@ -144,6 +144,21 @@ int AddFont(
|
||||
std::function<ImFont*(ImGuiIO& io, float size, const ImFontConfig* cfg)>
|
||||
makeFont);
|
||||
|
||||
/**
|
||||
* Adds a default font option. This is the font used for menus, etc. If the
|
||||
* font is selected by the user as the default font, the passed function is
|
||||
* called during initialization as many times as necessary to create a range of
|
||||
* sizes. If not selected, the font is not loaded (to always load a font,
|
||||
* use AddFont() instead).
|
||||
*
|
||||
* @param name font name
|
||||
* @param makeFont font creation / loader function
|
||||
*/
|
||||
void AddDefaultFont(
|
||||
const char* name,
|
||||
std::function<ImFont*(ImGuiIO& io, float size, const ImFontConfig* cfg)>
|
||||
makeFont);
|
||||
|
||||
/**
|
||||
* Gets a font added with AddFont() with the appropriate font size for
|
||||
* the current scaling of the GUI.
|
||||
|
||||
Reference in New Issue
Block a user