MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / SetCurrentFont

Method SetCurrentFont

extern/imgui/imgui.cpp:7792–7806  ·  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

7790
7791// Important: this alone doesn't alter current ImDrawList state. This is called by PushFont/PopFont only.
7792void ImGui::SetCurrentFont(ImFont* font)
7793{
7794 ImGuiContext& g = *GImGui;
7795 IM_ASSERT(font && font->IsLoaded()); // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
7796 IM_ASSERT(font->Scale > 0.0f);
7797 g.Font = font;
7798 g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale);
7799 g.FontSize = g.CurrentWindow ? g.CurrentWindow->CalcFontSize() : 0.0f;
7800
7801 ImFontAtlas* atlas = g.Font->ContainerAtlas;
7802 g.DrawListSharedData.TexUvWhitePixel = atlas->TexUvWhitePixel;
7803 g.DrawListSharedData.TexUvLines = atlas->TexUvLines;
7804 g.DrawListSharedData.Font = g.Font;
7805 g.DrawListSharedData.FontSize = g.FontSize;
7806}
7807
7808void ImGui::PushFont(ImFont* font)
7809{

Callers

nothing calls this directly

Calls 2

ImMaxFunction · 0.85
IsLoadedMethod · 0.80

Tested by

no test coverage detected