[Fontconfig] Remap italic to small-caps

Tobias Wolf towolf at gmail.com
Fri Jan 15 08:30:48 PST 2010


I have a set of fonts with no italic but a small caps style.

How can I prevent that fontconfig assigns a faux italic and instead
map italic to small-caps, such that small-caps is used whenever italic
is requested?

I tried this in my fonts.conf but it only changes the family name, not
the font used:

<match target="font">
	<test name="family">
	<test name="slant">
	<test target="pattern" name="slant" compare="not_eq">
	<edit name="family" mode="assign">
		<string>TT2010 SC</string>
	<edit name="slant" mode="assign">

This gives me

	tt-regular.ttf: "TT2010 SC" "Regular"

and not «tt-sc.ttf» and hence anything italic becomes just plain roman
instead of roman small caps.

What does work is <edit name="file" mode="assign">. But that can’t be
right? Am I misunderstanding the examples in /etc/fonts w.r.t.
re-assigning a family?


More information about the Fontconfig mailing list