summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-01-11 20:09:58 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-01-11 20:09:58 +0000
commit2ac3d4c416d0d761b3012c6c4eebe3d00ad157a0 (patch)
tree7da962a13a562f61630a799a3f898846a32309ba /pango
parent49c7df604e7b84310da42c9431ca96818d440b1b (diff)
downloadpango-2ac3d4c416d0d761b3012c6c4eebe3d00ad157a0.tar.gz
Split comma separated family names and add them in pieces, so they are all
Fri Jan 11 15:01:13 2002 Owen Taylor <otaylor@redhat.com> * pango/pangoft2-fontmap.c (pango_ft2_make_pattern) pango/pangoxft-fontmap.c (pango_xft_make_pattern): Split comma separated family names and add them in pieces, so they are all visible to Xft. * pango/pangoxft-fontmap.c: Remove duplicate XFT_FAMILY in call to XftListFonts.
Diffstat (limited to 'pango')
-rw-r--r--pango/pangoft2-fontmap.c9
-rw-r--r--pango/pangoxft-fontmap.c24
2 files changed, 25 insertions, 8 deletions
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index 15efae0b..44b383b3 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -458,6 +458,8 @@ pango_ft2_make_pattern (const PangoFontDescription *description)
PangoStyle pango_style;
int slant;
int weight;
+ char **families;
+ int i;
pango_style = pango_font_description_get_style (description);
@@ -476,6 +478,13 @@ pango_ft2_make_pattern (const PangoFontDescription *description)
XFT_SIZE, MiniXftTypeDouble, (double)pango_font_description_get_size (description)/PANGO_SCALE,
NULL);
+ families = g_strsplit (pango_font_description_get_family (description), ",", -1);
+
+ for (i = 0; families[i]; i++)
+ MiniXftPatternAddString (pattern, XFT_FAMILY, families[i]);
+
+ g_strfreev (families);
+
return pattern;
}
diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c
index 8fbc671b..28ff7544 100644
--- a/pango/pangoxft-fontmap.c
+++ b/pango/pangoxft-fontmap.c
@@ -465,7 +465,9 @@ pango_xft_make_pattern (const PangoFontDescription *description)
PangoStyle pango_style;
int slant;
int weight;
-
+ char **families;
+ int i;
+
pango_style = pango_font_description_get_style (description);
slant = pango_xft_convert_slant (pango_style);
@@ -477,12 +479,18 @@ pango_xft_make_pattern (const PangoFontDescription *description)
pattern = XftPatternBuild (0,
XFT_ENCODING, XftTypeString, "glyphs-fontspecific",
XFT_CORE, XftTypeBool, False,
- XFT_FAMILY, XftTypeString, pango_font_description_get_family (description),
XFT_WEIGHT, XftTypeInteger, weight,
XFT_SLANT, XftTypeInteger, slant,
XFT_SIZE, XftTypeDouble, (double)pango_font_description_get_size (description)/PANGO_SCALE,
NULL);
+ families = g_strsplit (pango_font_description_get_family (description), ",", -1);
+
+ for (i = 0; families[i]; i++)
+ XftPatternAddString (pattern, XFT_FAMILY, families[i]);
+
+ g_strfreev (families);
+
return pattern;
}
@@ -571,12 +579,12 @@ pango_xft_font_map_load_fontset (PangoFontMap *fontmap,
XFT_CORE, XftTypeBool, False,
XFT_ENCODING, XftTypeString, "iso10646-1",
NULL,
- XFT_FOUNDRY, XFT_STYLE, XFT_FAMILY,
- XFT_ENCODING, XFT_FILE, XFT_INDEX,
- XFT_CORE, XFT_FAMILY, XFT_WEIGHT,
- XFT_SLANT, XFT_CHAR_WIDTH, XFT_MATRIX,
- XFT_RGBA, XFT_ANTIALIAS, XFT_MINSPACE,
- XFT_SPACING, XFT_SIZE,
+ XFT_FOUNDRY, XFT_STYLE, XFT_FAMILY,
+ XFT_ENCODING, XFT_FILE, XFT_INDEX,
+ XFT_CORE, XFT_WEIGHT, XFT_SLANT,
+ XFT_CHAR_WIDTH, XFT_MATRIX, XFT_RGBA,
+ XFT_ANTIALIAS, XFT_MINSPACE, XFT_SPACING,
+ XFT_SIZE,
NULL);
pattern = pango_xft_make_pattern (desc);