summaryrefslogtreecommitdiff
path: root/pango/pango-markup.c
diff options
context:
space:
mode:
authorNoah Levitt <nlevitt@columbia.edu>2004-02-29 20:31:45 +0000
committerNoah Levitt <nlevitt@src.gnome.org>2004-02-29 20:31:45 +0000
commitb1a7956a523e80a793461cc11d8d15c6b51b4dcc (patch)
treec6ae0547ec375c8e752ea3436ed2c701b7e69ddb /pango/pango-markup.c
parent935375cc934cfa11dc08de4005b9d99c5c31d436 (diff)
downloadpango-b1a7956a523e80a793461cc11d8d15c6b51b4dcc.tar.gz
New attribute to turn font fallback on or off. (#105553)
2003-02-29 Noah Levitt <nlevitt@columbia.edu> * docs/pango_markup.sgml: * docs/tmpl/text-attributes.sgml: * pango/pango-attributes.c: * pango/pango-attributes.h: * pango/pango-context.c: * pango/pango-markup.c: New attribute to turn font fallback on or off. (#105553)
Diffstat (limited to 'pango/pango-markup.c')
-rw-r--r--pango/pango-markup.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index a0697380..3764fdcb 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -858,6 +858,7 @@ span_parse_func (MarkupData *md,
const char *strikethrough = NULL;
const char *rise = NULL;
const char *lang = NULL;
+ const char *fallback = NULL;
g_markup_parse_context_get_position (context,
&line_number, &char_number);
@@ -932,6 +933,11 @@ span_parse_func (MarkupData *md,
CHECK_DUPLICATE (lang);
lang = values[i];
}
+ else if (strcmp (names[i], "fallback") == 0)
+ {
+ CHECK_DUPLICATE (fallback);
+ fallback = values[i];
+ }
else
{
g_set_error (error, G_MARKUP_ERROR,
@@ -1182,6 +1188,25 @@ span_parse_func (MarkupData *md,
}
}
+ if (fallback)
+ {
+ if (strcmp (fallback, "true") == 0)
+ add_attribute (tag, pango_attr_fallback_new (TRUE));
+ else if (strcmp (fallback, "false") == 0)
+ add_attribute (tag, pango_attr_fallback_new (FALSE));
+ else
+ {
+ g_set_error (error,
+ G_MARKUP_ERROR,
+ G_MARKUP_ERROR_INVALID_CONTENT,
+ _("'fallback' attribute on <span> tag "
+ "line %d should have one of the values "
+ "'true' or 'false': '%s' is not valid"),
+ line_number, fallback);
+ goto error;
+ }
+ }
+
if (rise)
{
char *end = NULL;