Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
2.06k stars 449 forks source link

Qt `6.8.0` breaks bold usernames #5694

Open brian6932 opened 4 days ago

brian6932 commented 4 days ago

Checklist

Screenshots

left 6.7.2, right 6.8.0

OS and Chatterino Version

68304272a26c12b7d72fa3d95a732471341e3d15 built on 2024-11-04 with Qt 6.8.0, MSVC 194134123 Running on Windows 10 Version 21H2, kernel: 10.0.19044

Nerixyz commented 4 days ago

I couldn't see a difference in the screenshot you provided, so here are they next to each other.

6.8.0: 6.8.0 6.7.1: 6.7.1

The username is still bold (just not as bold as before). This doesn't look like the default font. Does this happen with the default font too? I'm guessing your font provides weights that GDI couldn't display, but DirectWrite can. We currently don't use OpenType font weights, because of Qt 5 support. But in the future, we could revisit the font-weights.

brian6932 commented 4 days ago

This doesn't look like the default font. Does this happen with the default font too?

Yea it's not the default font. https://github.com/belluzj/fantasque-sans This is the font used, specifically the NoLoopK variant, only ttfs (TrueType) are installed, not the OpenType ones. I can't really tell if the default font (Segoe UI) exhibits it or not, it doesn't seem so, but the bold effect's very subtle in the place. 6.7.1,6.7.2,6.8.0 One thing I did notice though is that the Username font weight setting doesn't really get applied properly to the custom font when going up from the default, but it does seem to work going down, this behavior occurs across all the versions above (this is probably just due to a lack of available weights past a certain point). While on the default font, it works perfectly.

Nerixyz commented 3 days ago

The issue is with the DirectWrite font engine when compared to the previous GDI one. Your font doesn't have a style for DemiBold (weight 600). GDI[^1] will show the 400 (Normal) style with a "bold simulation" (i.e. it's artificially creating a bold version). DirectWrite, the default backend on 6.8 will show the 700 (Bold) style without any simulation. So what you're seeing on 6.8 is the actual bold version of your font as intended by its artist, and the version you saw in 6.7 and earlier was a fake bold style.

Times New Roman is another font that doesn't have a 600 (DemiBold) style. If you compare them, you can see that GDI's bold simulation looks off:

fontengine Bold DemiBold
GDI gdi_bold gdi_demibold
DirectWrite dw_bold dw_demibold

I created QTBUG-130861 to see what Qt folks will have to say on this.

[^1]: 🤓 It's actually using DirectWrite too, but it's using a font-face created from a GDI font and that one has simulations.