2

After upgrading to Ubuntu 17.10 my fonts look rather blurry. In 17.04, my Emacs looked like this

(random screenshot I found on the internet)

whereas now it looks like this

blurry fonts

As you can see the same happens on my top bar (I'm running the awesome window manager) but also on the terminal and all applications top bars. This happens regardless of the window manager (awesome, Gnome, i3 etc.) and the X server (Wayland or Xorg).

My ~/.fonts.conf looks like this

<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <fontconfig>
     <match target="font">
         <edit mode="assign" name="rgba"> <const>rgb</const> </edit>
         <edit mode="assign" name="hinting"> <bool>true</bool> </edit>
         <edit mode="assign" name="hintstyle"> <const>hintsfull</const> </edit>
       <edit name="lcdfilter" mode="assign"> <const>lcddefault</const> </edit>
       <edit mode="assign" name="antialias"> <bool>true</bool> </edit>
       <edit mode="assign" name="autohint"> <bool>false</bool> </edit>
     <edit mode="assign" name="dpi"> <bool>96</bool> </edit>
     </match>
 </fontconfig>
  • Are you using Wayland or X server? Are you running Ubuntu or a different flavor like Kubuntu? – PJ Singh Dec 21 '17 at 17:49
  • Singh,I am rrunning the standard Ubuntu distribution and this happens with both Wayland and Xorg. Thanks! – Alfredo Dec 21 '17 at 19:30
  • Have you seen the answers? – Anwar Jan 1 '18 at 15:07
3

Steps to Improve Fonts

  1. First, you should delete all of your .font.config file(s).

    (You can create a backup, if you like).

    rm ~/.fonts.conf
    

    Make sure there are no other font config files lurking in your home directory. You can search for them using:

    find ~/ -name *fonts.conf
    

    If you find any, delete them (or make a backup, if you like).

  2. Then, set font anti-aliasing and hinting using one of the following techniques.

    • You can do this using the command line.

      Available hinting options are 'full', 'medium', or 'slight', but I suggest 'full'.

      gsettings set org.gnome.settings-daemon.plugins.xsettings] antialiasing 'rgba'
      gsettings set org.gnome.settings-daemon.plugins.xsettings] hinting 'full'
      
    • Alternatively, you can use a GUI.

      Install Gnome Tweak Tool.

      sudo apt install gnome-tweak-tool
      

      Launch Gnome Tweak Tool, and set the font hinting and anti-aliasing; I suggest "Full" and "Subpixel" as shown here:

      Gnome Tweak Tool Font Settings

  3. Finally, set the system font hinting for applications like Firefox that do not honor the selections above.

    You can set hinting to '10-hinting-full.conf', '10-hinting-medium.conf', or '10-hinting-slight.conf', but I suggest '10-hinting-full.conf' as shown. For consistency, use the same hinting here, as you used in step 2.

    sudo rm /etc/fonts/conf.d/10-hinting-*.conf
    sudo ln -sv /etc/fonts/conf.avail/10-hinting-full.conf /etc/fonts/conf.d/
    

Xorg vs. Wayland

After completing the above steps, the fonts in the dock and top bar may still appear blurry, if you are using Wayland. This is due to to Launchpad bug #1714459, Shell font is blurry under Wayland. This bug is targeted to be fixed in package mutter 3.26.3. You can check which version of mutter you have using:

dpkg -l mutter

Therefore, I suggest you use Xorg to avoid this bug, and all your fonts, including the dock and top bar, will look sharp (after completing the above steps, of course).

| improve this answer | |
  • 1
    Singh, unfortunately that didn't help. Fonts are actually sharp but are thicker than what they used to be before upgrading. – Alfredo Dec 22 '17 at 8:28
  • After you make the above changes, is the issue only in Emacs, or do you see the same thick/blurry fonts in the rest of the OS? Also, I noticed you are using different fonts in each of the screenshots. Are the font sizes equivalent, from screenshot 1 to screenshot 2, or did you significantly reduce the font size in the second screenshot? – PJ Singh Dec 22 '17 at 14:54
  • I posted my message also on reddit.com/r/unixporn and I eventually managed to find a workaround (not a solution though) for this issue. This is due to an "upgrade" of the freetype interpreter. The issue is also described here. Adding the following lines in ~/.profile (or wherever is best for your environment) export FREETYPE_PROPERTIES="truetype:interpreter-version=35" makes my fonts nice and crisp as before the Ubuntu upgrade. – Alfredo Dec 25 '17 at 9:19
  • It seems, all this did not help to improve the situation with fonts in FireFox 60.0.2 in Ubuntu 18.04. Any ideas what else could help to remove blurriness in FireFox? – TecMan Jun 14 '18 at 12:27
  • Are you sure that you do not have a .fonts.conf file (notice the "dot") in your path that is overriding your settings? – PJ Singh Jun 14 '18 at 15:18
0

Your problem lies in this line of ~/.fonts.conf

<edit mode="assign" name="hintstyle"><const>hintsfull</const></edit>

Change it to hintslight to have default hinting enabled.

| improve this answer | |

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.