diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2008-04-21 21:26:33 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2008-04-21 21:26:33 +0000 |
commit | 451d5a70fe771cf19e570e9896ad566239974ece (patch) | |
tree | 18be852138869676ef15a5f0a514ecfb89a57b89 | |
parent | 5e19f6d537039b18ad17e2b8752f45a8b614f3b2 (diff) | |
download | pango-451d5a70fe771cf19e570e9896ad566239974ece.tar.gz |
Bug 490669 – add some <span> attribute aliases
2008-04-21 Behdad Esfahbod <behdad@gnome.org>
Bug 490669 – add some <span> attribute aliases
* docs/pango_markup.sgml:
* pango/pango-markup.c (span_parse_func):
Add fgcolor, bgcolor, font, font_size, font_weight, font_variant, ...
svn path=/trunk/; revision=2603
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | docs/pango_markup.sgml | 49 | ||||
-rw-r--r-- | pango/pango-markup.c | 12 |
3 files changed, 50 insertions, 19 deletions
@@ -1,5 +1,13 @@ 2008-04-21 Behdad Esfahbod <behdad@gnome.org> + Bug 490669 – add some <span> attribute aliases + + * docs/pango_markup.sgml: + * pango/pango-markup.c (span_parse_func): + Add fgcolor, bgcolor, font, font_size, font_weight, font_variant, ... + +2008-04-21 Behdad Esfahbod <behdad@gnome.org> + Bug 501334 – Make pango_cairo_[show_]*[_path]() functions preserve current point diff --git a/docs/pango_markup.sgml b/docs/pango_markup.sgml index ba96a9db..0c992a43 100644 --- a/docs/pango_markup.sgml +++ b/docs/pango_markup.sgml @@ -46,7 +46,9 @@ general markup tag is <span>, then there are some convenience tags. <span> has the following attributes: <variablelist><title><span> attributes</title> -<varlistentry><term>font_desc</term> +<varlistentry> +<term>font</term> +<term>font_desc</term> <listitem><para> A font description string, such as "Sans Italic 12". See <link linkend="pango-font-description-from-string">pango_font_description_from_string()</link> @@ -56,51 +58,57 @@ other span attributes will override this description. So if you have not italic.</para></listitem> </varlistentry> -<varlistentry><term>font_family</term> +<varlistentry> +<term>font_family</term> +<term>face</term> <listitem><para> A font family name </para></listitem> </varlistentry> -<varlistentry><term>face</term> -<listitem><para> -Synonym for font_family -</para></listitem> -</varlistentry> - -<varlistentry><term>size</term> +<varlistentry> +<term>font_size</term> +<term>size</term> <listitem><para> Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'. If you want to specify a absolute size, it's usually easier to take advantage of the ability to specify a partial -font description using 'font_desc'; you can use -<literal>font_desc='12.5'</literal> rather than +font description using 'font'; you can use +<literal>font='12.5'</literal> rather than <literal>size='12800'</literal>. </para></listitem> </varlistentry> -<varlistentry><term>style</term> +<varlistentry> +<term>font_style</term> +<term>style</term> <listitem><para> One of 'normal', 'oblique', 'italic' </para></listitem> </varlistentry> -<varlistentry><term>weight</term> +<varlistentry> +<term>font_weight</term> +<term>weight</term> <listitem><para> One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight </para></listitem> </varlistentry> -<varlistentry><term>variant</term> +<varlistentry> +<term>font_variant</term> +<term>variant</term> <listitem><para> -'normal' or 'smallcaps' +One of 'normal' or 'smallcaps' </para></listitem> </varlistentry> -<varlistentry><term>stretch</term> +<varlistentry> +<term>font_stretch</term> +<term>stretch</term> <listitem><para> One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', @@ -108,14 +116,19 @@ One of 'ultracondensed', 'extracondensed', 'condensed', </para></listitem> </varlistentry> -<varlistentry><term>foreground</term> +<varlistentry> +<term>foreground</term> +<term>fgcolor</term> +<term>color</term> <listitem><para> An RGB color specification such as '#00FF00' or a color name such as 'red' </para></listitem> </varlistentry> -<varlistentry><term>background</term> +<varlistentry> +<term>background</term> +<term>bgcolor</term> <listitem><para> An RGB color specification such as '#00FF00' or a color name such as 'red' diff --git a/pango/pango-markup.c b/pango/pango-markup.c index abb3890a..449810e3 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -1008,11 +1008,20 @@ span_parse_func (MarkupData *md, switch (names[i][0]) { case 'f': - CHECK_ATTRIBUTE2(family, "face"); CHECK_ATTRIBUTE (fallback); + CHECK_ATTRIBUTE2(desc, "font"); CHECK_ATTRIBUTE2(desc, "font_desc"); + CHECK_ATTRIBUTE2(family, "face"); + CHECK_ATTRIBUTE2(family, "font_family"); + CHECK_ATTRIBUTE2(size, "font_size"); + CHECK_ATTRIBUTE2(stretch, "font_stretch"); + CHECK_ATTRIBUTE2(style, "font_style"); + CHECK_ATTRIBUTE2(variant, "font_variant"); + CHECK_ATTRIBUTE2(weight, "font_weight"); + CHECK_ATTRIBUTE (foreground); + CHECK_ATTRIBUTE2 (foreground, "fgcolor"); break; case 's': CHECK_ATTRIBUTE (size); @@ -1035,6 +1044,7 @@ span_parse_func (MarkupData *md, break; default: CHECK_ATTRIBUTE (background); + CHECK_ATTRIBUTE2 (background, "bgcolor"); CHECK_ATTRIBUTE2(foreground, "color"); CHECK_ATTRIBUTE (rise); CHECK_ATTRIBUTE (variant); |