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

Bug: freetype rendering much worse #244

Closed
phraktle opened this issue Aug 9, 2024 · 2 comments · Fixed by #254
Closed

Bug: freetype rendering much worse #244

phraktle opened this issue Aug 9, 2024 · 2 comments · Fixed by #254
Assignees
Labels
bug Something isn't working

Comments

@phraktle
Copy link

phraktle commented Aug 9, 2024

Version

1.86.12

What happened?

After upgrading to 1.86.12 (appreciate the work on the library again!), font rendering became markedly worse. This can be attributed to freetype, which actually seems to yield worse results despite my efforts to adjust hinting flags.

rendering with 1.86.11:
sbt

rendering with 1.86.12:
freetype

Not sure if there are any flags I can set to make it look okay – if not, it would be great to have a distribution without freetype.

Reproduction

var font = "/System/Library/Fonts/SFNSMono.ttf";
var fonts = ImGui.getIO().getFonts();
var cfg = new ImFontConfig();
cfg.setOversampleH(3);
cfg.setOversampleV(3);
cfg.setRasterizerMultiply(2f);
cfg.setPixelSnapH(true);
fonts.addFontFromFileTTF(font, 14, cfg);

Relevant log output

No response

@phraktle phraktle added the bug Something isn't working label Aug 9, 2024
@SpaiR SpaiR self-assigned this Aug 9, 2024
@SpaiR
Copy link
Owner

SpaiR commented Aug 9, 2024

Yes, it seems I wasn't imagining things... 😅

I was waiting for someone else's feedback on this topic because I also noticed this issue. (If it's not too much trouble, could you let me know which OS you're using?)

That said, I've looked into it a bit, and it appears there's a relatively simple way to use STB_TrueType and FreeType simultaneously. I think I'll adapt the API to support this option, making STB_TrueType the default. At least, that will be simpler than maintaining multiple libs. Will do for the next release.

@phraktle
Copy link
Author

phraktle commented Aug 9, 2024

The screenshots are from MacOS Sonoma 14.5.

Btw, it seems the oversampling settings are ignored by the freetype engine. But even without oversampling, SBT gives better results:

sbt_nooversample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants