File: pango-markup-language.html

package info (click to toggle)
python-gtk2-doc 2.5.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,304 kB
  • ctags: 3,741
  • sloc: makefile: 38
file content (37 lines) | stat: -rw-r--r-- 7,596 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The Pango Markup Language</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="pango-class-reference.html" title="The pango Class Reference"><link rel="previous" href="class-pangotabarray.html" title="pango.TabArray"><link rel="next" href="pango-functions.html" title="pango Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The Pango Markup Language</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-pangotabarray.html">Prev</a></td><th width="60%" align="center">The pango Class Reference</th><td width="20%" align="right"><a accesskey="n" href="pango-functions.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="pango-markup-language"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>The Pango Markup Language</h2><p>The Pango Markup Language &#8212; a simple markup language for encoding attributes with text.</p></div><div class="refsect1" lang="en"><a name="id2960476"></a><h2>Description</h2><p>The pango markup language is a very simple SGML-like language that
allows you specify attributes with the text they are applied to by using a
small set of markup tags. A simple example of a string using markup
is:</p><tt class="literal">&lt;span foreground="blue" size="100"&gt;Blue text&lt;/span&gt; is &lt;i&gt;cool&lt;/i&gt;!</tt><p>Using the pango markup language to markup text and parsing the
result with the <a href="class-pangoattrlist.html#function-pango--parse-markup" title="pango.parse_markup"><tt class="function">pango.parse_markup</tt>()</a> 
function is a convenient way to generate the <a href="class-pangoattrlist.html" title="pango.AttrList"><tt class="classname">pango.AttrList</tt></a>
and plain text that can be used in a <a href="class-pangolayout.html" title="pango.Layout"><tt class="classname">pango.Layout</tt></a>.</p><p>The root tag of a marked-up document is
<tt class="literal">&lt;markup&gt;</tt>, but the <a href="class-pangoattrlist.html#function-pango--parse-markup" title="pango.parse_markup"><tt class="function">pango.parse_markup</tt>()</a> 
function allows you to omit this tag, so you will most likely never need to
use it. The most general markup tag is <tt class="literal">&lt;span&gt;</tt>. The
<tt class="literal">&lt;span&gt;</tt> tag has the following attributes:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">font_desc</tt></span></td><td>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.</td></tr><tr><td><span class="term"><tt class="literal">font_family</tt></span></td><td>A font family name such as "normal", "sans", "serif" or
"monospace".</td></tr><tr><td><span class="term"><tt class="literal">face</tt></span></td><td>A synonym for font_family</td></tr><tr><td><span class="term"><tt class="literal">size</tt></span></td><td>The font size in thousandths 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'.</td></tr><tr><td><span class="term"><tt class="literal">style</tt></span></td><td>The slant style - one of 'normal', 'oblique', or
'italic'</td></tr><tr><td><span class="term"><tt class="literal">weight</tt></span></td><td>The font weight - one of 'ultralight', 'light',
'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.</td></tr><tr><td><span class="term"><tt class="literal">variant</tt></span></td><td>The font variant - either 'normal' or
'smallcaps'.</td></tr><tr><td><span class="term"><tt class="literal">stretch</tt></span></td><td>The font width - one of 'ultracondensed',
'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded',
'expanded', 'extraexpanded', 'ultraexpanded'.</td></tr><tr><td><span class="term"><tt class="literal">foreground</tt></span></td><td>An RGB color specification such as '#00FF00' or a color
name such as 'red'.</td></tr><tr><td><span class="term"><tt class="literal">background</tt></span></td><td>An RGB color specification such as '#00FF00' or a color
name such as 'red'.</td></tr><tr><td><span class="term"><tt class="literal">underline</tt></span></td><td>The underline style - one of 'single', 'double', 'low',
or 'none'.</td></tr><tr><td><span class="term"><tt class="literal">rise</tt></span></td><td>The vertical displacement from the baseline, in ten
thousandths of an em. Can be negative for subscript, positive for
superscript.</td></tr><tr><td><span class="term"><tt class="literal">strikethrough</tt></span></td><td>'true' or 'false' whether to strike through the
text.</td></tr><tr><td><span class="term"><tt class="literal">fallback</tt></span></td><td>If <tt class="literal">TRUE</tt> enable fallback to other fonts
of characters are missing from the current font. 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.</td></tr><tr><td><span class="term"><tt class="literal">lang</tt></span></td><td>A language code, indicating the text
language.</td></tr></tbody></table><p>There are a number of convenience tags that encapsulate specific
span options:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><tt class="literal">b</tt></span></td><td>Make the text bold.</td></tr><tr><td><span class="term"><tt class="literal">big</tt></span></td><td>Makes font relatively larger, equivalent to &lt;span
size="larger"&gt;.</td></tr><tr><td><span class="term"><tt class="literal">i</tt></span></td><td>Make the text italic.</td></tr><tr><td><span class="term"><tt class="literal">s</tt></span></td><td>Strikethrough the text.</td></tr><tr><td><span class="term"><tt class="literal">sub</tt></span></td><td>Subscript the text.</td></tr><tr><td><span class="term"><tt class="literal">sup</tt></span></td><td>Superscript the text.</td></tr><tr><td><span class="term"><tt class="literal">small</tt></span></td><td>Makes font relatively smaller, equivalent to &lt;span
size="smaller"&gt;.</td></tr><tr><td><span class="term"><tt class="literal">tt</tt></span></td><td>Use a monospace font.</td></tr><tr><td><span class="term"><tt class="literal">u</tt></span></td><td>Underline the text.</td></tr></tbody></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-pangotabarray.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="pango-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="pango-functions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">pango.TabArray</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">pango Functions</td></tr></table></div></body></html>