Pango markup is a simple markup language to encode text with attributes. This was created because of the limitations that PangoAttrList had. PangoAttrList could only apply attributes to text in certain positions of a string. This caused havoc in applications which feature multi languages.
A simple example of a marked-up string might be: "<span foreground="blue" size="x-large">Blue text</span> is <i>cool</i>!"
The root tag of a marked-up document is <markup>, but pango_parse_markup() allows you to omit this tag, so you will most likely never need to use it. The most general markup tag is <span>, then there are some convenience tags. <span> has the following attributes:
Table A-1. <span> attributes
font_desc | A font description string, such as "Sans Italic 12"; note that any other span attributes will override this description. So if you have "Sans Italic" and also a style="normal" attribute, you will get Sans normal, not italic. |
font_family | A font family name |
face | Synonym for font_family |
size | 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 font_desc='12.5' rather than size='12800'. |
style | One of 'normal', 'oblique', 'italic' |
weight | One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight |
variant | 'normal' or 'smallcaps' |
variant | 'normal' or 'smallcaps' |
stretch | One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded' |
foreground | An RGB color specification such as '#00FF00' or a color name such as 'red' |
background | An RGB color specification such as '#00FF00' or a color name such as 'red' |
underline | One of 'single', 'double', 'low', 'none' |
underline_color | The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red' |
rise | Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript. |
strikethrough | 'true' or 'false' whether to strike through the text |
strikethrough_color | The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red' |
fallback | 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback. |
lang | A language code, indicating the text language |
The following convenience tags are provided:
Table A-2. Convenience tags
b | Bold |
big | Makes font relatively larger, equivalent to <span size="larger"> |
i | Italic |
s | Strikethrough |
sub | Subscript |
sup | Superscript |
small | Makes font relatively smaller, equivalent to amp;span size="smaller"> |
tt | Monospace font |
u | Underline |
If you want to experiment with backgrounds and foregrounds available, there is a program called 'text_fg_bg.pl' that lets you select various foregrounds and backgrounds for your markup text. |