raygui icon indicating copy to clipboard operation
raygui copied to clipboard

[`rGuiStyler`] Support for substepping font rasterization

Open GaryMcWhorter opened this issue 1 year ago • 3 comments

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 avatar Jan 30 '24 08:01 GaryMcWhorter

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

GaryMcWhorter avatar Jan 30 '24 08:01 GaryMcWhorter

https://github.com/raysan5/raylib/issues/3766 Proof of concept documented in this issue

GaryMcWhorter avatar Jan 30 '24 13:01 GaryMcWhorter

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.

raysan5 avatar May 07 '24 08:05 raysan5