The Pango Markup Language - Quick Reference |
|
Written by kksou
|
|
Thursday, 13 March 2008 |
|
In case you're not aware, there are many widgets that you can set text or text labels with markup language, e.g. GtkLabel, GtkTreeView.
Below is a quick reference of the Pango Markup Language:
Tags
| Tags |
Description |
Examples |
Sample Output |
| b |
bold |
<b>string</b> |
string |
| i |
italic |
<i>string</i> |
string |
| u |
underline |
<u>string</u> |
string |
| s |
strikethrough |
<s>string</s> |
string |
| tt |
monospace font |
<tt>string</tt> |
string |
| sub |
subscript |
x<sub>1</sub> + x<sub>2</sub> |
x1 + x2 |
| sup |
superscript |
E = mc<sup>2</sup> |
E = mc2 |
| big |
Makes font relatively larger |
string <big>string</big> |
string string |
| small |
Makes font relatively smaller |
string <small>string</small> |
string string |
Attributes
- font_desc: font description
Example:
- <span font_desc="Verdana">string</span>
- <span font_desc="24">string</span>
- <span font_desc="Verdana 24">string</span>
- Style: 'normal', 'oblique' or 'italic'
- Weight: 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight
- foreground: foreground color in RGB hexadecimal notation e.g. '#FFFF00' for yellow.
- background: background color in RGB hexadecimal notation e.g. '#0000FF' for blue.
- underline: 'none', 'single', 'double', 'low' or 'error'
- underline_color: underline_color in RGB hexadecimal notation e.g. '#0000FF' for blue.
Sample Codes
User reviews Average user ratings: 5.0 (from 1 user) Note: You have to be a registered member to leave a comment. Free registration here. |
July 29, 2009 4:58am