Re: Forcing Artificial Italics on Fonts That *DO* Have One Available?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
days.

<match target="pattern">

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

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

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

<match target="font">

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

        <!-- look for fonts which were marked for fake obliquing -->
        <test name="fake_slant">
                 <bool>true</bool>
        </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>

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

-- 
keith.packard@xxxxxxxxx

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux