]> git.wh0rd.org - fontconfig.git/commitdiff
Force FC_FOUNDRY and FC_WIDTH to always be set so that matches looking for
authorKeith Packard <keithp@keithp.com>
Sat, 6 Mar 2004 23:44:11 +0000 (23:44 +0000)
committerKeith Packard <keithp@keithp.com>
Sat, 6 Mar 2004 23:44:11 +0000 (23:44 +0000)
    explicit values prefer exact matches

ChangeLog
src/fcfreetype.c

index 27c0658b83fe9f630a74499de0e96390283bf653..0462630b47b1fb59c187298d05ed437c2f03387d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-03-06  Keith Packard  <keithp@keithp.com>
+
+       * src/fcfreetype.c: (FcFreeTypeQuery):
+       Force FC_FOUNDRY and FC_WIDTH to always be set so that
+       matches looking for explicit values prefer exact matches
+
 2004-03-02  Keith Packard  <keithp@keithp.com>
 
        Supplied by: mfabian@suse.de (Mike FABIAN)
index 2574b15fdf0791f4dd0cf40e43ff43abbe0ca7e8..6248595a2a0aa6f287503401acd4433803d3a169 100644 (file)
@@ -942,21 +942,23 @@ FcFreeTypeQuery (const FcChar8    *file,
            weight = FC_WEIGHT_BOLD;
     }
 
+    if (width == -1)
+       width = FC_WIDTH_NORMAL;
+
+    if (foundry == 0)
+       foundry = "unknown";
+
     if (!FcPatternAddInteger (pat, FC_SLANT, slant))
        goto bail1;
 
     if (!FcPatternAddInteger (pat, FC_WEIGHT, weight))
        goto bail1;
 
-    if (width != -1)
-       if (!FcPatternAddInteger (pat, FC_WIDTH, width))
-           goto bail1;
+    if (!FcPatternAddInteger (pat, FC_WIDTH, width))
+       goto bail1;
 
-    if(foundry) 
-    {
-        if(!FcPatternAddString (pat, FC_FOUNDRY, foundry))
-            goto bail1;
-    }
+    if (!FcPatternAddString (pat, FC_FOUNDRY, foundry))
+       goto bail1;
 
     /*
      * Compute the unicode coverage for the font