hecrj / wgpu_glyph

A fast text renderer for wgpu (https://github.com/gfx-rs/wgpu)
https://docs.rs/wgpu_glyph
MIT License
450 stars 78 forks source link

Font weight problem #87

Closed ghost closed 2 years ago

ghost commented 2 years ago

The font weight of text rendered with this library seems to be off in comparison to the font rendering used in browsers.

Safari:

Screenshot 2022-01-20 at 10 32 12

wgpu_glyph:

Screenshot 2022-01-20 at 10 33 48

If you look closely, there's a pixel difference between these two—easy to spot at the plus or equals sign. They both don't have any font weight modifications; it's the default font weight.

The same holds true for Firefox and Chrome.

I'm not a font expert, so I have no idea what method would need to be implemented, which one is used in browsers to achieve this, or whether browsers diverge from default OS font rendering in this case.

Nevertheless, the text seems to be just a little bit too thin in comparison. Help would be much appreciated here :-)

Edit: using macOS.

hecrj commented 2 years ago

This is probably the result of stem darkening, which glyph_brush does not support.

ghost commented 2 years ago

Opened an issue for glyph-brush instead then. Thanks.