Pango markup language
This information is derived from the official Pango documentation.
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:
<span foreground="blue" size="100">Blue text</span> is <i>cool</i>!
The ChordPro reference implementation uses the perl module
Text::Layout
that provides almost complete support
for the Pango markup language. For details, see the module
documentation on GitHub.
The most general markup tag is <span>
. The <span>
tag has the
following 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 astyle="normal"
attribute, you will get Sans normal, not italic. -
font_family
A font family name such asnormal
,sans
,serif
ormonospace
. -
face
A synonym forfont_family
-
size
The font size in thousandths of a point, or one of the absolute sizesxx-small
,x-small
,small
,medium
,large
,x-large
,xx-large
, or one of the relative sizessmaller
orlarger
. -
style
The slant style - one ofnormal
,oblique
, oritalic
-
weight
The font weight - one ofultralight
,light
,normal
,bold
,ultrabold
,heavy
, or a numeric weight.__ Note: Onlynormal
andbold
are supported. -
variant
The font variant - eithernormal
orsmallcaps
.
Note: Not (yet) supported. -
stretch
The font width - one ofultracondensed
,extracondensed
,condensed
,semicondensed
,normal
,semiexpanded
,expanded
,extraexpanded
,ultraexpanded
.
Note: Not (yet) supported. -
foreground
An RGB color specification such as#00FF00
or a color name such asred
. -
background
An RGB color specification such as#00FF00
or a color name such asred
.
Note: Not (yet) supported. -
underline
The underline style - one ofsingle
,double
,low
, ornone
. -
underline_color
The color to be used for underlines. -
overline
The overline style - one ofsingle
,double
,low
, ornone
. -
overline_color
The color to be used for overlines. -
rise
The vertical displacement from the baseline, in ten thousandths of an em. Can be negative for subscript, positive for superscript. -
strikethrough
true
orfalse
whether to strike through the text. -
strikethrough_color
The color to be used for strikes. -
href
The URL for a hyperlink.
Note that this is aText:Layout
extension to the Pango Markup definition. -
fallback
If True 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.
Note: Not (yet) supported. -
lang
A language code, indicating the text language.
Note: Not (yet) supported.
There are a number of convenience tags that encapsulate specific span options:
-
b
Make the text bold. -
big
Makes font relatively larger, equivalent to<span size="larger">
. -
i
Make the text italic. -
s
Strikethrough the text. -
sub
Subscript the text. -
sup
Superscript the text. -
small
Makes font relatively smaller, equivalent to<span size="smaller">
. -
tt
Use a monospace font. -
u
Underline the text.