Difference between revisions of "Help markup"
From The Battle for Wesnoth Wiki
(→Formatting Tags: add supported values.) |
(→Formatting Tags: add h abbreviation) |
||
Line 8: | Line 8: | ||
* '''italic/i''': Makes the text italic. | * '''italic/i''': Makes the text italic. | ||
* '''underline/u''': Adds an underline to text. | * '''underline/u''': Adds an underline to text. | ||
− | * '''header''': Shows the text formatted as a heading (serif font at size 20 and color white). | + | * '''header/h''': Shows the text formatted as a heading (serif font at size 20 and color white). |
* '''span/format''': Applies various types of formatting to the marked up text. Similar to the Pango '''span''' tag, but only the following attributes are supported: | * '''span/format''': Applies various types of formatting to the marked up text. Similar to the Pango '''span''' tag, but only the following attributes are supported: | ||
** '''face/font_family''' | ** '''face/font_family''' |
Revision as of 05:05, 29 July 2024
Help Markup
This page documents the markup used by the Rich Label widget. This is a markup language based on the Pango markup already being used by other GUI2 widgets to show formatted text and the earlier GUI1 help markup. Specifically, you can add links, tables and images (inline and floating) alongside formatted text.
Both GUI1 style syntax (<img>src='path/to/myimage.png'</img>
) and newer XML style syntax (<img src='path/to/myimage.png'/>
) are supported. The new syntax is recommended. The internal XML parser doesn't support nested tags at the moment (limitation might be removed in the future). Use single quotes inside markup.
Formatting Tags
- bold/b: Makes the text bold.
- italic/i: Makes the text italic.
- underline/u: Adds an underline to text.
- header/h: Shows the text formatted as a heading (serif font at size 20 and color white).
- span/format: Applies various types of formatting to the marked up text. Similar to the Pango span tag, but only the following attributes are supported:
- face/font_family
- size/font_size
- color/fgcolor/foreground
- bgcolor/background
- weight: Supported values are thin, light, normal (default), semibold, bold, heavy. Depends on selected font family.
- style: Supported values are italic, oblique, normal (default). Depends on selected font family.
For documentation on these attributes of span/format, please see the Pango docs.