Improve font rendering

This commit is contained in:
Anthony Rose 2021-09-27 22:32:36 +01:00
parent 3f88085b3d
commit c4c538a514
3 changed files with 124 additions and 83 deletions

View file

@ -1,85 +1,118 @@
<?xml version='1.0'?> <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- https://wiki.archlinux.org/title/font_configuration -->
<fontconfig> <fontconfig>
<!-- Smooth fonts. -->
<match target="font"> <match target="font">
<edit mode="assign" name="rgba"> <edit name="antialias" mode="assign">
<const>rgb</const> <bool>true</bool>
</edit> </edit>
</match> </match>
<match target="font">
<edit mode="assign" name="hinting"> <match target="font">
<bool>true</bool> <edit name="hinting" mode="assign">
</edit> <bool>true</bool>
</match> </edit>
<match target="font"> </match>
<edit mode="assign" name="hintstyle">
<const>hintslight</const> <match target="font">
</edit> <edit name="autohint" mode="assign">
</match> <bool>false</bool>
<match target="font"> </edit>
<edit mode="assign" name="antialias"> </match>
<bool>true</bool>
</edit> <match target="font">
</match> <edit name="hintstyle" mode="assign">
<match target="font"> <const>hintslight</const>
<edit mode="assign" name="lcdfilter"> </edit>
<const>lcddefault</const> </match>
</edit>
</match> <match target="font">
<match target="font"> <edit name="rgba" mode="assign">
<edit mode="assign" name="autohint"> <const>rgb</const>
<bool>false</bool> </edit>
</edit> </match>
</match>
<!-- Assign the basic serif, sans-serif, and monospace font families. --> <match target="font">
<match target="pattern"> <edit name="lcdfilter" mode="assign">
<test qual="any" name="family"> <const>lcddefault</const>
<string>serif</string> </edit>
</test> </match>
<edit mode="assign" name="family">
<string>Liberation Serif</string> <selectfont>
</edit> <rejectfont>
</match> <pattern>
<match target="pattern"> <patelt name="scalable">
<test qual="any" name="family"> <bool>false</bool>
<string>sans-serif</string> </patelt>
</test> </pattern>
<edit mode="assign" name="family"> </rejectfont>
<string>Liberation Sans</string> </selectfont>
</edit>
</match> <alias>
<match target="pattern"> <family>serif</family>
<test qual="any" name="family"> <prefer>
<string>monospace</string> <family>DejaVu Serif</family>
</test> <family>Bitstream Vera Serif</family>
<edit mode="assign" name="family"> <family>Times New Roman</family>
<string>Liberation Mono</string> <family>Thorndale AMT</family>
</edit> <family>Luxi Serif</family>
</match> <family>Nimbus Roman No9 L</family>
<!-- Substitute basic PostScript fonts with better looking ones. --> <family>Nimbus Roman</family>
<match target="pattern"> <family>Times</family>
<test qual="any" name="family"> </prefer>
<string>Times</string> </alias>
</test>
<edit mode="assign" name="family"> <alias>
<string>Liberation Serif</string> <family>sans-serif</family>
</edit> <prefer>
</match> <family>DejaVu Sans</family>
<match target="pattern"> <family>Bitstream Vera Sans</family>
<test qual="any" name="family"> <family>Verdana</family>
<string>Helvetica</string> <family>Arial</family>
</test> <family>Albany AMT</family>
<edit mode="assign" name="family"> <family>Luxi Sans</family>
<string>Liberation Sans</string> <family>Nimbus Sans L</family>
</edit> <family>Nimbus Sans</family>
</match> <family>Helvetica</family>
<match target="pattern"> <family>Lucida Sans Unicode</family>
<test qual="any" name="family"> </prefer>
<string>Courier</string> </alias>
</test>
<edit mode="assign" name="family"> <alias>
<string>Liberation Mono</string> <family>monospace</family>
</edit> <prefer>
</match> <family>DejaVu Sans Mono</family>
<family>Bitstream Vera Sans Mono</family>
<family>Inconsolata</family>
<family>Andale Mono</family>
<family>Courier New</family>
<family>Cumberland AMT</family>
<family>Luxi Mono</family>
<family>Nimbus Mono L</family>
<family>Nimbus Mono</family>
<family>Nimbus Mono PS</family>
<family>Courier</family>
</prefer>
</alias>
<alias>
<family>fantasy</family>
<prefer>
<family>Impact</family>
<family>Copperplate Gothic Std</family>
<family>Cooper Std</family>
<family>Bauhaus Std</family>
</prefer>
</alias>
<alias>
<family>cursive</family>
<prefer>
<family>ITC Zapf Chancery Std</family>
<family>Zapfino</family>
<family>Comic Sans MS</family>
</prefer>
</alias>
</fontconfig> </fontconfig>

View file

@ -29,3 +29,7 @@
ansible.builtin.file: ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.local/share/fonts" path: "{{ ansible_env.HOME }}/.local/share/fonts"
state: directory state: directory
- name: Create ~/.config/fontconfig directory
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.config/fontconfig"
state: directory

View file

@ -49,3 +49,7 @@
ansible.builtin.copy: ansible.builtin.copy:
src: "xbindkeysrc" src: "xbindkeysrc"
dest: "{{ ansible_env.HOME }}/.xbindkeysrc" dest: "{{ ansible_env.HOME }}/.xbindkeysrc"
- name: Copy fonts.conf
ansible.builtin.copy:
src: "fonts.conf"
dest: "{{ ansible_env.HOME }}/.config/fontconfig/fonts.conf"