summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-12-05 04:11:11 +0000
committerKeith Packard <keithp@keithp.com>2004-12-05 04:11:11 +0000
commite4125ef950ada3413a542dc457a4d36c5495dcd7 (patch)
tree57dc33c4dbf911a86963c14a86393cbeb6230117
parent537e3d23fab449be154da8d49817364479924a61 (diff)
Check for non-empty face->family_name and face->style_name before using
those for the font. Empty names match everything. Bug #171.
-rw-r--r--ChangeLog7
-rw-r--r--src/fcfreetype.c12
2 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fa19016..159a76a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2004-12-04 Keith Packard <keithp@keithp.com>
+ * src/fcfreetype.c: (FcFreeTypeQuery):
+ Check for non-empty face->family_name and face->style_name
+ before using those for the font. Empty names match everything.
+ Bug #171.
+
+2004-12-04 Keith Packard <keithp@keithp.com>
+
* configure.in:
* fontconfig/fontconfig.h:
* src/fcfreetype.c: (FcFreeTypeQuery):
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 7ca65fd..7bc8b53 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1163,19 +1163,21 @@ FcFreeTypeQuery (const FcChar8 *file,
free (utf8);
}
- if (!nfamily && face->family_name)
+ if (!nfamily && face->family_name &&
+ FcStrCmpIgnoreBlanksAndCase (face->family_name, "") != 0)
{
if (FcDebug () & FC_DBG_SCANV)
- printf ("using FreeType family %s", face->family_name);
+ printf ("using FreeType family \"%s\"\n", face->family_name);
if (!FcPatternAddString (pat, FC_FAMILY, face->family_name))
goto bail1;
++nfamily;
}
- if (!nstyle && face->style_name)
+ if (!nstyle && face->style_name &&
+ FcStrCmpIgnoreBlanksAndCase (face->style_name, "") != 0)
{
if (FcDebug () & FC_DBG_SCANV)
- printf ("using FreeType style %s", face->family_name);
+ printf ("using FreeType style \"%s\"\n", face->style_name);
if (!FcPatternAddString (pat, FC_STYLE, face->style_name))
goto bail1;
++nstyle;
@@ -1199,7 +1201,7 @@ FcFreeTypeQuery (const FcChar8 *file,
strncpy ((char *) family, (char *) start, end - start);
family[end - start] = '\0';
if (FcDebug () & FC_DBG_SCANV)
- printf ("using filename for family %s", family);
+ printf ("using filename for family %s\n", family);
if (!FcPatternAddString (pat, FC_FAMILY, family))
{
free (family);