summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-06-23 19:00:36 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-06-23 19:00:36 +0000
commit3aabb8d5ce0720c9a22cdcf975380d1d0213c4c8 (patch)
treeb6a641821de5c6e8643fb869c3950cd9d167ed61 /pango/pango-markup.c
parent1939a027b1d4e6c7d83af9e42e191f1bfb0cf8a0 (diff)
downloadpango-3aabb8d5ce0720c9a22cdcf975380d1d0213c4c8.tar.gz
Add new letter_spacing attribute.
Wed Jun 23 11:17:51 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-attributes.[ch]: Add new letter_spacing attribute. * pango/pango-attributes.c (pango_attr_rise_new): Correct description; rise is in Pango units, not em-relative. * pango/pango-glyph-item.c: Break out iteration-over-clusters from ApplyAttrsState into a separate GlyphItemIter. * pango/pango-glyph-item.[ch]: New function pango_glyph_item_letter_space() to add add letter spacing to a single glyph item. * pango/pango-markup.c: Add a letter_spacing attribute. * pango/pango-layout.c: Use G_DEFINE_TYPE(). * pango/pango-layout.c (pango_layout_get_item_properties): Switch to use a structure rather than a pile of out parameters. * pango/pango-layout.c (pango_run_get_extents): Remove the unused shape_set out parameter. * pango/pangofc-decoder.[ch] pango/pangofc-fontmap.[ch]: Doc fixes. * pango/pango-types.h: Deprecate pango_get_mirror_char() * pango/pango-utils.c (pango_get_mirror_char): Add docs. * docs/pango-sections.txt docs/pango-docs.sgml: Add PangoFcDecoder and letter spacing.
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r--pango/pango-markup.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index a4bd108c..3b45cc73 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -857,6 +857,7 @@ span_parse_func (MarkupData *md,
const char *underline = NULL;
const char *strikethrough = NULL;
const char *rise = NULL;
+ const char *letter_spacing = NULL;
const char *lang = NULL;
const char *fallback = NULL;
@@ -928,6 +929,11 @@ span_parse_func (MarkupData *md,
CHECK_DUPLICATE (rise);
rise = values[i];
}
+ else if (strcmp (names[i], "letter_spacing") == 0)
+ {
+ CHECK_DUPLICATE (letter_spacing);
+ letter_spacing = values[i];
+ }
else if (strcmp (names[i], "lang") == 0)
{
CHECK_DUPLICATE (lang);
@@ -1231,6 +1237,28 @@ span_parse_func (MarkupData *md,
add_attribute (tag, pango_attr_rise_new (n));
}
+ if (letter_spacing)
+ {
+ char *end = NULL;
+ glong n;
+
+ n = strtol (letter_spacing, &end, 10);
+
+ if (*end != '\0')
+ {
+ g_set_error (error,
+ G_MARKUP_ERROR,
+ G_MARKUP_ERROR_INVALID_CONTENT,
+ _("Value of 'letter_spacing' attribute on <span> tag "
+ "on line %d could not be parsed; "
+ "should be an integer, not '%s'"),
+ line_number, letter_spacing);
+ goto error;
+ }
+
+ add_attribute (tag, pango_attr_letter_spacing_new (n));
+ }
+
if (lang)
{
add_attribute (tag,