-
Notifications
You must be signed in to change notification settings - Fork 601
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I'm sure there's an obvious answer to this, but how do I change the font for a specific portion of the plot?
Pushing normalFont in the following is completely ignored and the same font is used throughout the plot.
I actually only want to set the header independent of the axes, but I failed before I even got that far...
It seems odd to me that imgui doesn't pass fonts as part of it's style struct, but I guess an alternative question is: How can I access the plot dimensions so I can hide the plot text and use the main imgui code to draw the text (if it's not possible to do from within implot)?
if (ImGui::CollapsingHeader("Multiple Fonts")) {
ImFont* normalFont = ImGui::GetIO().Fonts->Fonts[0];
ImFont* headerFont = ImGui::GetIO().Fonts->Fonts[3];
ImGui::PushFont(headerFont);
int data[2] = { 0,1 };
if (ImPlot::BeginPlot("Plot A", "x-label", "y0-label")) {
ImGui::PushFont(normalFont);
ImPlot::PlotLine("Line", data, 2);
ImGui::PopFont();
ImPlot::EndPlot();
}
ImGui::PopFont();
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request