<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="pango-markup-language">
  <refnamediv>
    <refname>The Pango Markup Language</refname>
    <refpurpose>a simple markup language for encoding attributes with text.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Description</title>

    <para>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:</para>

      <literal>&lt;span foreground="blue" size="100"&gt;Blue text&lt;/span&gt; is &lt;i&gt;cool&lt;/i&gt;!</literal>

    <para>Using the pango markup language to markup text and parsing the
result with the <link
linkend="function-pango--parse-markup"><function>pango.parse_markup</function>()</link> 
function is a convenient way to generate the <link
linkend="class-pangoattrlist"><classname>pango.AttrList</classname></link>
and plain text that can be used in a <link
linkend="class-pangolayout"><classname>pango.Layout</classname></link>.</para>

      <para>The root tag of a marked-up document is
<literal>&lt;markup&gt;</literal>, but the <link
linkend="function-pango--parse-markup"><function>pango.parse_markup</function>()</link> 
function allows you to omit this tag, so you will most likely never need to
use it. The most general markup tag is <literal>&lt;span&gt;</literal>. The
<literal>&lt;span&gt;</literal> tag has the following attributes:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>font_desc</literal></term>
	  <listitem>
	    <simpara>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.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>font_family</literal></term>
	  <listitem>
	    <simpara>A font family name such as "normal", "sans", "serif" or
"monospace".</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>face</literal></term>
	  <listitem>
	    <simpara>A synonym for font_family</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>size</literal></term>
	  <listitem>
	    <simpara>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'.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>style</literal></term>
	  <listitem>
	    <simpara>The slant style - one of 'normal', 'oblique', or
'italic'</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>weight</literal></term>
	  <listitem>
	    <simpara>The font weight - one of 'ultralight', 'light',
'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>variant</literal></term>
	  <listitem>
	    <simpara>The font variant - either 'normal' or
'smallcaps'.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>stretch</literal></term>
	  <listitem>
	    <simpara>The font width - one of 'ultracondensed',
'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded',
'expanded', 'extraexpanded', 'ultraexpanded'.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>foreground</literal></term>
	  <listitem>
	    <simpara>An RGB color specification such as '#00FF00' or a color
name such as 'red'.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>background</literal></term>
	  <listitem>
	    <simpara>An RGB color specification such as '#00FF00' or a color
name such as 'red'.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>underline</literal></term>
	  <listitem>
	    <simpara>The underline style - one of 'single', 'double', 'low',
or 'none'.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>rise</literal></term>
	  <listitem>
	    <simpara>The vertical displacement from the baseline, in ten
thousandths of an em. Can be negative for subscript, positive for
superscript.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>strikethrough</literal></term>
	  <listitem>
	    <simpara>'true' or 'false' whether to strike through the
text.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>fallback</literal></term>
	  <listitem>
	  <simpara>If <literal>True</literal> 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.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>lang</literal></term>
	  <listitem>
	    <simpara>A language code, indicating the text
language.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

    <para>There are a number of convenience tags that encapsulate specific
span options:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>b</literal></term>
	  <listitem>
	    <simpara>Make the text bold.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>big</literal></term>
	  <listitem>
	  <simpara>Makes font relatively larger, equivalent to &lt;span
size="larger"&gt;.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>i</literal></term>
	  <listitem>
	    <simpara>Make the text italic.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>s</literal></term>
	  <listitem>
	    <simpara>Strikethrough the text.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>sub</literal></term>
	  <listitem>
	    <simpara>Subscript the text.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>sup</literal></term>
	  <listitem>
	    <simpara>Superscript the text.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>small</literal></term>
	  <listitem>
	    <simpara>Makes font relatively smaller, equivalent to &lt;span
size="smaller"&gt;.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>tt</literal></term>
	  <listitem>
	    <simpara>Use a monospace font.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>u</literal></term>
	  <listitem>
	    <simpara>Underline the text.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

  </refsect1>

</refentry>
