2

I was trying a bitmap font from github, and I had to enable bitmap fonts as they are disabled by default in Ubuntu. I did not know that enabling bitmap fonts would have some side-effects. I'm sure something seems wrong with my the text in Chrome(just as if it's using a new font altogether). I don't like it. So I'd like to revert it as it was before I enabled bitmap fonts.

I used the following commands to enable bitmap fonts:

cd /etc/fonts/conf.d/
sudo rm /etc/fonts/conf.d/10* && sudo rm -rf 70-no-bitmaps.conf && sudo ln -s ../conf.avail/70-yes-bitmaps.conf
sudo dpkg-reconfigure fontconfig

Please help me to disable bitmap fonts. Thanks in advance!

1

The directory /etc/fonts/conf.d/ contains symbolic links to configuration files within /etc/fonts/conf.avail/. These symlinks can be added and removed to customize the configuration of fontconfig.

The commands you previously ran disabled all 10-* configuration options, as well as disabling 70-no-bitmaps and enabling 70-yes-bitmaps. To reverse the latter part specifically, you can run the following:

cd /etc/fonts/conf.d
sudo rm 70-yes-bitmaps.conf
sudo ln -s ../conf.avail/70-no-bitmaps.conf ./

To reverse the effect of disabling the 10-* configuration files depends on which config files you had enabled to begin with. Here are the 10-* config files I have enabled on my machine:

cd /etc/fonts/conf.d
sudo ln -s ../conf.avail/10-hinting-slight.conf ./
sudo ln -s ../conf.avail/10-scale-bitmap-fonts.conf ./
sudo ln -s ../conf.avail/10-sub-pixel-rgb.conf ./

Alternatively, here is how you can enable the default 10-* options for Ubuntu Bionic:

cd /etc/fonts/conf.d
sudo ln -s ../conf.avail/10-hinting-slight.conf ./
sudo ln -s ../conf.avail/10-scale-bitmap-fonts.conf ./
sudo ln -s ../conf.avail/10-antialias.conf ./

I would personally recommend however, that you opt for sub-pixel-rgb instead of antialias unless you don't have a standard LCD monitor.

You may find however that the strange font rendering you're getting in Chrome is because you disabled these 10-* config files and not because you enabled bitmap fonts. You may want to try only re-enabling just these config files without swapping back from 70-yes-bitmaps to 70-no-bitmaps before reverting completely to having no bitmap fonts. Enabling 70-yes-bitmaps should not affect any other fonts besides allowing bitmap fonts to be used. It is also possible that you have some missing fonts and may get better results than you had originally by running:

sudo apt install ttf-mscorefonts-installer

Finally, after you have altered your fontconfig configuration, you should run:

sudo dpkg-reconfigure fontconfig

This will update your fontconfig cache so your changes can take effect. You may also need to restart your programs / log out and back in / reboot your computer to see the changes take effect.

  • It seems that I already have ttf-mscorefonts-installer installed. I also have no idea which 10-* configuration files I had symlinked. Although, I can give you a list of of 10-* config files in /etc/fonts/conf.avail: edit in progress – swingcake May 24 '18 at 14:14
  • @swingcake I have updated the answer with the defaults for Ubuntu. You could enable these or instead opt for config files I have enabled if you would rather have subpixel "cleartype"-like font rendering. – Candy Gumdrop May 24 '18 at 14:25
  • Thank you for the very insightful answer. I have an IPS LCD panel, and would definitely follow your recommendation regarding that. I would also like to ask for the source of your information(the default 10-* config files in Bionic). Another doubt I have is that why did the author of that particular bitmap font add the disabling of 10-* config files if that was not required to enable bitmap fonts at all. Is there a relation at all between them? One more thing, in the command above to enable bitmap fonts sudo ln -s ../conf.avail/70-yes-bitmaps.conf there is no ./ compared to your command – swingcake May 24 '18 at 16:08
  • 1
    @swingcake I got the default files for Bionic by downloading the .deb package for fontconfig-config and inspecting its contents. I'm not sure why they might remove the 10-* configs. Maybe they were intending to make all fonts non-antialiased. I used ./ to be explicit about creating the symlink in the current directory (just what I'm used to and more similar to usage of the cp command), though it can be omitted and ln creates a symlink in the current directory by default. – Candy Gumdrop May 24 '18 at 16:15
  • 1
    @swingcake Updated the answer (no it won't affect other fonts). – Candy Gumdrop May 24 '18 at 17:45
1

Aside answer by @Candy Gumdrop, it's good to disable embedded bitmap, some fonts (like Calibri) will look terrible in some resolutions (see image bellow) if this setting stills enabled. Calibri fonts and other cleartype fonts have bitmap versions embedded in them which activate at small sizes, which makes it look bad.

You can disable by doing this:

cd /etc/fonts/conf.d

cat << END | sudo tee ../conf.avail/99-no-embeddedbitmap.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <description>Disable embedded bitmap</description>
  <match target="font" >
    <edit name="embeddedbitmap" mode="assign">
        <bool>false</bool>
    </edit>
  </match>
</fontconfig>
END

sudo ln -s ../conf.avail/99-no-embeddedbitmap.conf ./

sudo dpkg-reconfigure fontconfig

enter image description here

  • I can not up vote this enough! I had the exact same problem. Most probably after installing ttf-mscorefonts-installer which provides some fonts with embedded bitmaps. This helped instantly. No mangled "ti" etc anymore. – Bim Apr 30 at 8:50
  • <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font" > <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit> </match> </fontconfig> Is sufficient though. The rest throws warning and errors... – Bim May 1 at 18:00
  • the 'its' tag is just to avoid translation of description by any software that may configure system's font. It's optional. @Bim -- see w3.org/TR/its20 if you want to go deep in this subject – iuridiniz May 2 at 18:24
  • FontConfig also warns about the description tag not being supported. Im using Ubuntu 18.04.2 here. – Bim May 3 at 14:38
  • Ok, I updated the answer now @Bim – iuridiniz May 3 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.