Bug 490669 – add some <span> attribute aliases
authorBehdad Esfahbod <behdad@gnome.org>
Mon, 21 Apr 2008 21:26:33 +0000 (21:26 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Mon, 21 Apr 2008 21:26:33 +0000 (21:26 +0000)
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

ChangeLog
docs/pango_markup.sgml
pango/pango-markup.c

index b26835c..0113fab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
 
index ba96a9d..0c992a4 100644 (file)
@@ -46,7 +46,9 @@ general markup tag is &lt;span&gt;, then there are some convenience
 tags. &lt;span&gt; has the following attributes:
 <variablelist><title>&lt;span&gt; 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'
index abb3890..449810e 100644 (file)
@@ -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);