aboutsummaryrefslogtreecommitdiffstats
path: root/fontconfig/fonts.conf
blob: 7fa5bb9b353267981dad1a3c1d346878b661976d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- ~/.config/fontconfig/fonts.conf
     http://www.freedesktop.org/software/fontconfig/fontconfig-user.html
-->

<fontconfig>
	<match target="font">
		<edit name="rgba" mode="assign"> <const>rgb</const></edit>
		<edit name="antialias" mode="assign"> <bool>true</bool></edit>
		<edit name="autohint" mode="assign"> <bool>false</bool></edit>
		<edit name="hinting" mode="assign"> <bool>true</bool></edit>
		<edit name="hintstyle" mode="assign"> <const>hintslight</const></edit>
		<edit name="lcdfilter" mode="assign"> <const>lcdlight</const></edit>
		<edit name="embeddedbitmap" mode="assign"> <bool>false</bool></edit>
	</match>

	<!-- Prefer Adobe's Source fonts -->
	<alias>
		<family>serif</family>
		<prefer>
			<family>Source Serif Pro</family>
			<family>Source Han Serif JP</family>
		</prefer>
	</alias>
	<alias>
		<family>sans-serif</family>
		<prefer>
			<family>Source Sans Pro</family>
			<family>Source Han Sans JP</family>
		</prefer>
	</alias>
	<alias>
		<family>monospace</family>
		<prefer><family>Source Code Pro</family></prefer>
	</alias>

	<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>

	<!-- Make mono fonts I care about actually be treated as monospace rather than sans-serif -->
	<alias>
		<family>Inconsolatazi4</family>
		<default>
			<family>monospace</family>
		</default>
	</alias>
	<alias>
		<family>Source Code Pro</family>
		<default>
			<family>monospace</family>
		</default>
	</alias>

	<!-- by default fontconfig assumes any unrecognized font is sans-serif, so -->
	<!-- the fonts above now have /both/ families.  fix this. -->
	<!-- note that "delete" applies to the first match -->
	<!-- https://eev.ee/blog/2015/05/20/i-stared-into-the-fontconfig-and-the-fontconfig-stared-back-at-me/ -->
	<match>
		<test compare="eq" name="family"><string>sans-serif</string></test>
		<test compare="eq" name="family"><string>monospace</string></test>
		<edit mode="delete" name="family"/>
	</match>

	<selectfont>
		<rejectfont>
			<pattern><patelt name="family"><string>Nimbus Sans</string></patelt></pattern>
			<pattern><patelt name="family"><string>Nimbus Mono</string></patelt></pattern>
			<pattern><patelt name="family"><string>URW Palladio</string></patelt></pattern>
			<pattern><patelt name="family"><string>Clean</string></patelt></pattern>
			<pattern><patelt name="family"><string>FreeSans</string></patelt></pattern>
		</rejectfont>
	</selectfont>

	<!-- Re-enable embedded bitmaps for CJK fonts -->
	<match target="font">
		<test name="lang" compare="contains"> <string>ja</string> </test>
		<edit name="embeddedbitmap"> <bool>true</bool> </edit>
	</match>
	<match target="font">
		<test name="lang" compare="contains"> <string>ko</string> </test>
		<edit name="embeddedbitmap"> <bool>true</bool> </edit>
	</match>
	<match target="font">
		<test name="lang" compare="contains"> <string>zh</string> </test>
		<edit name="embeddedbitmap"> <bool>true</bool> </edit>
	</match>
</fontconfig>

<!-- vim: set ft=xml -->