.. _wlrichtext: The Widelands Rich Text System ============================== All texts that can be displayed to the user can be marked up to be laid out and nicely formatted. This allows for changing of font sizes, weights, colors and for the embedding of images. This documents how to format a string to be recognized as rich text and which attributes are understood. The Widelands rich text language is inspired by HTML and therefore uses a syntax very similar to it. To tell our rendering system to go into richtext mode, start your text with ```` and end it with ````. .. toctree:: :maxdepth: 2 General Markup Functions Scenario Markup Functions Richtext Tags, their Attributes and Restrictions Code Example ------------ Here is a simplified version of a fancy message displayed to the user: .. code-block:: lua body = " -- This is richtext

-- Start a paragraph -- Set font size and color Big font to create a header

Normal paragraph, just with a bit more text to show how it looks like.

-- The following content should be spread across a full line

-- Fill up the remaining space

Another normal paragraph

...
" This is quite a lot of hacking, so we have :ref:`Lua convenience functions ` set up. We recommend that you always use those while scripting in Lua, which will also give us consistency in style throughout Widelands. Using the convenience functions will also result in cleaner code when including translation markup (the ``_([[Some text]])`` or ``_("Some text")`` function). A code example how to use the convenience functions and their attributes is given in the documentation for the :ref:`richtext convenience functions `. :ref:`Return to index`