<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

	<!-- 
	
	This /etc/fonts/local.conf file is intended to be used
	in conjunction with the infinality subpixel hinting patch at
	http://www.infinality.net/ 
		
	-->

	<alias binding="same">
		<family>System</family>
		<accept>
			<family>Segoe UI</family>
		</accept>
	</alias>
	<alias binding="same">
		<family>MS Shell Dlg</family>
		<accept>
			<family>Segoe UI</family>
		</accept>
	</alias>
	<alias binding="same">
		<family>MS Sans Serif</family>
		<accept>
			<family>Segoe UI</family>
		</accept>
	</alias>

	<!-- ********************  DIRECTIVES  **********************  -->

	<!-- prevent gnome from using embedded bitmaps in fonts like Calibri -->
	<match target="font" >
		<edit name="embeddedbitmap" mode="assign">
			<bool>false</bool>
		</edit>
	</match>

	<!-- Reject bitmap fonts in favour of Truetype, Postscript, etc. -->
	<selectfont>
		<rejectfont>
			<pattern>
				<patelt name="scalable" >
					<bool>false</bool>
				</patelt>
			</pattern>
		</rejectfont>
	</selectfont>
	
	<!-- substitute truetype fonts for bitmap ones -->
	<match target="pattern" >
		<edit name="prefer_outline" >
			<bool>true</bool>
		</edit>
	</match>	

	<!-- ********************  REPLACEMENTS  **********************  -->

	<alias>
		<family>sans</family>
		<default>
			<family>Arial</family>
		</default>
	</alias>

	<alias>
		<family>sans-serif</family>
		<default>
			<family>Arial</family>
		</default>
	</alias>

	<alias>
		<family>Helvetica</family>
		<family>Helvetica Neue</family>
		<default>
			<family>Arial</family>
		</default>
	</alias>

	<!-- Replaces 'sans' with a specific font preference -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>sans</string>
			
		</test>
		<edit mode="assign" name="family" >
			<string>Arial</string>
		</edit>
	</match>	

	<!-- Replaces 'sans-serif' with a specific font preference -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>sans-serif</string>
		</test>
		<edit mode="assign" name="family" >
			<string>Arial</string>
		</edit>
	</match>
	
	<!-- Replaces 'serif' with a specific font preference -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>serif</string>
		</test>
		<edit mode="assign" name="family" >
			<string>Times New Roman</string>
		</edit>
	</match>	

	<!-- Replaces Helveticas with Arial -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>Helvetica</string>
			<string>Helvetica Neue</string>
			<string>Geneva</string>	
			<!-- This turd font interferes with firefox sometimes -->
			<string>Nimbus Sans L</string>			
		</test>
		<edit mode="assign" name="family" >
			<string>Arial</string>
		</edit>
	</match>

	<match target="pattern" name="family">
		<test name="family" qual="any" >
			<string>Helvetica</string>
			<string>Helvetica Neue</string>
			<string>Geneva</string>
			<!-- This turd font interferes with firefox sometimes -->
			<string>Nimbus Sans L</string>			
		</test>
		<edit binding="strong" mode="prepend" name="family" >
			<string>Arial</string>
		</edit>
	</match>

	<!-- Replaces Palatino with Palatino Linotype -->
	<match target="pattern" name="family" >
		<test name="family" qual="any" >
			<string>Palatino</string>
		</test>
		<edit binding="strong" mode="prepend" name="family" >
			<string>Palatino Linotype</string>
		</edit>
	</match>
	
	<match target="font" >
		<test name="family" qual="any" >
			<string>Palatino</string>
		</test>
		<edit mode="assign" name="family" >
			<string>Palatino Linotype</string>
		</edit>
	</match>	


	<!-- Replaces 'Times' with Times New Roman -->
	<match target="pattern" name="family" >
		<test name="family" qual="any" >
			<string>Times</string>
		</test>
		<edit binding="strong" mode="prepend" name="family" >
			<string>Times New Roman</string>
		</edit>
	</match>	
	
	<match target="font" >
		<test name="family" qual="any" >
			<string>Times</string>
		</test>
		<edit mode="assign" name="family" >
			<string>Times New Roman</string>
		</edit>
	</match>

	<!-- Replaces 'Nimbus Mono L' with Courier New -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>Nimbus Mono L</string>
			<string>Courier</string>
		</test>
		<edit mode="assign" name="family" >
			<string>Courier New</string>
		</edit>
	</match>
	
	<match target="pattern" name="family" >
		<test name="family" compare="eq" target="default">
			<string>Nimbus Mono L</string>
			<string>Courier</string>
		</test>
		<edit binding="strong" mode="prepend" name="family" >
			<string>Courier New</string>
		</edit>
	</match>	
	
	<match target="pattern">
		<test name="family" compare="eq" target="default">
			<string>Courier</string>
		</test>
		<edit name="family" mode="prepend" binding="same">
			<string>Courier New</string>
		</edit>
	</match>


	<!-- Replaces 'Microsoft Sans serif' bold with Arial -->
	<match target="pattern" name="family" >
		<test name="family" qual="any" >
			<string>Microsoft Sans Serif</string>
		</test>
		<test compare="more" name="weight" >
			<const>medium</const>
		</test>
		<edit binding="strong" mode="prepend" name="family" >
			<string>Arial</string>
		</edit>
	</match>

	<match target="pattern" name="family" >
		<test name="family" qual="any" >
			<string>Monaco</string>
		</test>
		<test compare="more" name="weight" >
			<const>medium</const>
		</test>
		<edit binding="strong" mode="prepend" name="family" >
			<string>DejaVu Sans Mono</string>
		</edit>
	</match>

	<!-- Replace "Arial" with black weight, with font "Arial Black" -->
	<match target="pattern">
		<test name="family" compare="eq" target="default">
			<string>Arial</string>
		</test>
		<test compare="more" name="weight" >
			<const>bold</const>
		</test>
		<edit name="family" mode="prepend" binding="same">
			<string>Arial Black</string>
		</edit>
		<edit name="weight" mode="assign">
			<const>bold</const>
		</edit>
	</match>

	<!-- Replace "Arial Unicode MS" bold with Arial bold weight -->
	<match target="pattern">
		<test name="family" compare="eq" target="default">
			<string>Arial Unicode MS</string>
		</test>
		<test compare="more" name="weight" >
			<const>medium</const>
		</test>
		<edit name="family" mode="prepend" binding="same">
			<string>Arial</string>
		</edit>
		<edit name="weight" mode="assign">
			<const>bold</const>
		</edit>
	</match>

	<!-- Replace "Lucida Sans Unicode" bold with Lucida Grande bold weight -->
	<match target="pattern">
		<test name="family" compare="eq" target="default">
			<string>Lucida Sans Unicode</string>
		</test>
		<test compare="more" name="weight" >
			<const>medium</const>
		</test>
		<edit name="family" mode="prepend" binding="same">
			<string>Lucida Grande</string>
		</edit>
		<edit name="weight" mode="assign">
			<const>bold</const>
		</edit>
	</match>	

	<!-- ********************  TWEAKS  **********************  -->

	<!-- make verdana 9 and 10 appear like they do on Windows -->
	<match target="font">
		<test name="family">
			<string>Verdana</string>
		</test>
		<test compare="less" name="weight" >
			<const>bold</const>
		</test>
		<test compare="more_eq" name="pixelsize" qual="any" >
			<double>9</double>
		</test>		
		<test compare="less_eq" name="pixelsize" qual="any" >
				<double>10</double>
		</test>
		<edit name="matrix" mode="prepend">
			<times>
				<name>matrix</name>
				<matrix>
					<double>1.1</double>
					<double>0</double>
					<double>0</double>
					<double>1</double>
				</matrix>
			</times>
		</edit>
		<edit name="scalable" mode="assign" binding="strong">
			<bool>true</bool>
		</edit>
		<edit name="scale" mode="assign" binding="strong">
			<double>10</double>
		</edit>
	</match>


	<!-- ********************  BASE SETTINGS  **********************  -->

	<!-- These are the base settings for all rendered fonts. 
	We modify them for specific fonts later. -->
	<match target="font" >
		<edit mode="assign" name="rgba" >
			<const>rgb</const>
		</edit>
		<edit mode="assign" name="hinting" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
		<edit mode="assign" name="antialias" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintfull</const>
		</edit>
		<edit name="lcdfilter" mode="assign">
			<const>lcddefault</const>
		</edit>
	</match>


	<!-- ********************  FONT GROUPS  **********************  -->

	<!-- Full hinting for these fonts -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>xxxNOTHINGxxx</string>
		</test>
		<edit mode="assign" name="hinting" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="antialias" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintfull</const>
		</edit>
	</match>

	<!-- Full Subpixel BCI for these fonts.  On by default, but here for documentation. -->
	<!--<match target="font" >
		<test name="family" qual="any" >
			<string>Andale Mono</string>
			<string>Andalus</string>
			<string>Angsana New</string>
			<string>AngsanaUPC</string>
			<string>Aquabase</string>
			<string>Arial MT</string>
			<string>Arial Narrow</string>
			<string>Arial SF MT</string>
			<string>Arial Unicode MS</string>
			<string>Arial</string>			
			<string>ArialMT</string>
			<string>Bitstream Vera Sans Mono</string>
			<string>Bitstream Vera Sans</string>
			<string>Bitstream Vera Serif</string>
			<string>Book Antiqua</string>
			<string>Bookman Old Style</string>
			<string>Browallia New</string>
			<string>BrowalliaUPC</string>			
			<string>Calibri</string>
			<string>Cambria</string>
			<string>Candara</string>
			<string>Chalkboard</string>
			<string>Charcoal CY</string>
			<string>Charcoal</string>
			<string>Charis SIL</string>
			<string>Chicago</string>
			<string>Comic Sans MS</string>
			<string>Consolas</string>
			<string>Constantia</string>
			<string>Copperplate</string>
			<string>Corbel</string>
			<string>Cordia New</string>
			<string>CordiaUPC</string>
			<string>Courier 10 Pitch</string>
			<string>Courier New</string>
			<string>Courier</string>
			<string>Dark Courier</string>
			<string>David</string>
			<string>DejaVu LGC Sans Mono</string>
			<string>DejaVu Sans Mono</string>
			<string>DejaVu Sans</string>
			<string>DejaVu Serif</string>
			<string>Droid Sans Mono</string>
			<string>Droid Sans</string>
			<string>Estrangelo Edessa</string>
			<string>Euphemia</string>			
			<string>FrankRuehl</string>			
			<string>Franklin Gothic Medium</string>
			<string>Futura</string>
			<string>Geneva CY</string>
			<string>Geneva Regular</string>
			<string>Geneva</string>
			<string>Gill Sans</string>
			<string>Gotham Book</string>
			<string>Gotham Light</string>
			<string>Gotham Medium</string>
			<string>Guatami</string>
			<string>Impact</string>
			<string>Latha</string>
			<string>Levinim MT</string>
			<string>Liberation Mono</string>
			<string>Liberation Sans</string>
			<string>Liberation Serif</string>
			<string>Linux Libertine</string>
			<string>Lucida Console</string>
			<string>Lucida Grande</string>
			<string>Lucida Sans Std</string>
			<string>Lucida Sans Unicode</string>
			<string>Luxi Mono</string>
			<string>Luxi Sans</string>
			<string>Luxi Serif</string>
			<string>Malgun Gothic</string>
			<string>Microsoft Himalaya</string>
			<string>Microsoft JhengHei</string>
			<string>Microsoft Sans Serif</string>
			<string>Microsoft Uighur</string>
			<string>Microsoft YaHei</string>
			<string>Microsoft Yi Baiti</string>
			<string>Miriam Fixed</string>
			<string>Monaco</string>
			<string>Mongolian Baiti</string>
			<string>MoolBoran</string>
			<string>Myriad Pro</string>
			<string>Narkisim</string>
			<string>Nina</string>
			<string>Nyala</string>
			<string>Padauk</string>
			<string>Palatino Linotype</string>
			<string>Plantagenet Cherokee</string>
			<string>Raavi</string>
			<string>Segoe UI</string>
			<string>TITUS Cyberbit Basic</string>
			<string>Tahoma</string>
			<string>Times New Roman</string>
			<string>Traditional Arabic</string>
			<string>Trebuchet MS</string>
			<string>Tunga</string>
			<string>Verdana</string>
			<string>Vrinda</string>			
		</test>
		<edit mode="assign" name="hinting" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
		<edit mode="assign" name="antialias" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintfull</const>
		</edit>
	</match>-->

	<!-- Full TT Hinting -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>xxxNOTHINGxxx</string>
		</test>
		<edit mode="assign" name="hinting" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
		<edit mode="assign" name="antialias" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintfull</const>
		</edit>
	</match>

	<!-- Bi-level BCI for these non-bold fonts -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>xxxNOTHINGxxx</string>
		</test>
		<edit mode="assign" name="hinting" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
		<edit mode="assign" name="antialias" >
			<bool>false</bool>
		</edit>
		<edit mode="assign" name="hintstyle" >
			<const>hintfull</const>
		</edit>
	</match>

	<!-- Make these fonts use no antialiasing or hinting -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>ProFontWindows</string>
			<string>Terminus</string>
		</test>
		<edit mode="assign" name="hintstyle" >
			<const>hintnone</const>
		</edit>
		<edit mode="assign" name="antialias" >
			<bool>false</bool>
		</edit>
		<edit mode="assign" name="hinting" >
			<bool>false</bool>
		</edit>
	</match>

	<!-- Make these fonts use autohint slight hinting -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>AR PL ShanHeiSun Uni</string>
			<string>American Typewriter</string>
			<string>Apple Chancery</string>
			<string>Apple Garamond Light</string>
			<string>Apple Garamond</string>
			<string>Apple Symbols</string>
			<string>Arabic Typesetting</string>
			<string>Arial Black</string>
			<string>Baekmuk Gulim</string>
			<string>Baskerville</string>
			<string>Big Caslon</string>
			<string>Bitstream Charter</string>
			<string>BrushScript</string>
			<string>Century Gothic</string>
			<string>Century Schoolbook L</string>
			<string>Century</string>
			<string>Charis SIL</string>
			<string>Cochin</string>
			<string>Courier Std</string>
			<string>Courier10 BT</string>
			<string>Delicious</string>
			<string>DilenniaUPC</string>
			<string>District</string>
			<string>DokChampa</string>
			<string>Dutch801 Rm BT</string>
			<string>EucrosiaUPC</string>
			<string>FreeMono</string>
			<string>FreeSans</string>
			<string>FreeSerif</string>
			<string>FreesiaUPC</string>
			<string>Frutiger LT Std</string>
			<string>Frutiger Linotype</string>
			<string>Frutiger-Normal</string>
			<string>Garamond</string>
			<string>Gautami</string>
			<string>Gentium</string>
			<string>Georgia</string>
			<string>Hard Gothic</string>
			<string>Herculanum</string>
			<string>Hoefler Text</string>
			<string>Inconsolata</string>		
			<string>IrisUPC</string>
			<string>IrisUPC</string>
			<string>JasmineUPC</string>
			<string>Jomolhari</string>
			<string>Kai</string>
			<string>Kalinga</string>
			<string>KodchiangUPC</string>
			<string>Lacuna</string>			
			<string>Levenim MT</string>
			<string>LilyUPC</string>
			<string>LilyUPC</string>
			<string>Lohit Bengali</string>
			<string>Lohit Gujarati</string>
			<string>Lohit Hindi</string>
			<string>Lohit Hindi</string>
			<string>Lohit Kannada</string>
			<string>Lohit Malayalam</string>
			<string>Lohit Oriya</string>
			<string>Lohit Punjabi</string>
			<string>Lohit Tamil</string>
			<string>Lohit Telugu</string>			
			<string>M+ 2p</string>
			<string>Marker Felt</string>
			<string>MetaMedium-Roman</string>
			<string>Metabook-Roman</string>
			<string>MgOpen Canonica</string>
			<string>MgOpen Cosmetica</string>
			<string>MgOpen Cosmetica</string>
			<string>MgOpen Modata</string>
			<string>MgOpen Moderna</string>
			<string>Miriam</string>
			<string>MyriadRegular</string>
			<string>Nimbus Roman No9 L</string>
			<string>Nimbus Sans L</string> 
			<string>Nimbus Mono L</string> 			
			<string>Ocean Sans Std</string>
			<string>Optima</string>
			<string>Papyrus</string>
			<string>PrimaSans BT</string>
			<string>Skia</string>
			<string>Swansea</string>
			<string>Swiss721</string>
			<string>Sylfaen</string>
			<string>Times LT Std</string>
			<string>Times New Roman MT Std</string>
			<string>Times Roman</string>
			<string>Times Ten LT Std</string>
			<string>Univers LT Std</string>
			<string>Utopia</string>
			<string>Verdimka</string>
			<string>Zapfino</string>
			<string>cmbx10</string>
			<string>cmex10</string>
			<string>cmmi10</string>
			<string>cmr10</string>
			<string>cmsy10</string>
			<string>cmtt10</string>
			<string>eufm10</string>
			<string>msam10</string>
			<string>msbm10</string>
			<string>wasy10</string>
            <string>Eurostile LT Std</string>		
			<string>Didot</string>
		</test>
		<edit mode="assign" name="hintstyle" >
			<const>hintslight</const>
		</edit>
		<edit mode="assign" name="rgba" >
			<const>rgb</const>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="hinting" >
			<bool>true</bool>
		</edit>
	</match>


	<!-- ********************  FINAL TWEAKS **********************  -->

	<!-- Artificial oblique for fonts without an italic or oblique version -->
	<!-- QT4 seems to ignore this and makes a SUPER italic version on its own. -->
	<match target="font" >
		<!-- check to see if the font is roman -->
		<test name="slant" >
			<const>roman</const>
		</test>
		<!-- check to see if the pattern requested non-roman -->
		<test target="pattern" compare="not_eq" name="slant" >
			<const>roman</const>
		</test>
		<!-- multiply the matrix to slant the font -->
		<edit mode="assign" name="matrix" >
			<times>
				<name>matrix</name>
				<matrix>
					<double>1.0</double>
					<double>0.2</double>
					<double>0.0</double>
					<double>1.0</double>
				</matrix>
			</times>
		</edit>
		<!-- pretend the font is oblique now -->
		<edit mode="assign" name="slant" >
			<const>oblique</const>
		</edit>
	</match>

	<match target="font" >
		<test compare="less" name="pixelsize" qual="any" >
			<double>9</double>
		</test>
		<edit mode="assign" name="hintstyle" >
			<const>hintslight</const>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>true</bool>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>true</bool>
		</edit>
	</match>
		
	<!-- These slight hinted fonts should use full hinting above 17 px -->
	<match target="font" >
		<test name="family" qual="any" >
			<string>Arial Black</string>		
			<string>Georgia</string>					
		</test>
		<test compare="more" name="pixelsize" qual="any" >
			<double>17</double>
		</test>
		<edit mode="assign" name="hintstyle" >
			<const>hintfull</const>
		</edit>
		<edit mode="assign" name="autohint" >
			<bool>false</bool>
		</edit>
	</match>	

	<!--  Rescan configuration every 30 seconds when FcFontSetList is called -->
	<rescan>
		<int>10</int>
	</rescan>

</fontconfig>
