[pango/wip/matthiasc/face-lang: 23/26] [fc] Only set variations if non-empty
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/wip/matthiasc/face-lang: 23/26] [fc] Only set variations if non-empty
- Date: Sun, 24 Dec 2017 21:11:16 +0000 (UTC)
commit 2fa3b1a542fac8a7c683ea6277a1e2c46e06dbdc
Author: Behdad Esfahbod <behdad behdad org>
Date: Tue Dec 19 00:01:54 2017 -0500
[fc] Only set variations if non-empty
pango/pangofc-fontmap.c | 4 +++-
pango/pangofc-fontmap.h | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 871b270..4e7d74b 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1519,9 +1519,11 @@ pango_fc_make_pattern (const PangoFontDescription *description,
FC_DPI, FcTypeDouble, dpi,
FC_SIZE, FcTypeDouble, pixel_size * (72. / 1024. / dpi),
FC_PIXEL_SIZE, FcTypeDouble, pixel_size / 1024.,
- PANGO_FC_FONT_VARIATIONS, FcTypeString, variations ? variations : "",
NULL);
+ if (variations)
+ FcPatternAddString (pattern, PANGO_FC_FONT_VARIATIONS, (FcChar8*) variations);
+
if (pango_font_description_get_family (description))
{
families = g_strsplit (pango_font_description_get_family (description), ",", -1);
diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h
index 63452a8..bff288b 100644
--- a/pango/pangofc-fontmap.h
+++ b/pango/pangofc-fontmap.h
@@ -319,8 +319,8 @@ PangoFontDescription *pango_fc_font_description_from_pattern (FcPattern *pattern
* String representing a fontconfig property name that Pango reads from font
* patterns to populate list of OpenType font variations to be used for a font.
*
- * The property will have a number of string elements, each of which is the
- * OpenType axis setting of the form AXIS=VALUE.
+ * The property will have a string elements, each of which a comma-separated
+ * list of OpenType axis setting of the form AXIS=VALUE.
*/
#define PANGO_FC_FONT_VARIATIONS "fontvariations"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]