Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664872 - net-im/telegram-desktop-bin does not handle fontconfig properly
Summary: net-im/telegram-desktop-bin does not handle fontconfig properly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major
Assignee: Henning Schild
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-08-30 07:39 UTC by Mikle Kolyada (RETIRED)
Modified: 2018-10-04 20:51 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
CLI run output (run_output,11.41 KB, text/plain)
2018-08-30 07:39 UTC, Mikle Kolyada (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2018-08-30 07:39:05 UTC
Created attachment 545496 [details]
CLI run output

All present binaries are affected, self-compiled versions are ok.
Comment 1 Alexander Tsoy 2018-10-01 09:07:21 UTC
Upstream issue:
https://github.com/telegramdesktop/tdesktop/issues/4240
Comment 2 Henning Schild 2018-10-03 16:10:40 UTC
Hey, when i first looked up open issues in upstream i found several and decided to ignore the problem.

Ok there is a lot of "error" output, but does it do any harm? If you can, please explain the problem in more detail. Do your fonts look different than you expect them to?

Now the linked upstream issue mentions a workaround, launching tdesktop with FONTCONFIG_FILES set to /etc/fonts/. `FONTCONFIG_FILE=/etc/fonts/ telegram-desktop`
For me that got rid of all the errors, some warning remained. As far as i can tell it looks the same, but without the errors it starts up much faster.

The ebuild already ships a wrapper script to mess with the env and arguments, so it is easy to add FONTCONFIG_FILE as well. But i would like to understand what is going on there. Is this a fix or just a crude workaround?

I will send a PR for a 1.4.0-r1 once i found an answer ... or maybe not, if it is a hack.
Comment 3 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2018-10-03 16:13:06 UTC
It is a provlem because:

1.) telegram does not start from the menu entry
2.) it takes up to 2 minutes (literally) to start telegram from the CLI due to fontconfig errors
Comment 4 Henning Schild 2018-10-03 17:50:44 UTC
Please check out the "solution" in the PR i just opened. I am really not so sure about the possible side-effects of that, but works for me ;).
Please tell me how it performs on your systems, and let us see how the review on github goes.
Comment 5 Henning Schild 2018-10-04 06:15:56 UTC
Just tried arabic, cyrillic and a few asia fonts. While my system could not render some of them, the current fix does not seem to make that any worse.
"FONTCONFIG_FILE=/etc/fonts/ telegram-desktop" breaks arabic, just like mentioned in the upstream bug where that workaround was suggested as well.

As far as my testing goes that can probably be released.
Comment 6 Larry the Git Cow gentoo-dev 2018-10-04 20:51:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=056380a0e76e08e1bd2e5973219ff46a95b83ea5

commit 056380a0e76e08e1bd2e5973219ff46a95b83ea5
Author:     Henning Schild <henning@hennsch.de>
AuthorDate: 2018-10-03 17:43:28 +0000
Commit:     Mikle Kolyada <zlogene@gentoo.org>
CommitDate: 2018-10-04 20:50:30 +0000

    net-im/telegram-desktop-bin: work around fontconfig issues
    
    This commit makes telegram-desktop-bin bring its own fontconfig
    file for the old version of fontconfig it has built in. It also allows
    to fall back to the "old way" by removing the file from /etc/.
    
    Signed-off-by: Henning Schild <henning@hennsch.de>
    Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
    Closes: https://bugs.gentoo.org/664872
    Closes: https://github.com/gentoo/gentoo/pull/10055

 net-im/telegram-desktop-bin/files/fonts.conf       | 60 +++++++++++++++++
 .../files/telegram-desktop-bin-r2                  | 15 +++++
 .../telegram-desktop-bin-1.4.0-r1.ebuild           | 75 ++++++++++++++++++++++
 3 files changed, 150 insertions(+)