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

[rGuiStyler] Support for substepping font rasterization #377

Open
GaryMcWhorter opened this issue Jan 30, 2024 · 3 comments
Open

[rGuiStyler] Support for substepping font rasterization #377

GaryMcWhorter opened this issue Jan 30, 2024 · 3 comments

Comments

@GaryMcWhorter
Copy link

Currently rGuiStyler has issues rasterizing pixel fonts correctly, the rasterization grid does not always match evenly with the provided font file's vectorized pixel grid.

As observed, a font designed for 16pt size was almost a fit at 13pt but wasn't a perfect match so it was rasterized with subpixels:
image

The same font somehow seems to be rasterized correctly at 38pt but not a multiple of that like 19pt.. Which means that 38 is almost perfect but likely not exactly perfect. I could be wrong in that assumption.

A potential solution is more fine grained control over substepping the font pt, but unsure how this would look once applied at a different font pt in the actual gui.

@GaryMcWhorter
Copy link
Author

Here's 4 public domain pixel fonts that I've observed this issue with.
fonts.zip

@GaryMcWhorter
Copy link
Author

raysan5/raylib#3766
Proof of concept documented in this issue

@raysan5 raysan5 changed the title Support for substepping font rasterization in rGuiStyler [rGuiStyler] Support for substepping font rasterization May 7, 2024
@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

As discussed, this issue could be related to how raylib considers font size data (as points vs pixels). Other engines seem to be able to load font data correctly at specific size. It needs to be carefully investigated in raylib side.

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

No branches or pull requests

2 participants