summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-05-10 18:32:45 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-05-10 18:32:45 +0000
commite4af58a9158c3a9ef82689f3a63e53521931d3b2 (patch)
treea5bd08888688ce6a2a0952494fc71de6a882c216 /pango/pangofc-fontmap.c
parent1fc9d8b76930a0aee71096440b89530b39922b5c (diff)
downloadpango-e4af58a9158c3a9ef82689f3a63e53521931d3b2.tar.gz
Don't set gravity in pango_fc_font_description_from_pattern() if it was
2007-05-10 Behdad Esfahbod <behdad@gnome.org> * pango/pangofc-fontmap.c (pango_fc_font_description_from_pattern), (pango_fc_face_describe): Don't set gravity in pango_fc_font_description_from_pattern() if it was not set on the pattern. This is a bit different from other properties, but that really is how gravity works (unlike say weight that not having it said means normal weight). svn path=/trunk/; revision=2272
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 7a3985d3..6fcb96d8 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1634,15 +1634,15 @@ pango_fc_font_description_from_pattern (FcPattern *pattern, gboolean include_siz
if (include_size && FcPatternGetDouble (pattern, FC_SIZE, 0, &size) == FcResultMatch)
pango_font_description_set_size (desc, size * PANGO_SCALE);
+ /* gravity is a bit different. we don't want to set it if it was not set on
+ * the pattern */
if (FcPatternGetString (pattern, PANGO_FC_GRAVITY, 0, (FcChar8 **)&s) == FcResultMatch)
{
GEnumValue *value = g_enum_get_value_by_nick (get_gravity_class (), s);
gravity = value->value;
- }
- else
- gravity = PANGO_GRAVITY_SOUTH;
- pango_font_description_set_gravity (desc, gravity);
+ pango_font_description_set_gravity (desc, gravity);
+ }
return desc;
}
@@ -1702,10 +1702,6 @@ pango_fc_face_describe (PangoFontFace *face)
{
desc = pango_fc_font_description_from_pattern (result_pattern, FALSE);
FcPatternDestroy (result_pattern);
- /* Unset gravity. We want gravity to be set to descriptions of fonts,
- * but not faces.
- */
- pango_font_description_unset_fields (desc, PANGO_FONT_MASK_GRAVITY);
}
FcPatternDestroy (match_pattern);