Ubuntu – Broken fonts for code formatting blocks in slack and chrome in Ubuntu 18.04

18.04fontsslack

After I changed some fonts in tweaks-tool, in some programs (Slack, Chrome) font formatting for blocks of code became broken.

I tried to restore defaults, but fonts in code blocks still ugly.
How it can be fixed?

Ubuntu 18.04

Example of ugly code formatting fonts in slack:
Screenshot of ugly code formatting fonts render in slack

And normally should look like this:
https://get.slack.help/hc/article_attachments/360003366488/inlinecode.png

Best Answer

I use Ubuntu 19.10 and ran into the same problem after making font changes using the Tweaks tool.

Do the following:

Make sure that the Fixed-Width font in chrome://settings/fonts is set to MonoSpace.

Add the file ~/.fonts.conf with the following code:

<match target="font" >
    <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
</match>

Uninstall chrome and reinstall chrome