]> git.wh0rd.org - fontconfig.git/blame - conf.d/90-synthetic.conf
[conf] Disable hinting when emboldening (#19904)
[fontconfig.git] / conf.d / 90-synthetic.conf
CommitLineData
6c5619a0
KP
1<?xml version="1.0"?>
2<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
3<fontconfig>
4<!--
5 Artificial oblique for fonts without an italic or oblique version
6 -->
7
8 <match target="font">
9 <!-- check to see if the font is roman -->
10 <test name="slant">
11 <const>roman</const>
12 </test>
13 <!-- check to see if the pattern requested non-roman -->
14 <test target="pattern" name="slant" compare="not_eq">
15 <const>roman</const>
16 </test>
17 <!-- multiply the matrix to slant the font -->
18 <edit name="matrix" mode="assign">
19 <times>
20 <name>matrix</name>
21 <matrix><double>1</double><double>0.2</double>
22 <double>0</double><double>1</double>
23 </matrix>
24 </times>
25 </edit>
26 <!-- pretend the font is oblique now -->
27 <edit name="slant" mode="assign">
28 <const>oblique</const>
29 </edit>
30 <!-- and disable embedded bitmaps for artificial oblique -->
31 <edit name="embeddedbitmap" mode="assign">
32 <bool>false</bool>
33 </edit>
34 </match>
35
36<!--
37 Synthetic emboldening for fonts that do not have bold face available
38 -->
39
40 <match target="font">
41 <!-- check to see if the font is just regular -->
42 <test name="weight" compare="less_eq">
43 <const>medium</const>
44 </test>
45 <!-- check to see if the pattern requests bold -->
46 <test target="pattern" name="weight" compare="more">
47 <const>medium</const>
48 </test>
49 <!--
50 set the embolden flag
51 needed for applications using cairo, e.g. gucharmap, gedit, ...
52 -->
53 <edit name="embolden" mode="assign">
54 <bool>true</bool>
55 </edit>
56 <!--
57 set weight to bold
58 needed for applications using Xft directly, e.g. Firefox, ...
59 -->
60 <edit name="weight" mode="assign">
61 <const>bold</const>
62 </edit>
10609af4
MF
63 <!--
64 Hinting will be done before Embolden in freetype2,
65 but in such case, Embolden will get wrong result
66 on some glyph contours after applying hinting.
67 Actually, hinting should be done after embolden, but we can't
68 fix it in current freetype2. So as a workaround, just turn off
69 hinting if we want to do embolden.
70 -->
71 <edit name="hintstyle" mode="assign">
72 <const>hintnone</const>
73 </edit>
6c5619a0
KP
74 </match>
75</fontconfig>