Home > linux > Switching your default Sans/Sans Serif/Monospace Fonts 2.0

Switching your default Sans/Sans Serif/Monospace Fonts 2.0

Updated from my original post to replace the default Sans/Sans-Serif/Monospace defaults to something different.

These days I like the new ChromeOS Fonts a lot, so I wanted fontconfig to use them as defaults. In this regard, they are really well suited as Arial/Verdana/Times New Roman/Courier New replacements, too. Killing two birds with one stone? Me likes! 🙂 Replacing those Microsoft fonts with their counterparts therefore comes quite naturally as they aren’t always installed – and actually, I don’t really like them being installed. In case they are indeed installed, I use a match/edit combination here – aliases only work if the original fonts are not installed and fail if they are. Strong binding is used to override any distribution defaults.

ChromeOS/Microsoft font comparison

ChromeOS/Microsoft font comparison, thanks to http://www.omgubuntu.co.uk

Snippet this into $HOME/.fonts.conf:

<!--?xml version="1.0"?>-->
<!--DOCTYPE fontconfig SYSTEM "fonts.dtd">-->
<!-- ~/.fonts.conf for per-user font configuration -->
<fontconfig>

	<!-- Alias commonly used default names -->
	<!-- serif, sans-serif, sans and monospace -->
	<!-- to the ChromeOS fonts -->
	<alias>
		<family>serif</family>
	<prefer>
		<family>Tinos</family>
	</prefer>
	</alias>
	<alias>
		<family>sans-serif</family>
	<prefer>
		<family>Arimo</family>
	</prefer>
	</alias>
	<alias>
		<family>sans</family>
	<prefer>
		<family>Arimo</family>
	</prefer>
	</alias>
	<alias>
	<family>monospace</family>
	<prefer>
		<family>Cousine</family>
	</prefer>
	</alias>

	<!-- Replace Arial, Times New Roman, Verdana and Courier New -->
	<!-- with their counterparts. Strong binding used to override -->
	<!-- distribution defaults -->
	<match target="pattern" name="family" >
    		<test name="family" qual="any" >
        		<string>Arial</string>
    		</test>
    		<edit name="family" mode="assign" binding="strong">
        		<string>Arimo</string>
    		</edit>
	</match>
	<match target="pattern" name="family" >
    		<test name="family" qual="any" >
        		<string>Times New Roman</string>
    		</test>
    		<edit name="family" mode="assign" binding="strong">
        		<string>Tinos</string>
    		</edit>
	</match>
	<match target="pattern" name="family" >
    		<test name="family" qual="any">
        		<string>Verdana</string>
    		</test>
    		<edit name="family" mode="assign" binding="strong">
        		<string>Arimo</string>
    		</edit>
	</match>
	<match target="pattern" name="family" >
    		<test name="family" qual="any" >
        		<string>Courier New</string>
    		</test>
    		<edit name="family" mode="assign" binding="strong">
        		<string>Cousine</string>
    		</edit>
	</match>
</fontconfig>
Advertisements
Categories: linux Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: