]> git.wh0rd.org - fontconfig.git/commitdiff
Add slanting for fonts without oblique/italic varient. Fix matching code to
authorKeith Packard <keithp@keithp.com>
Wed, 19 Jun 2002 21:32:51 +0000 (21:32 +0000)
committerKeith Packard <keithp@keithp.com>
Wed, 19 Jun 2002 21:32:51 +0000 (21:32 +0000)
    make this work

fonts.conf.in
src/fcmatch.c

index 2ebf2bf9d2f1ecf8bb400ce4d155697803c5a15b..a0a4107714a6ea0da0f4d02ee6a30a5c2fc3ccc8 100644 (file)
                </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
index 5866db999c17336b8e0189908894c8eb77a372d5..e1795fbef3136b0038059b7aad4fb88f0f66ff64 100644 (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;