Difference between revisions of "Help markup"
From The Battle for Wesnoth Wiki
(Information on formatting tags) |
(→Formatting Tags: fix syntax) |
||
Line 9: | Line 9: | ||
* '''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''': 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''' | ||
** '''size/font_size''' | ** '''size/font_size''' | ||
Line 16: | Line 16: | ||
** '''weight''' | ** '''weight''' | ||
** '''style''' | ** '''style''' | ||
− | For documentation on these attributes of '''span/format''', please see the | + | For documentation on these attributes of '''span/format''', please see the [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango docs]. |
=== Image Tags === | === Image Tags === |
Revision as of 04:32, 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: 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
- style
For documentation on these attributes of span/format, please see the Pango docs.