Repository navigation
Add pre-rasterized scaled GUI fonts (1.5x, 2x) - #86265
Merged
GuardianDll merged 1 commit intoApr 5, 2026
Merged
Conversation
- Add font_size parameter to load_font(), load GUI font at 1.5x and 2x into the atlas alongside the regular gui and mono fonts - Expose PushGuiFont1_5x() and PushGuiFont2x() helpers in cata_imgui.h - Replace SetWindowFontScale(1.4f) in crafting GUI with PushGuiFont1_5x() for crisp text instead of blurry bitmap scaling - Loop over all fonts for fallback callbacks and validation
dobbry-vechur
force-pushed
the
feature/imgui-scaled-fonts
branch
from
April 5, 2026 11:39
2543a8d to
4958b7e
Compare
This was referenced Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Interface "Add pre-rasterized scaled ImGui fonts instead of bitmap scaling"
Purpose of change
SetWindowFontScale()is marked[OBSOLETE]in ImGui. It stretches bitmap glyphs and produces blurry text. The crafting GUI uses it at 1.4x for the recipe title.Describe the solution
Load the GUI font into the atlas at 1.5x and 2x
fontheightduringload_fonts(). AddPushGuiFont1_5x()andPushGuiFont2x()helpers. ReplaceSetWindowFontScale(1.4f)in the crafting GUI withPushGuiFont1_5x().Describe alternatives you've considered
Keep using
SetWindowFontScale(). It works but the text is blurry and the API is obsolete.Testing
Opened crafting GUI, recipe title renders without blur at the larger size.

Pre:
Post:

Additional context
Extra atlas entries add some texture memory proportional to glyph count and size. Mostly relevant for CJK languages, negligible for Latin.