alexheretic / glyph-brush

Fast GPU cached text rendering
Apache License 2.0
673 stars 52 forks source link

Support for stem darkening/glyph dilation #147

Closed ghost closed 2 years ago

ghost commented 2 years ago

This seems to be an important feature that is implemented in macOS's native font renderer. It apparently was already implemented in the (now abandoned, I think) Pathfinder, which was/is part of the Servo web engine, to faithfully reproduce the native font rendering look.

This stem darkening/glyph dilation generally makes text look a little bit heavier than usual. At least on macOS, text rendered using this library looks too thin, in comparison.

Is there any chance this feature will come to glyph_brush and/or ab_glyph?

alexheretic commented 2 years ago

An objective of glyph_brush when I wrote it was to have consistent text rendering in my game on Linux, Windows & Mac. So I wouldn't actually want platform specific differences myself.

However, I wouldn't be against having opt into tweaks or features that make rendering more "platform native".

I don't understand this particular feature, but it may be doable in the glyph shader code? If so changes wouldn't be needed here.

If it's a more involved rasterization thing, work would probably start in ab_glyph.