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

  1. font_desc: font description
    Example:
    • <span font_desc="Verdana">string</span>
    • <span font_desc="24">string</span>
    • <span font_desc="Verdana 24">string</span>
  2. Style: 'normal', 'oblique' or 'italic'

  3. Weight: 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight
  4. foreground: foreground color in RGB hexadecimal notation e.g. '#FFFF00' for yellow.
  5. background: background color in RGB hexadecimal notation e.g. '#0000FF' for blue.
  6. underline: 'none', 'single', 'double', 'low' or 'error'
  7. underline_color: underline_color in RGB hexadecimal notation e.g. '#0000FF' for blue.

Sample Codes



User reviews

There are no user reviews yet.

Note: You have to be a registered member to leave a comment. Free registration here.

 
< Prev   Next >

Copyright © 2006-2008. kksou.com. All Rights Reserved