Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt 6.8.0 breaks bold usernames #5694

Closed
4 tasks done
brian6932 opened this issue Nov 4, 2024 · 4 comments
Closed
4 tasks done

Qt 6.8.0 breaks bold usernames #5694

brian6932 opened this issue Nov 4, 2024 · 4 comments
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user needs testing qt6.8 Issues related to upgrading to Qt 6.8

Comments

@brian6932
Copy link
Contributor

brian6932 commented Nov 4, 2024

Checklist

  • I'm reporting a problem with Chatterino
  • I've verified that I'm running the most recent nightly build or stable release
  • I've looked for my problem on the wiki
  • I've searched the issues and pull requests for similar looking reports

Screenshots

left 6.7.2, right 6.8.0

OS and Chatterino Version

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

@brian6932 brian6932 added the issue-report An issue reported by a user. label Nov 4, 2024
@brian6932 brian6932 changed the title Qt 6.8.0 alters font rendering in a way which breaks bold usernames Qt 6.8.0 breaks bold usernames Nov 4, 2024
@pajlada pajlada added bug Something isn't working as intended, or works in a confusing/unintuitive way for the user qt6.8 Issues related to upgrading to Qt 6.8 needs testing and removed issue-report An issue reported by a user. labels Nov 4, 2024
@Nerixyz
Copy link
Contributor

Nerixyz commented Nov 4, 2024

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
Copy link
Contributor Author

brian6932 commented Nov 4, 2024

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
Copy link
Contributor

Nerixyz commented Nov 4, 2024

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). GDI1 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.

Footnotes

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

@Nerixyz
Copy link
Contributor

Nerixyz commented Feb 6, 2025

This seems to have been a bug in GDI that we relied on (reply to QTBUG-130861). We shouldn't stay at GDI just for this bug. Especially because the font that was constructed by the emulation never existed.

The fonts that experienced this didn't have a 600 weight, and GDI decided to construct one. If you look at Typst, for example, you can see that DirectWrite has similar behavior for the weight selection (i.e. uses the closest weight):

Image

Code
#set page(width: auto, height: auto, margin: 1em)
#let tbl(fonts) = table(
  columns: 1 + fonts.len(),
  "Weight", ..fonts,
  ..range(100, 1000, step: 100)
    .map(it => ([#it], ..fonts.map(font => text(weight: it, font: font, "My Text"))))
    .flatten()
)

#tbl(("Times New Roman", "Segoe UI", "Arial"))

Times New Roman only has weights 400 and 700. Typst chooses the closest weights, so for 400 (regular) is chosen for 500 (medium) and 700 (bold) is chosen for 600 (semi-/demibold).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user needs testing qt6.8 Issues related to upgrading to Qt 6.8
Projects
None yet
Development

No branches or pull requests

3 participants