.. _rt_tags: The Richtext Tags ================= * :ref:`rt_tags_rt` * :ref:`rt_tags_div` * :ref:`rt_tags_br` * :ref:`rt_tags_space` * :ref:`rt_tags_vspace` * :ref:`rt_tags_p` * :ref:`rt_tags_font` * :ref:`rt_tags_img` * :ref:`rt_tags_link` For an introduction to our richtext system including a code example, see :ref:`wlrichtext`. .. _rt_tags_rt: Rich Text -- ----------------- The main wrapper that will signal to the font renderer to go into richtext mode. This tag surrounds your whole text, and is allowed only once. You can also set some options here what will affect your whole text. Attributes ^^^^^^^^^^ * **padding**: The rectangle of this tag is shrunk so leave a gap on its outside, on all four outer edges. * **padding_r**: Padding on the right-hand side * **padding_l**: Padding on the left-hand side * **padding_b**: Padding on the bottom * **padding_t**: Padding on the top * **background**: Give this tag's rectangle a background color as a hex value. * **keep_spaces**: Do now trim away trailing and double spaces. Use this where the user is editing text. * **db_show_spaces**: Highlight all blank spaces for debugging purposes. Sub-tags ^^^^^^^^ * :ref:`rt_tags_div` * :ref:`rt_tags_font` * :ref:`rt_tags_p` * :ref:`rt_tags_vspace` * :ref:`rt_tags_link` :ref:`Return to tag index` .. _rt_tags_div: Division --
----------------- This tag defines a rectangle and can be used as a layout control. Attributes ^^^^^^^^^^ The same attributes as :ref:`rt_tags_rt`, plus the following: * **margin**: Shrink all contents to leave a margin towards the outer edge of this tag's rectangle. * **float**: Make text float around this div. Allowed values are ``left``, ``right``. The structure has to be something like: ``div("width=100%", div("float=left padding_r=6", p(img(imagepath))) .. p(text))``, with the first embedded div being the floating one. * **valign**: Align the contents vertically. Allowed values are ``top`` (default), ``center`` or ``middle``, ``bottom``. * **width**: The width of this element, as a pixel amount, or as a percentage. The last ``div`` in a row can be expanded automatically by using ``*``. Sub-tags ^^^^^^^^ * :ref:`rt_tags_div` * :ref:`rt_tags_font` * :ref:`rt_tags_p` * :ref:`rt_tags_vspace` * :ref:`rt_tags_link` :ref:`Return to tag index` .. _rt_tags_br: Line Break --
------------------ A single line break. Use sparingly for things like poetry stanzas. If you are starting a new paragraph, use :ref:`rt_tags_p` instead. :ref:`Return to tag index` .. _rt_tags_space: Horizontal Space -- --------------------------- Inserts a horizontal gap between the previous and the following text. This space can be filled with a character of your choice. Attributes ^^^^^^^^^^ * **gap**: The size of the gap as a pixel amount * **fill**: A character to fill the gap with :ref:`Return to tag index` .. _rt_tags_vspace: Vertical Space -- -------------------------- Inserts a vertical gap between the previous and the following text. Attributes ^^^^^^^^^^ * **gap**: The size of the gap as a pixel amount :ref:`Return to tag index` .. _rt_tags_p: Paragraph --

---------------- This tag encloses a text paragraph. Attributes ^^^^^^^^^^ * **indent**: Adds an indent to the first line of the paragraph * **align**: The horizontal alignment for the paragraph's text. Allowed values are ``left`` (default), ``center`` or ``middle``, ``right``. * **valign**: See :ref:`rt_tags_div` * **spacing**: Vertical line spacing as a pixel value Sub-tags ^^^^^^^^ * :ref:`rt_tags_br` * :ref:`rt_tags_div` * :ref:`rt_tags_font` * :ref:`rt_tags_img` * :ref:`rt_tags_space` * :ref:`rt_tags_vspace` * :ref:`rt_tags_link` :ref:`Return to tag index` .. _rt_tags_font: Font -- -------------- This tag defines the font style for the enclosed text. Attributes ^^^^^^^^^^ * **size**: The font size as a pixel value * **face**: The font face. Allowed values are ``sans`` (default), ``serif`` and ``condensed``. * **color**: The font color as a hex value * **bold**: Make the text bold * **italic**: Make the text italic * **underline**: Underline the text * **shadow**: Add a background shadow * **ref**: To be implemented Sub-tags ^^^^^^^^ * :ref:`rt_tags_br` * :ref:`rt_tags_div` * :ref:`rt_tags_font` * :ref:`rt_tags_img` * :ref:`rt_tags_p` * :ref:`rt_tags_space` * :ref:`rt_tags_vspace` * :ref:`rt_tags_link` :ref:`Return to tag index` .. _rt_tags_link: Link -- -------------- This tag defines a clickable hyperlink. Attributes ^^^^^^^^^^ * **type**: Mandatory. What kind of link. Can be "url" or "ui". * **target**: Mandatory. The URL to open or the UI widget to reference. * **action**: Mandatory for UI links: the action to perform. Not allowed for URLs. * **mouseover**: Optional. The mouseover text to show. Sub-tags ^^^^^^^^ * :ref:`rt_tags_br` * :ref:`rt_tags_div` * :ref:`rt_tags_font` * :ref:`rt_tags_img` * :ref:`rt_tags_p` * :ref:`rt_tags_space` * :ref:`rt_tags_vspace` * :ref:`rt_tags_link` :ref:`Return to tag index` .. _rt_tags_img: Image -- -------------- Displays an image with your text. Attributes ^^^^^^^^^^ * **src**: The path to the image, relative to the ``data`` directory. * **object**: Show the representative image of a map object instead of using ``src``. * **ref**: To be implemented * **color**: Player color for the image as a hex value * **width**: Maximum width of the image as a pixel amount. The corresponding height will be matched automatically. The image may only be scaled down, never up. Not supported in conjunction with the ``object`` parameter. :ref:`Return to tag index`