summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-03-06 23:44:11 +0000
committerKeith Packard <keithp@keithp.com>2004-03-06 23:44:11 +0000
commit89e28590f3c85f302dcc5c611e7b9fa906e0ec07 (patch)
tree9fc022299093d570d356a92e4351d311d18cffe1
parent02638f1ace0ad7e898317128c244dfd9c842d122 (diff)
Force FC_FOUNDRY and FC_WIDTH to always be set so that matches looking for
explicit values prefer exact matches
-rw-r--r--ChangeLog6
-rw-r--r--src/fcfreetype.c18
2 files changed, 16 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 27c0658..0462630 100644
--- 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)
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 2574b15..6248595 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -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