Difference between revisions of "Improve Font Rendering"

m
Added option to enable infinality mode in freetype2 properties, removed autohint settings and system-ui font, cleaned up formatting
m (Fixed minor spelling error "Appearence" to "Appearance" in step 5)
Tags: Mobile web edit Mobile edit
m (Added option to enable infinality mode in freetype2 properties, removed autohint settings and system-ui font, cleaned up formatting)
Tags: Mobile web edit Mobile edit
Line 2: Line 2:
__TOC__
__TOC__
<translate>
<translate>
===How to improve font rendering with your installed fonts=== <!--T:1-->
 
<!--T:1-->
==How to improve font rendering with your installed fonts==


<!--T:2-->
<!--T:2-->
Line 11: Line 13:
''1. Create the global fontconfig setting file /etc/fonts/local.conf''
''1. Create the global fontconfig setting file /etc/fonts/local.conf''


<!--T:4-->
<!--T:4-->
{{UserCmd|command=sudo nano /etc/fonts/local.conf}}
{{UserCmd|command=sudo nano /etc/fonts/local.conf}}


<!--T:5-->
<!--T:5-->
Paste the following content in the file
Paste the following content in the file


<!--T:6-->
<!--T:6-->
<?xml version="1.0"?>
<?xml version="1.0"?>
  <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  <fontconfig>
  <fontconfig>
   <match target="font">
   <match target="font">
     <edit name="autohint" mode="assign">
     <edit name="antialias" mode="assign">
       <bool>false</bool>
       <bool>true</bool>
     </edit>
     </edit>
     <edit name="hinting" mode="assign">
     <edit name="hinting" mode="assign">
       <bool>true</bool>
       <bool>true</bool>
     </edit>
     <edit mode="assign" name="rgba">
    <edit name="antialias" mode="assign">
       <const>rgb</const>
       <bool>true</bool>
     </edit>
     </edit>
     <edit mode="assign" name="hintstyle">
     <edit mode="assign" name="hintstyle">
       <const>hintslight</const>
       <const>hintslight</const>
    </edit>
    <edit mode="assign" name="rgba">
      <const>rgb</const>
     </edit>
     </edit>
     <edit mode="assign" name="lcdfilter">
     <edit mode="assign" name="lcdfilter">
Line 66: Line 64:
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:


<!--T:13-->
<!--T:13-->
Xft.antialias: 1
Xft.antialias: 1
  Xft.hinting: 1
  Xft.hinting: 1
Xft.autohint: 0
  Xft.rgba: rgb
  Xft.rgba: rgb
  Xft.hintstyle: hintslight
  Xft.hintstyle: hintslight
Line 90: Line 87:
''6. Create symbolic links with some available presets from /usr/share/fontconfig/conf.avail/ to /etc/fonts/conf.d/''
''6. Create symbolic links with some available presets from /usr/share/fontconfig/conf.avail/ to /etc/fonts/conf.d/''


<!--T:18-->
<!--T:18-->
{{UserCmd|command=sudo ln -s  /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/}}
{{UserCmd|command=sudo ln -s  /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d/}}


<!--T:19-->
<!--T:19-->
{{UserCmd|command=sudo ln -s  /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/}}
{{UserCmd|command=sudo ln -s  /usr/share/fontconfig/conf.avail/10-hinting-slight.conf /etc/fonts/conf.d/}}


<!--T:20-->
{{UserCmd|command=sudo ln -s  /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d/}}


<!--T:20-->
 
<!--T:21-->
''7. Set preferred serif, sans-serif and monospace fonts (optional)''
''7. Set preferred serif, sans-serif and monospace fonts (optional)''


<!--T:21-->
<!--T:22-->
Create local fontconfig folder and setting file
Create local fontconfig folder and setting file


<!--T:22-->
<!--T:23-->
{{UserCmd|command=mkdir -p ~/.config/fontconfig/}}
{{UserCmd|command=mkdir -p ~/.config/fontconfig/}}


<!--T:23-->
<!--T:24-->
{{UserCmd|command=nano ~/.config/fontconfig/fonts.conf}}
{{UserCmd|command=nano ~/.config/fontconfig/fonts.conf}}


<!--T:24-->
<!--T:25-->
Paste the following content in the file
Paste the following content in the file


<!--T:25-->
<!--T:26-->
<?xml version="1.0"?>
<?xml version="1.0"?>
  <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  <fontconfig>
  <fontconfig>
Line 144: Line 144:
     <prefer>
     <prefer>
       <family>Liberation Mono</family>
       <family>Liberation Mono</family>
    </prefer>
  </alias>
  <alias>
    <family>system-ui</family>
    <prefer>
      <family>Liberation Sans</family>
     </prefer>
     </prefer>
   </alias>
   </alias>
Line 156: Line 150:




<!--T:26-->
<!--T:27-->
''8. Finally rebuild fontconfig cache and reboot your computer to apply the settings.''
''8. Finally enable freetype2 infinality mode and reboot your computer.''
 
<!--T:28-->
add line to end of freetype2 config file and then rebuild fontconfig cache
 
<!--T:29-->
{{UserCmd| command=sudo nano /etc/profile.d/freetype2.sh}}
 
<!--T:30-->
{{UserCmd| command=export FREETYPE_PROPERTIES="truetype:interpreter-version=38"}}


<!--T:27-->
<!--T:31-->
{{UserCmd|command=sudo fc-cache -fv}}
{{UserCmd|command=sudo fc-cache -fv}}


=See Also= <!--T:28-->
<!--T:32-->
==See Also==




<!--T:29-->
<!--T:33-->
[https://wiki.archlinux.org/index.php/Font_Configuration The Arch Wiki]
[https://wiki.archlinux.org/index.php/Font_Configuration The Arch Wiki]


</translate>
</translate>
[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page{{#translation:}}]]
6

edits