Tdesktop: Code block font issue

Created on 25 Oct 2016  路  20Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Write a message, use "```" for code block
  2. Check how it looks

    Expected behavior

Code showed correctly

Actual behavior

Code replaced with squares (see screenshots below)

Configuration

Operating system:
Ubuntu 16.10 (On Ubuntu 16.04 this function worked fine)

Version of Telegram Desktop:
0.10.19

Logs

log_14_30.txt
mtp_14_30.txt
tcp_14_30.txt

Telegram Desktop
telegram_mono_font_issue

Telegram on Android
screenshot_20161025-130350

waiting for answer

Most helpful comment

Installing ttf-liberation solved the issue.

Apparently it's the fallback font selection here that fails for some weird reason:
https://github.com/telegramdesktop/tdesktop/blob/a69304fd2547961f684f249a7ea590bbf604f736/Telegram/SourceFiles/app.cpp#L2284

All 20 comments

Same problem.
TDesktop 0.10.19 @Ubuntu 16.10.

Maybe there is any workaround? I really believe, if one Linux OS (e.g. Fedora 23-25) has no such issue, another one can get a simple fix. Finally, it's Linux!

Same problem.
TDesktop 0.10.19 Archlinux

Upgrade 0.10.20 - the issue is still present.
Upgrade 1.0 - the issue is still present.

Finally, there is a workaround.
In my home directory, I found a directory named .TelegramDesktop. And in this directory, another one, named fontconfig. It is what you need to remove, and then restart Telegram Desktop.

cd ~/.TelegramDesktop
rm -rf fontconfig

image

@glebsam unfortunately, it doesn't works for me:

  • Arch Linux 4.9.8-1-ARCH
  • i3WM
  • Telegram 1.0.5
  • fontconfig 2.12.1-4

@glebsam For me too:

  • Ubuntu 16.10
  • Unity
  • Telegram 1.0.5
  • fontconfig 2.11.94-0ubuntu2

And this fontconfig folder reappears on Telegram restart.

Same problem here

  • Arch Linux 4.9.9-1-ARCH
  • GNOME-Shell
  • Telegram 1.0.14
  • fontconfig 2.12.1-4

Here's a screenshot:

scrot

If I open it up on the terminal here's the output

$ ./Apps/Telegram/Telegram
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number

I have the same setup (os, packages versions etc) on my desktop PC and this problem doesn't seem to happen there.
Please investigate this ASAP as it breaks the user experience.

Ok, small update, seems that the Fontconfig errors I have posted previously also happen on installations where the code blocks are shown correctly, so it should be unrelated

@fishhead108 , @dayfuaim , @GabMus Looks like this issue is not observed on clean installations of recent TD. If so, I guess this instruction will help:

  1. Kill Telegram Desktop
  2. Remove the whole ~/.TelegramDesktop directory and the directory, from which TD was run.
  3. Perform clean install from https://desktop.telegram.org/

that's what I did

rm -r .TelegramDesktop
rm: cannot remove '.TelegramDesktop': No such file or directory
# found out TelegramDesktop is in .local/share
rm -r .local/share/TelegramDesktop
rm -r Apps/Telegram/

I proceeded to download a Telegram Desktop again, I logged in, and still the problem is there.

This method doesn't work for me.

EDIT: also tried linking .local/share/TelegramDesktop to ~/.TelegramDesktop and nothing changes.
EDIT 2 (sorry): also tried moving .local/share/TelegramDesktop to ~/.TelegramDesktop

/opt/Telegram/Telegram 
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number
Fontconfig warning: "/etc/fonts/conf.d/70-fonts-bpg-georgian.conf", line 12: bad alias
Fontconfig warning: "/etc/fonts/conf.d/70-fonts-bpg-georgian.conf", line 21: bad alias
Fontconfig warning: "/etc/fonts/conf.d/70-fonts-bpg-georgian.conf", line 30: bad alias
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number
Fontconfig warning: "/etc/fonts/conf.d/70-fonts-bpg-georgian.conf", line 12: bad alias
Fontconfig warning: "/etc/fonts/conf.d/70-fonts-bpg-georgian.conf", line 21: bad alias
Fontconfig warning: "/etc/fonts/conf.d/70-fonts-bpg-georgian.conf", line 30: bad alias

Hmm, this error occurs if you are using older versions of fontconfig library. Perhaps they are statically linked into the binary file.

I had a same problem like you all and all methods from above is doesn't work.

Now, mine is works. But the code snippets becomes italic.
What fonts used in telegram? Maybe I can install related fonts.

screenshot from 2017-05-31 22-44-10

I started having this issue recently on my Linux machine. Removing .local/share/TelegramDesktop/fontconfig didn't solve the issue.

The really weird thing is that it used to work, then the issue just appeared out of nowhere.

Installing ttf-liberation solved the issue.

Apparently it's the fallback font selection here that fails for some weird reason:
https://github.com/telegramdesktop/tdesktop/blob/a69304fd2547961f684f249a7ea590bbf604f736/Telegram/SourceFiles/app.cpp#L2284

Thank you for that solution @kelytha! I regularly share code in Telegram and this has made my life so much better.

At least in debian ttf-liberation is a transitional dummy package and fonts-liberation is the real package.

[$] aptitude search liberation                                                                                                    
i   fonts-liberation                                                - Fonts with the same metrics as Times, Arial and Courier                   
v   fonts-liberation:i386                                           -                                                                           
i   fonts-liberation2                                               - Fonts with the same metrics as Times, Arial and Courier (v2)              
i   ttf-liberation                                                  - transitional dummy package                                                
v   ttf-liberation:i386                                             -                  

But running telegram from console doesn't improve things at all -

[$] ./Telegram                                                                                                                      
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number

So the issue still persists. FWIW, I'm running Debian testing i.e. buster.

Same issue here. Installing ttf-liberation helped, but warnings are still persist.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FunctionalHacker picture FunctionalHacker  路  3Comments

whywhyy picture whywhyy  路  3Comments

qwitriy picture qwitriy  路  3Comments

matteotumiati picture matteotumiati  路  3Comments

Liudvikas picture Liudvikas  路  3Comments