[Fontconfig] Forcing Artificial Italics on Fonts That *DO* Have One Available?

Keith Packard keithp at keithp.com
Mon Aug 4 23:27:23 PDT 2008

On Mon, 2008-08-04 at 20:06 -0500, Erik wrote:

> Does anybody have an idea on how to force it to first select the regular 
> font, then apply artificial slanting to it?

Not to condone this kind of typographical abuse, but it seemed an
interesting problem. The key is to switch to a roman font for the match,
but then patch up the returned roman font to perform the artificial
oblique effect. I think fontconfig provides too much flexibility some

<match target="pattern">

        <!-- match requests for non-roman face -->
        <test name="slant" compare="not_eq">

        <!-- remember that this should be slanted -->
        <edit name="fake_slant">

        <!--- change to match a roman face instead -->
        <edit name="slant">

<match target="font">

        <!-- check to see if the font is roman -->
        <test name="slant">

        <!-- look for fonts which were marked for fake obliquing -->
        <test name="fake_slant">

        <!-- multiply the matrix to slant the font -->
        <edit name="matrix" mode="assign">

        <!-- mark the font as oblique now -->
        <edit name="slant">

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20080804/8ae75874/attachment.pgp 

More information about the Fontconfig mailing list