diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-12-06 21:55:02 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-12-06 21:55:02 +0800 |
commit | c51a8d9f62ba9fd260ab3d4cde164c081ed20988 (patch) | |
tree | cbd106acbad1498d50989a4993288f1901e414eb /_config/fontconfig/conf.d/50-user.conf | |
parent | ed5c60d80b163b4ba7204d7ab694c0ca0607cffa (diff) | |
download | dotfiles-c51a8d9f62ba9fd260ab3d4cde164c081ed20988.tar.bz2 |
fontconfig: Re-order configs; Move "fonts.conf" as "50-user.conf"
NOTE:
Explicitly set the orders for Noto CJK fonts (SC, TC, JP, KR), in order
to get rid of "LC_CTYPE" environment variable.
Therefore, the preferred English fonts (e.g., Source Code Pro, Source
Sans Pro) are by default used, avoiding the Chinese fonts being prepend
at the beginning.
Diffstat (limited to '_config/fontconfig/conf.d/50-user.conf')
-rw-r--r-- | _config/fontconfig/conf.d/50-user.conf | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/_config/fontconfig/conf.d/50-user.conf b/_config/fontconfig/conf.d/50-user.conf new file mode 100644 index 0000000..fda01a0 --- /dev/null +++ b/_config/fontconfig/conf.d/50-user.conf @@ -0,0 +1,112 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<fontconfig> + +<!-- +User-wide font configurations + +Configuration file ordering (prefix & description): +50 : User overrides +51 : Local system overrides +55-59 : High priority LGC (latin greek cyrillic) fonts + (distribution general-purpose default fonts) +60 : Main LGC font list +61-64 : Low priority LGC fonts +65-69 : Fonts with less common encodings, ending with fonts that + provide coverage of exotic unicode blocks at the expense of + drawing quality. + +References: +[1] https://freedesktop.org/software/fontconfig/fontconfig-user.html + See also `fonts.conf(5)' +[2] https://fedoraproject.org/wiki/Fontconfig_packaging_tips +[3] https://wiki.archlinux.org/index.php/font_configuration +[4] https://wiki.gentoo.org/wiki/Fontconfig +[5] https://eev.ee/blog/2015/05/20/i-stared-into-the-fontconfig-and-the-fontconfig-stared-back-at-me/ + + +Aaron LI +Created: 2014-04-06 +--> + + <!-- + Set correct common families for custom "serif" and "monospace" fonts, + otherwise fontconfig assumes any /unrecognized/ font is "sans-serif", + thus cause *wrong fallback* fonts being found. + --> + <!-- "serif" faces --> + <alias> + <family>Source Serif Pro</family> + <default><family>serif</family></default> + </alias> + <!-- "monospace" faces --> + <alias> + <family>Source Code Pro</family> + <default><family>monospace</family></default> + </alias> + <alias> + <family>Fira Code</family> + <default><family>monospace</family></default> + </alias> + + <!-- Font families preferences --> + <!-- + <alias> elements provide a shorthand notation for the set of common + match operations needed to substitute one font family for another. + They contain a <family> element followed by optional <prefer>, + <accept> and <default> elements. + --> + <!-- "serif" font family --> + <alias> + <family>serif</family> + <prefer> + <family>Source Serif Pro</family> + <family>Noto Serif</family> + </prefer> + </alias> + <!-- "sans-serif" font family --> + <alias> + <family>sans-serif</family> + <prefer> + <family>Source Sans Pro</family> + <family>Noto Sans</family> + <!-- Also ordering the Noto CJK fonts for "zh-cn"--> + <family>Noto Sans CJK SC</family> + <family>Noto Sans CJK TC</family> + <family>Noto Sans CJK JP</family> + <family>Noto Sans CJK KR</family> + </prefer> + </alias> + <!-- "monospace" font family --> + <alias> + <family>monospace</family> + <prefer> + <family>Source Code Pro</family> + <family>Fira Code</family> + <family>Noto Mono</family> + <!-- Also ordering the Noto CJK fonts for "zh-cn"--> + <family>Noto Sans Mono CJK SC</family> + <family>Noto Sans Mono CJK TC</family> + <family>Noto Sans Mono CJK JP</family> + <family>Noto Sans Mono CJK KR</family> + </prefer> + </alias> + + <!-- Substitute Helvetica and Arial --> + <match> + <test name="family"> + <string>Helvetica</string> + </test> + <edit binding="same" mode="assign" name="family"> + <string>Source Sans Pro</string> + </edit> + </match> + <match> + <test name="family"> + <string>Arial</string> + </test> + <edit binding="same" mode="assign" name="family"> + <string>Source Sans Pro</string> + </edit> + </match> +</fontconfig> |