telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.23k stars 5.21k forks source link

Custom font scaling issue #27814

Closed Twilightssuperb closed 6 months ago

Twilightssuperb commented 6 months ago

Steps to reproduce

  1. Update Telegram Desktop to 4.16.9.
  2. Set UI scale <100%.
  3. Go to "Chat settings" and choose custom font.
  4. Restart app.
  5. Get broken folders font alignment etc.

Expected behaviour

All UI font elements should be smaller.

But nope.

75% scaling Inter: TDesktop custom font scaling bug 75 PT Sans: TDesktop custom font scaling bug 75 (2)

Actual behaviour

Seems app get forced minimal font size, therefore can't make it smaller. I have no problem with default Open Sans font scaling <100%.

With scaling <75% I get much more bugs: UI fonts elements refuse to get smaller, looks like they keep using minimal font size (8) instead of 6 or 7.

Users were waiting this feature for so long, but you should polish it and find the easiest solution.

Operating system

Win 8.1 x64

Version of Telegram Desktop

4.16.9

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

john-preston commented 6 months ago

I've allowed it to go 1px of font size more in attempt to mimic the original font size in beta version 4.16.10. Can you check if it became better there?

Twilightssuperb commented 6 months ago

Nothing has changed after update to 4.6.10. It's a bit weird. ๐Ÿ˜•

ilya-fedin commented 6 months ago

@Twilightssuperb what if you enable freetype in experimental settings?

Twilightssuperb commented 6 months ago

Still nothing has changed even after FreeType was enabled.

ilya-fedin commented 6 months ago

Maybe your fonts have wrong metrics in the capHeight value of the OS/2 table?

Twilightssuperb commented 6 months ago

IDK, all TTFs were downloaded from official sources or Google Fonts. BTW, I use Mactype for better rendering. Maybe the reason is in it. But default Open Sans font doesn't conflict with Mactype...

ilya-fedin commented 6 months ago

Yeah, please try without mactype

Twilightssuperb commented 6 months ago

Still nothing has changed but fonts became more ugly without Mactype. ๐Ÿ˜…

ilya-fedin commented 6 months ago

IDK, all TTFs were downloaded from official sources or Google Fonts. BTW, I use Mactype for better rendering. Maybe the reason is in it. But default Open Sans font doesn't conflict with Mactype...

It's not like fonts can't contain bugs. e.g. Open Sans was updated to the latest version 3.003 from Google Fonts when this beta testing phase began and tdesktop got lots if bugs reports that it looks way worse (broken kerning, etc). Falling back to 1.10 in 4.16.10 helped.

Twilightssuperb commented 6 months ago

Well, I've chosen "System font" (but what is it? It doesn't look like Segoe UI), scaling 75% is better now. (Both Inter and PT Sans, e.g., seem bigger at previous screenshots. IDK why, alas. โ˜นโ˜น They are not displayed as with 75% โ€” they look like scaling is bigger, about โ‰ฅ90%) TDesktop system font family choose 75 TDesktop Segoe UI choose 75 TDesktop folders column scaling 75 system font choose

ilya-fedin commented 6 months ago

but what is it?

Whatever Qt thinks is the system font. I believe it should be Segoe UI... But wouldn't be surprised if Windows returns some other font to Qt.

john-preston commented 6 months ago

@Twilightssuperb I've found the problem in size computation, this should get better in the upcoming release (I hope later today).

Twilightssuperb commented 6 months ago

Well, font scaling is more accurate after update to 5.0.0, but I can't use 75% UI scaling now, I have to zoom it to 85/90%, but then UI looks so big. And line-height is a bit sparse, it's not comfortable for me. Icons scaling and line-height were better in previous iteration.

Maybe you should think about further more UI scaling custiomization.