diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-09-28 15:35:12 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-09-28 15:35:12 +0000 |
commit | 6e637bfa7182b5497d5052df19638f488434eea4 (patch) | |
tree | 1ab4644d09f47fcb4d597401982c1fb39ffde854 /pango/pango-attributes.c | |
parent | ec5cadea0c32ea4b63271523aabeb8758e163840 (diff) | |
download | pango-6e637bfa7182b5497d5052df19638f488434eea4.tar.gz |
Use PANGO_FONT_MASK_* not PANGO_ATTR_* when manipulating the mask. Add
Fri Sep 28 11:27:57 2001 Owen Taylor <otaylor@redhat.com>
* pango/pango-attributes.c (pango_attr_iterator_get_font): Use
PANGO_FONT_MASK_* not PANGO_ATTR_* when manipulating the
mask. Add fields to mask for PANGO_ATTR_FONT_DESC so
it won't be overwritten by later attributes.
(Fixes from Tony Graham, #61297)
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r-- | pango/pango-attributes.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 6d6fbf1c..630c30b0 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1410,57 +1410,58 @@ pango_attr_iterator_get_font (PangoAttrIterator *iterator, case PANGO_ATTR_FONT_DESC: { PangoFontMask new_mask = pango_font_description_get_set_fields (((PangoAttrFontDesc *)attr)->desc) & ~mask; + mask |= new_mask; pango_font_description_unset_fields (desc, new_mask); pango_font_description_merge_static (desc, ((PangoAttrFontDesc *)attr)->desc, FALSE); break; } case PANGO_ATTR_FAMILY: - if (!(mask & PANGO_ATTR_FAMILY)) + if (!(mask & PANGO_FONT_MASK_FAMILY)) { - mask |= PANGO_ATTR_FAMILY; + mask |= PANGO_FONT_MASK_FAMILY; pango_font_description_set_family (desc, ((PangoAttrString *)attr)->value); } break; case PANGO_ATTR_STYLE: - if (!(mask & PANGO_ATTR_STYLE)) + if (!(mask & PANGO_FONT_MASK_STYLE)) { - mask |= PANGO_ATTR_STYLE; + mask |= PANGO_FONT_MASK_STYLE; pango_font_description_set_style (desc, ((PangoAttrInt *)attr)->value); } break; case PANGO_ATTR_VARIANT: - if (!(mask & PANGO_ATTR_VARIANT)) + if (!(mask & PANGO_FONT_MASK_VARIANT)) { - mask |= PANGO_ATTR_VARIANT; + mask |= PANGO_FONT_MASK_VARIANT; pango_font_description_set_variant (desc, ((PangoAttrInt *)attr)->value); } break; case PANGO_ATTR_WEIGHT: - if (!(mask & PANGO_ATTR_WEIGHT)) + if (!(mask & PANGO_FONT_MASK_WEIGHT)) { - mask |= PANGO_ATTR_WEIGHT; + mask |= PANGO_FONT_MASK_WEIGHT; pango_font_description_set_weight (desc, ((PangoAttrInt *)attr)->value); } break; case PANGO_ATTR_STRETCH: - if (!(mask & PANGO_ATTR_STRETCH)) + if (!(mask & PANGO_FONT_MASK_STRETCH)) { - mask |= PANGO_ATTR_STRETCH; + mask |= PANGO_FONT_MASK_STRETCH; pango_font_description_set_stretch (desc, ((PangoAttrInt *)attr)->value); } break; case PANGO_ATTR_SIZE: - if (!(mask & PANGO_ATTR_SIZE)) + if (!(mask & PANGO_FONT_MASK_SIZE)) { - mask |= PANGO_ATTR_SIZE; + mask |= PANGO_FONT_MASK_SIZE; pango_font_description_set_size (desc, ((PangoAttrInt *)attr)->value); } break; case PANGO_ATTR_SCALE: - if (!(mask & PANGO_ATTR_SIZE)) + if (!(mask & PANGO_FONT_MASK_SIZE)) { - mask |= PANGO_ATTR_SIZE; + mask |= PANGO_FONT_MASK_SIZE; pango_font_description_set_size (desc, ((PangoAttrFloat *)attr)->value * pango_font_description_get_size (desc)); } |