Add slanting for fonts without oblique/italic varient. Fix matching code to

make this work
This commit is contained in:
Keith Packard 2002-06-19 21:32:51 +00:00
parent 0c35c0facb
commit c689ec2291
2 changed files with 30 additions and 2 deletions

View File

@ -166,6 +166,34 @@
</prefer>
</alias>
<!--
Artificial oblique for fonts without an italic or oblique version
-->
<match target="font">
<!-- check to see if the font is roman -->
<test qual="first" name="slant">
<const>roman</const>
</test>
<!-- check to see if the pattern requested non-roman -->
<test qual="not_first" 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>.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>
</match>
<config>
<!--
These are the default Unicode chars that are expected to be blank

View File

@ -1,5 +1,5 @@
/*
* $XFree86: xc/lib/fontconfig/src/fcmatch.c,v 1.11 2002/06/08 17:32:04 keithp Exp $
* $XFree86: xc/lib/fontconfig/src/fcmatch.c,v 1.13 2002/06/19 20:08:22 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
@ -335,7 +335,7 @@ FcFontRenderPrepare (FcConfig *config,
for (j = 0; j < NUM_MATCHER; j++)
score[j] = 0;
if (!FcCompareValueList (pe->object, pe->values,
fe->values, &v, 0, &result))
fe->values, &v, score, &result))
{
FcPatternDestroy (new);
return 0;