raygui
raygui copied to clipboard
[`rGuiStyler`] Support for substepping font rasterization
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:
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.
Here's 4 public domain pixel fonts that I've observed this issue with. fonts.zip
https://github.com/raysan5/raylib/issues/3766 Proof of concept documented in this issue
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.