Difference between revisions of "Help markup"

From The Battle for Wesnoth Wiki
(Formatting Tags: fix syntax)
(Formatting Tags: add supported values.)
Line 14: Line 14:
 
** '''color/fgcolor/foreground'''
 
** '''color/fgcolor/foreground'''
 
** '''bgcolor/background'''
 
** '''bgcolor/background'''
** '''weight'''
+
** '''weight''': Supported values are ''thin'', ''light'', ''normal'' (default), ''semibold'', ''bold'', ''heavy''. Depends on selected font family.
** '''style'''
+
** '''style''': Supported values are ''italic'', ''oblique'', ''normal'' (default). Depends on selected font family.
 
For documentation on these attributes of '''span/format''', please see the [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango docs].
 
For documentation on these attributes of '''span/format''', please see the [https://docs.gtk.org/Pango/pango_markup.html#pango-markup Pango docs].
  

Revision as of 04:39, 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: 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.

Image Tags

Links

Table Tags