MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / SetCurrentFont

Method SetCurrentFont

KBotExt/imgui/imgui.cpp:7103–7117  ·  view source on GitHub ↗

Important: this alone doesn't alter current ImDrawList state. This is called by PushFont/PopFont only.

Source from the content-addressed store, hash-verified

7101
7102// Important: this alone doesn't alter current ImDrawList state. This is called by PushFont/PopFont only.
7103void ImGui::SetCurrentFont(ImFont* font)
7104{
7105 ImGuiContext& g = *GImGui;
7106 IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
7107 IM_ASSERT(font->Scale > 0.0f);
7108 g.Font = font;
7109 g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale);
7110 g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f;
7111
7112 ImFontAtlas* atlas = g.Font->ContainerAtlas;
7113 g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel;
7114 g.DrawListSharedData.TexUvLines = atlas->TexUvLines;
7115 g.DrawListSharedData.Font = g.Font;
7116 g.DrawListSharedData.FontSize = g.FontSize;
7117}
7118
7119void ImGui::PushFont(ImFont* font)
7120{

Callers

nothing calls this directly

Calls 2

ImMaxFunction · 0.85
IsLoadedMethod · 0.80

Tested by

no test coverage detected