FS#61032 - [telegram-desktop] Telegram defaults to an ugly (most likely) monospace font
Attached to Project:
Community Packages
Opened by Annonym (Hasbeen) - Tuesday, 11 December 2018, 13:04 GMT
Last edited by Jiachen Yang (farseerfc) - Wednesday, 12 December 2018, 16:31 GMT
Opened by Annonym (Hasbeen) - Tuesday, 11 December 2018, 13:04 GMT
Last edited by Jiachen Yang (farseerfc) - Wednesday, 12 December 2018, 16:31 GMT
|
Details
Description:
Since the patch (https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/telegram-desktop&id=e29abf708b86308469875c6ce720e0b57adb211c), which enables system-wide fonts was added, Telegram defaults to the fixed-width font even though I successfully used `qt5ct` to select a font of choice for other QT5 programs. It should be noted that installing `ttf-opensans` from AUR restores Telegram back to the standard look prior to the patch. Neverthless, an AUR package, as I suppose, ought not to be mandatory for a program from the official "Community" repository and thus I don't count it as a solution. Please correct me if I'm wrong or missing an obvious point in bringing the patch into effect. Additional info: * package version(s) `telegram-desktop` 1.5.0-2 * config and/or log files etc. Steps to reproduce: - Update to `telegram desktop` 1.5.0-2 |
This task depends upon
Closed by Jiachen Yang (farseerfc)
Wednesday, 12 December 2018, 16:31 GMT
Reason for closing: Fixed
Additional comments about closing: telegram-desktop 1.5.1-3 added a new optdepends=(ttf-opensans)
Wednesday, 12 December 2018, 16:31 GMT
Reason for closing: Fixed
Additional comments about closing: telegram-desktop 1.5.1-3 added a new optdepends=(ttf-opensans)
I should not have requested the task closure so early.
Yep, after installing `ttf-opensans` from AUR restores Telegram back to the standard look prior to the patch.
These patches look like a hardcoded. I vote for remove it.
The binary from upstream bundled a custom (patched) version of qt5 and fontconfig and the Open Sans fonts, among other things. We applied the "systemqt" patches from debian to use system-wide qt5 and fontconfig. This is the same situation from the beginning when Sven-Hendrik Haase moved the aur/telegram-desktop-systemqt into community/telegram-desktop.
Up until 1.4.3, systemqt patch allow us to configure the fonts for telegram-desktop using user level fontconfig xml files. This "feature" or "side-effect" of systemqt patch is important for non-European language users, because it allows us to set fallback fonts for many languages with characters not included in the bundled opensans font. Also with a correct user level fontconfig, this allow Bold style to apply correctly on the desired fallback fonts.
Between 1.4.3 and 1.5.0 the upstream touched these 2 things regarding the font rendering:
1. Because their bundled fontconfig cannot parse system fontconfig settings if the system fontconfig version is newer than 2.13, they decided to ship a custom fontconfig file only apply to their binary.
https://github.com/telegramdesktop/tdesktop/commit/8ee958bfa08b2ba87cffaf8de4b65b6890e59ea3 . This fontconfig file is poorly written and not suitable for Arch Linux in many ways: it hardcoded non-existence path, it forced subpixel order, and most importantly it does not consider font fallback. Fortunately the upstream provided TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION macro to disable this behavior. So I disabled it in 1.5.0-2, and according to upstream issue reports people tends to agree with my decision: https://github.com/telegramdesktop/tdesktop/issues/5459#issuecomment-446221727 https://github.com/telegramdesktop/tdesktop/issues/5463#issuecomment-446296514
2. The upstream decided to disable Qt DemiBold styling and rely solely on font family name to select "Open Sans SemiBold" font. (https://github.com/telegramdesktop/tdesktop/commit/0718520f3649c9ebaf54c02961811fa94a9ac2c0). This is their attempt to fix ugly font rendering reported in https://github.com/telegramdesktop/tdesktop/issues/5368 . But the side effect of this change is that this breaks SemiBold style for any fallback fonts than "Open Sans Semibold".
And my attempt to fix these things are in the following order:
1. In 1.5.0-2 I tried to set the TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION macro to disable custom fontconfig file generation. Also I applied the "Use-system-wide-font.patch" taken from debian (https://salsa.debian.org/debian/telegram-desktop/blob/debian/master/debian/patches/Use-system-wide-font.patch) to disable bundled opensans font, so that telegram can pick up user level fallback configs.
2. After 1.5.0-2 release, people reported to me that without "ttf-opensans" installed, bold text cannot render correctly even for English text. I looked into the problem and decided to bundle opensans again in 1.5.0-3 temporarily to at lease recover bold fonts for english before I have time to understand the problem.
3. This is followed by 1.5.1-1 release from the upstream immediately. I didn't change any patches for 1.5.1-1 .
4. After some further investigation into the code, I found the reason for losing bold style, so I reverted the commit to add back bold style (https://github.com/telegramdesktop/tdesktop/commit/310c68a744ae8163c96b88944d96a6f6b14b3cdf). Since bold style font can now be replaced in user level fontconfig settings, I also add back "Use-system-wide-font.patch". Then I released 1.5.1-2
So now I have 2 conflicting options:
1. Keep the patch in 1.5.1-2 , and users have to define their own fontconfig fallbacks (or install aur/ttf-opensans) to meet their taste in font selection. Or
2. Remove the "Use-system-wide-font.patch" and release 1.5.1-3 , and users will lose the ability to replace the bundled opensans with their own fonts (for the characters defined in the opensans font).
Which one do you guys think is better?
It is simple to bind Open Sans and Open Sans Semibold to Noto Sans and Noto Sans Medium in fontconfig
telegram-desktop 1.5.1-3 now added a new optdepends of ttf-opensans. Cheers and back to telegraming ~