Code showed correctly
Code replaced with squares (see screenshots below)
Operating system:
Ubuntu 16.10 (On Ubuntu 16.04 this function worked fine)
Version of Telegram Desktop:
0.10.19
log_14_30.txt
mtp_14_30.txt
tcp_14_30.txt
Telegram Desktop

Telegram on Android

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

@glebsam unfortunately, it doesn't works for me:
@glebsam For me too:
And this fontconfig folder reappears on Telegram restart.
Same problem here
Here's a screenshot:

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:
~/.TelegramDesktop directory and the directory, from which TD was run. 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.

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.
Most helpful comment
Installing
ttf-liberationsolved 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