Difference between revisions of "Improve Font Rendering"

Removed BCI settings, properly formatted font setting xml file, updated location of presets and added option to set preferred fonts
m (Changed path - conf.avail)
(Removed BCI settings, properly formatted font setting xml file, updated location of presets and added option to set preferred fonts)
Line 5: Line 5:




''1. Create the file /etc/fonts/local.conf''
''1. Create the global fontconfig setting file /etc/fonts/local.conf''


  sudo nano /etc/fonts/local.conf
  sudo nano /etc/fonts/local.conf
Line 11: Line 11:
Paste the following content in the file
Paste the following content in the file


  <match target="font">
  <?xml version="1.0"?>
  <edit name="autohint" mode="assign">
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <bool>false</bool>
<fontconfig>
  </edit>
  <match target="font">
  <edit name="hinting" mode="assign">
    <edit name="autohint" mode="assign">
    <bool>true</bool>
      <bool>true</bool>
  </edit>
    </edit>
  <edit name="antialias" mode="assign">
    <edit name="hinting" mode="assign">
    <bool>true</bool>
      <bool>true</bool>
  </edit>
    </edit>
  <edit mode="assign" name="hintstyle">
    <edit name="antialias" mode="assign">
    <const>hintslight</const>
      <bool>true</bool>
  </edit>
    </edit>
  <edit mode="assign" name="rgba">
    <edit mode="assign" name="hintstyle">
    <const>rgb</const>
      <const>hintslight</const>
  </edit>
    </edit>
  <edit mode="assign" name="lcdfilter">
    <edit mode="assign" name="rgba">
    <const>lcddefault</const>
      <const>rgb</const>
   </edit>
    </edit>
  </match>
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
   </match>
  </fontconfig>
 


After that save the file.
After that save the file.
Line 48: Line 53:
If the following is not already present, paste at the end of the file or edit existing values:
If the following is not already present, paste at the end of the file or edit existing values:


  Xft.dpi: 96
  Xft.antialias: 1
  Xft.antialias: true
  Xft.hinting: 1
  Xft.hinting: true
  Xft.autohint: 1
  Xft.rgba: rgb
  Xft.rgba: rgb
Xft.autohint: false
  Xft.hintstyle: hintslight
  Xft.hintstyle: hintslight
  Xft.lcdfilter: lcddefault
  Xft.lcdfilter: lcddefault
Line 73: Line 77:




''7. Set truetype interpreter version to infinality mode (optional)''
''7. Set preferred serif, sans-serif and monospace fonts (optional)''
 
Create local fontconfig folder and setting file
 
mkdir -p ~/.config/fontconfig/
 
nano ~/.config/fontconfig/fonts.conf
 
Paste the following content in the file


  sudo nano /etc/profile.d/freetype2.sh
  <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Liberation Serif</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Liberation Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>sans</family>
    <prefer>
      <family>Liberation Sans</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Liberation Mono</family>
    </prefer>
  </alias>
  <alias>
    <family>mono</family>
    <prefer>
      <family>Liberation Mono</family>
    </prefer>
  </alias>
</fontconfig>


Edit content of the file to reflect setting below


# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
# version. The available settings are:
#
# truetype:interpreter-version=35 # Classic mode (default in 2.6)
# truetype:interpreter-version=38 # Infinality mode
# truetype:interpreter-version=40 # Minimal mode (default in 2.7)
#
# There are more properties that can be set, separated by whitespace. Please
# refer to the FreeType documentation for details.
# Uncomment and configure below
export FREETYPE_PROPERTIES="truetype:interpreter-version=38"


''8. Finally rebuild fontconfig cache and reboot your computer to apply the settings.''


''8. Finally reboot your computer to apply the settings.''
sudo fc-cache -fv


=See Also=
=See Also=
6

edits