You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Through my experiment ImGui::GetMainViewport()->DpiScale is not good enough to get DPI. It's buggy and always return 0 before ImGui::NewFrame(). That's a bit too late for fonts loading with DPI info.
The text was updated successfully, but these errors were encountered:
GUI text is blurred because not considering DPI while loading the TTF font.
Pilot is using
AddFontFromFileTTF
to load font. It should also consider DPI because the second parameter is measured in pixel.ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
Reference: ocornut/imgui#2956
Then, how to get correct DPI?
Through my experiment
ImGui::GetMainViewport()->DpiScale
is not good enough to get DPI. It's buggy and always return 0 beforeImGui::NewFrame()
. That's a bit too late for fonts loading with DPI info.The text was updated successfully, but these errors were encountered: