Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imgui: use freetype for font rendering #7409

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

buzzhuzz
Copy link
Contributor

@buzzhuzz buzzhuzz commented Nov 7, 2024

Description

Integrate freetype as font rendering engine for imgui. This makes all texts rendered by imgui sharper.

Additionally, fix column width calculation for "Line type" statistics table. This bug happens for locales with long enough "Used filament" localizations (like Ukranian one).

Screenshots/Recordings/Graphs

Original (stb_truetype) imgui font rendering (Orca 2.2.0 release build):
imgui-stb_truetype

Freetype font rendering:
imgui-freetype

Representation of the column width bug (Orca 2.2.0 release build):
Screenshot from 2024-11-07 22-49-19

Tests

Tested on Linux only.

Add and enable freetype font renderer for imgui
For a locales with long enough "Used filament" localization,
line type table may render crooked with overlapping column headers.

This change reworks column width calculations getting rid of heuristics
based on the presence of "Display" column.
@scottmudge
Copy link
Contributor

scottmudge commented Nov 8, 2024

Looks like it works on Windows. Fonts are a bit crisper. Almost too crisp.

Oversampling the font atlas texture by setting this line:

cfg.OversampleH = cfg.OversampleV = 1;

to

cfg.OversampleH = cfg.OversampleV = 2;

made it look a bit better.

Though, this will quadruple the font atlas texture memory footprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants