Tdesktop: fontconfig error when telegram when launch

Created on 13 Mar 2018  Â·  36Comments  Â·  Source: telegramdesktop/tdesktop

Steps to reproduce

1.luanch telegram destop

Expected behaviour

Open telegram without error message.

Actual behaviour

Launched with a lot of fontconfig error.
Seems telegram has error with fontconfig 2.13.0 's new config.

Configuration

Operating system:
gentoo

Version of Telegram Desktop:
1.2.6

Used theme:
dark mode

Logs:
Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: line 5: unknown element "its:rules"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: line 6: unknown element "its:translateRule"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig error: line 6: invalid attribute 'translate'

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig error: line 6: invalid attribute 'selector'

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig error: line 7: invalid attribute 'xmlns:its'

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig error: line 7: invalid attribute 'version'

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: line 9: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 8: unknown element "description"

Mar 13 09:59:25 avalon_laptop telegramdesktop.desktop[3056]: Fontconfig error: Cannot load default config file


duplicate

Most helpful comment

As for now I've managed to have properly working Telegram with correct dialog windows and fonts in Debian Buster with this workaround:

  1. Create file ~/.config/tgfonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <description>Telegram-specific configuration file</description>
    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <match target="pattern">
    <test qual="any" name="family">
        <string>mono</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>monospace</string>
    </edit>
    </match>
    <match target="pattern">
    <test qual="any" name="family">
        <string>sans serif</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>sans-serif</string>
    </edit>
    </match>
    <match target="pattern">
    <test qual="any" name="family">
        <string>sans</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>sans-serif</string>
    </edit>
    </match>
    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <cachedir>~/.fontconfig</cachedir>
    <match target="font">
    <edit mode="assign" name="antialias">
        <bool>true</bool>
    </edit>
    <edit mode="assign" name="embeddedbitmap">
        <bool>false</bool>
    </edit>
    <edit mode="assign" name="hinting">
        <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
        <const>hintslight</const>
    </edit>
    <edit mode="assign" name="lcdfilter">
        <const>lcddefault</const>
    </edit>
    <edit mode="assign" name="rgba">
        <const>rgb</const>
    </edit>
    </match>
</fontconfig>
  1. Modify telegram .desktop file (~/.local/share/applications/telegramdesktop.desktop AND/OR /usr/share/applications/telegramdesktop.desktop) to:
[Desktop Entry]
Version=1.3
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=env FONTCONFIG_FILE=~/.config/tgfonts.conf /opt/telegram/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;

No crashes, no error messages, proper fonts in app, in tray icon, in send file dialog.

All 36 comments

4240

Have you see the log? It seems not a same problem. Telegram works fine before I upgrade fontconfig to 2.13.0.

@codeplayer2org sorry.

I'm also experiencing this today, relevant info is as follows:

Configuration
Operating system:
Arch Linux 4.15.8-1

Version of Telegram Desktop:
1.2.14-1

Used theme:
Unknown


Logs

Fontconfig warning: line 5: unknown element "its:rules"
Fontconfig warning: line 6: unknown element "its:translateRule"
Fontconfig error: line 6: invalid attribute 'translate'
Fontconfig error: line 6: invalid attribute 'selector'
Fontconfig error: line 7: invalid attribute 'xmlns:its'
Fontconfig error: line 7: invalid attribute 'version'
Fontconfig warning: line 9: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/11-lcdfilter-default.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/20-unhint-small-vera.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/30-metric-aliases.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/30-metric-aliases.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/40-nonlatin.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/40-nonlatin.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/45-generic.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/45-generic.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/45-latin.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/45-latin.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/49-sansserif.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/49-sansserif.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/50-user.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/51-local.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/51-local.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/60-generic.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/60-generic.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/60-latin.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/60-latin.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 34: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/65-fonts-persian.conf", line 35: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 35: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 35: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 36: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/65-fonts-persian.conf", line 36: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 5: invalid attribute 'selector' Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 6: invalid attribute 'xmlns:its' Fontconfig error: "/etc/fonts/conf.d/65-nonlatin.conf", line 6: invalid attribute 'version' Fontconfig warning: "/etc/fonts/conf.d/65-nonlatin.conf", line 8: unknown element "description" Fontconfig warning: "/etc/fonts/conf.d/69-unifont.conf", line 4: unknown element "its:rules" Fontconfig warning: "/etc/fonts/conf.d/69-unifont.conf", line 5: unknown element "its:translateRule" Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 5: invalid attribute 'translate' Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 5: invalid attribute 'selector' Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 6: invalid attribute 'xmlns:its' Fontconfig error: "/etc/fonts/conf.d/69-unifont.conf", line 6: invalid attribute 'version' Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 4: unknown element "its:rules" Fontconfig warning: "/etc/fonts/conf.d/80-delicious.conf", line 5: unknown element "its:translateRule" Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 5: invalid attribute 'translate' Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 5: invalid attribute 'selector' Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 6: invalid attribute 'xmlns:its' Fontconfig error: "/etc/fonts/conf.d/80-delicious.conf", line 6: invalid attribute 'version' Fontconfig warning: "/etc/fonts/conf.d/90-synthetic.conf", line 4: unknown element "its:rules" Fontconfig warning: "/etc/fonts/conf.d/90-synthetic.conf", line 5: unknown element "its:translateRule" Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'translate' Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'selector' Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'xmlns:its' Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'version' Fontconfig error: Cannot load default config file

After updating to 1.2.14-2, I no longer experience this issue.

As I stated here, https://www.reddit.com/r/archlinux/comments/873b6i/fontconfig_213_crashes_telegram/
I do have this problem too, i have fontconfig 2.13.0+10+g58f5285-1 in archlinux and tested telegram 1.2.14 and 1.2.15, same output

@Akrai did you try telegram-desktop package from Arch Linux repo? I have same version of fontconfig but with telegram-desktop 1.2.14-2. No issue, only this in output:
QApplication: invalid style override passed, ignoring it.
QObject::startTimer: Timers cannot have negative intervals

@d0tfile i just tried it and nothing, same error

export FONTCONFIG_FILE=/etc/fonts/ solves the problem for me.

So dealing with the FONTCONFIG_FILE=/etc/fonts/ env, seems like kde dont like that env as it makes all the characters get render as missing character symbol, telegram runs fine but if you open the file picker, which uses the kde one, then all characters in the file picker are missing
If you set it as global env in the kde env folder, then all the DE is bugged with missing characters, so as i can see, as telegram is the only program with this bug (as i know), it seems it is a problem of telegram looking for the fontconfig file in a maybe deprecated location that still exists but is no longer in use by any other programs?

The app in official Arch repo hasn't this error. It works fine.

@RobertoPerico you are right, i didnt know there is an official package in arch, i tried in the other comment to install the aur one
so yes, the official one does work

@Akrai By official you mean officialy from who?

@john-preston the official package in the arch repo, https://www.archlinux.org/packages/community/x86_64/telegram-desktop/

@Akrai It is not from the Telegram team so I'm wondering what "official" means here.

@john-preston i didnt said official telegram package but official package in arch meaning that it is in the arch repo, not in aur

Yeah, I kinda prefer to not use the arch-linux packaged version, since it doesn't update as much as I'd like.

That being said, the export FONTCONFIG_FILE=/etc/fonts/ fix that @RobertoPerico gave works for me - it seems like this is also necessary on i3 since I wasn't exporting it anywhere before.

Relevant to say:
exporting FONTCONFIG_FILE to /etc/fonts/ does not fix it 100%. CJK fonts break, all the characters get replaced by squares.

1.2.15
same error...

I think the bug doesn't belong to Telegram, since i've tried to download the .tar on Fedora 27 and the problem didn't show up. So i think it's a fontconfig bug.

@RobertoPerico Yeah, you are right. I rolled back the fontconfig and it worked fine, but it brought some other problems, so I reinstalled the latest version...
update:
thanks, your answer export FONTCONFIG_FILE=/etc/fonts/ solved my problem.

In fact, export works with any existing directory, e.g.
mkdir testing
export FONTCONFIG_FILE=/home/user/testing/
works fine for me. Looks like in this case Telegram does not try to use system config from /etc/fonts/fonts.conf but use some default configuration and that's the reason why it works fine.

Empty variable also works fine: export FONTCONFIG_FILE=

after to use _export fontconfig_:

Fontconfig warning: no <cachedir> elements found. Check configuration.

Fontconfig warning: adding <cachedir>/var/cache/fontconfig</cachedir>

Fontconfig warning: adding <cachedir prefix="xdg">fontconfig</cachedir>

Fontconfig warning: no <cachedir> elements found. Check configuration.

Fontconfig warning: adding <cachedir>/var/cache/fontconfig</cachedir>

Fontconfig warning: adding <cachedir prefix="xdg">fontconfig</cachedir>

Fontconfig warning: no <cachedir> elements found. Check configuration.

Fontconfig warning: adding <cachedir>/var/cache/fontconfig</cachedir>

Fontconfig warning: adding <cachedir prefix="xdg">fontconfig</cachedir>

Fontconfig warning: no <cachedir> elements found. Check configuration.

Fontconfig warning: adding <cachedir>/var/cache/fontconfig</cachedir>

Fontconfig warning: adding <cachedir prefix="xdg">fontconfig</cachedir>

This worked for me on arch linux:

pacaur -S downgrader
downgrader fontconfig --> select 2.12.6
mkdir fc
cp -r /etc/fonts/* fc
pacaur -S fontconfig --> (upgrade again)
cp -fr fc/* /etc/fonts/

The same on Fedora 28.

I am also encountering this issue after updating to Fedora 28.

Full log: https://gist.github.com/Sanqui/5ed5c51ec913171d662201734800b45d

Same here on Fedora 28

#517 ?

As for now I've managed to have properly working Telegram with correct dialog windows and fonts in Debian Buster with this workaround:

  1. Create file ~/.config/tgfonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <description>Telegram-specific configuration file</description>
    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts</dir> <dir>/usr/local/share/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <match target="pattern">
    <test qual="any" name="family">
        <string>mono</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>monospace</string>
    </edit>
    </match>
    <match target="pattern">
    <test qual="any" name="family">
        <string>sans serif</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>sans-serif</string>
    </edit>
    </match>
    <match target="pattern">
    <test qual="any" name="family">
        <string>sans</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>sans-serif</string>
    </edit>
    </match>
    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <cachedir>~/.fontconfig</cachedir>
    <match target="font">
    <edit mode="assign" name="antialias">
        <bool>true</bool>
    </edit>
    <edit mode="assign" name="embeddedbitmap">
        <bool>false</bool>
    </edit>
    <edit mode="assign" name="hinting">
        <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
        <const>hintslight</const>
    </edit>
    <edit mode="assign" name="lcdfilter">
        <const>lcddefault</const>
    </edit>
    <edit mode="assign" name="rgba">
        <const>rgb</const>
    </edit>
    </match>
</fontconfig>
  1. Modify telegram .desktop file (~/.local/share/applications/telegramdesktop.desktop AND/OR /usr/share/applications/telegramdesktop.desktop) to:
[Desktop Entry]
Version=1.3
Name=Telegram Desktop
Comment=Official desktop version of Telegram messaging app
Exec=env FONTCONFIG_FILE=~/.config/tgfonts.conf /opt/telegram/Telegram -- %u
Icon=telegram
Terminal=false
StartupWMClass=TelegramDesktop
Type=Application
Categories=Network;InstantMessaging;Qt;
MimeType=x-scheme-handler/tg;

No crashes, no error messages, proper fonts in app, in tray icon, in send file dialog.

Let's move discussion to the #4240

@phpony thanks! Just trying to get that into gentoo
https://github.com/gentoo/gentoo/pull/10055

btw, the built-in updater will destroy your .desktop changes on every update

@phpony 🤔 Perhaps this could be included as an in-app solution to that problem.

Hi everyone, just wanted to post that this is still happening on Ubuntu 18.10 (Was not happening in 18.04) using Telegram 1.4.3 What I did was a combination of things here and basically this:

Created the file mentioned by @phpony and the XML information without the description line (line 4):

  1. Create the file at ~/.config/tgfonts.conf

nano ~/.config/tgfonts.conf

Then put this information in it

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts</dir> 
    <dir>/usr/local/share/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <match target="pattern">
    <test qual="any" name="family">
        <string>mono</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>monospace</string>
    </edit>
    </match>
    <match target="pattern">
    <test qual="any" name="family">
        <string>sans serif</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>sans-serif</string>
    </edit>
    </match>
    <match target="pattern">
    <test qual="any" name="family">
        <string>sans</string>
    </test>
    <edit name="family" mode="assign" binding="same">
        <string>sans-serif</string>
    </edit>
    </match>
    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <cachedir>~/.fontconfig</cachedir>
    <match target="font">
    <edit mode="assign" name="antialias">
        <bool>true</bool>
    </edit>
    <edit mode="assign" name="embeddedbitmap">
        <bool>false</bool>
    </edit>
    <edit mode="assign" name="hinting">
        <bool>true</bool>
    </edit>
    <edit mode="assign" name="hintstyle">
        <const>hintslight</const>
    </edit>
    <edit mode="assign" name="lcdfilter">
        <const>lcddefault</const>
    </edit>
    <edit mode="assign" name="rgba">
        <const>rgb</const>
    </edit>
    </match>
</fontconfig>

Save it then run this

export FONTCONFIG_FILE=~/.config/tgfonts.conf

Now run Telegram from the terminal. But am waiting for a default fix. Thank you.

@phpony it doesn't work in fedora 29.

for Fedora 29
step 1
export FONTCONFIG_FILE=/etc/fonts/
step 2
start Telegram
step 3
close Telegram
step 4
unset FONTCONFIG_FILE

Here is how I fixed this issue for Persian on:

  • Fedora 29
  • Debian 9+ (including ubuntu 18.10+)
    with GNOME Shell 3.30.2 (3.28+)

1 - Close Telegram
2 - Create directory: ~/.fonts if not exists
3 - Add a font with its different weights [I used [Vazir](https://rastikerdar.github.io/vazir-font/)]

copy Vazir.ttf Vazir-Bold.ttf Vazir-Light.ttf Vazir-Medium.ttfto your ~/.fonts folder

4- Create file: ~/.fonts.conf and add these lines to it:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="pattern">
  <test name="family" qual="any">
   <string>sans serif</string>
  </test>
  <edit mode="assign" binding="same" name="family">
   <string>Vazir</string>
  </edit>
 </match>
 <dir>~/.fonts</dir>
</fontconfig>

5 - open Telegrams font configuration file ~/.local/share/TelegramDesktop/tdata/fc-custom-1.conf
6 - Comment out all <dir> and <cachedir> entries there (simply wrap them between <!-- and -->).
7 - Remove old caches by rm -r ~/.cache/fontconfig_11
8 - Clear font caches (for sure):
fc-cache -f -v

Now open Telegram ツ

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArmeF97 picture ArmeF97  Â·  3Comments

FunctionalHacker picture FunctionalHacker  Â·  3Comments

Liudvikas picture Liudvikas  Â·  3Comments

Mindstormer619 picture Mindstormer619  Â·  3Comments

slowaways picture slowaways  Â·  3Comments