[wpigui] Add font selector (#7134)

This commit is contained in:
Peter Johnson
2024-09-28 10:34:59 -07:00
committed by GitHub
parent 6b1e656659
commit 50db16c0c0
3 changed files with 86 additions and 24 deletions

View File

@@ -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.