90-synthetic.conf 1.87 KB
Newer Older
1 2 3
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
4 5 6 7
  <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
    <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
  </its:rules>

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
<!-- 
 Artificial oblique for fonts without an italic or oblique version
 -->
 
	<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" name="slant" compare="not_eq">
			<const>roman</const>
		</test>
		<!-- multiply the matrix to slant the font -->
		<edit name="matrix" mode="assign">
			<times>
				<name>matrix</name>
				<matrix><double>1</double><double>0.2</double>
					<double>0</double><double>1</double>
				</matrix>
			</times>
		</edit>
		<!-- pretend the font is oblique now -->
		<edit name="slant" mode="assign">
			<const>oblique</const>
		</edit>
34 35 36 37
		<!-- and disable embedded bitmaps for artificial oblique -->
		<edit name="embeddedbitmap" mode="assign">
			<bool>false</bool>
		</edit>
38 39 40 41 42 43 44
	</match>

<!--
 Synthetic emboldening for fonts that do not have bold face available
 -->

	<match target="font">
45
		<!-- check to see if the weight in the font is less than medium which possibly need emboldening -->
46
		<test name="weight" compare="less_eq">
47
			<const>medium</const>
48 49
		</test>
		<!-- check to see if the pattern requests bold -->
50 51
		<test target="pattern" name="weight" compare="more_eq">
			<const>bold</const>
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
		</test>
		<!--
		  set the embolden flag
		  needed for applications using cairo, e.g. gucharmap, gedit, ...
		-->
		<edit name="embolden" mode="assign">
			<bool>true</bool>
		</edit>
		<!--
		 set weight to bold
		 needed for applications using Xft directly, e.g. Firefox, ...
		-->
		<edit name="weight" mode="assign">
			<const>bold</const>
		</edit>
	</match>
</fontconfig>