text, scrolltext, markdown
The three ways to display text.
text — regular text (18 properties)
<text name="titre">
<pos>0.06 0.08</pos>
<size>0.5 0.1</size>
<text>${system}</text>
<fontPath>${root}/data/fonts/Exo2.otf</fontPath>
<fontSize>0.05</fontSize>
<color>FFFFFF</color>
<alignment>left</alignment>
<forceUppercase>true</forceUppercase>
</text>
| Property | Type | Role |
|---|---|---|
pos size origin rotation rotationOrigin | pair | placement — see Position, size, origin |
text | text | the content, variables included |
path | path | reads the content from a file, instead of text |
fontPath | path | the font |
fontSize | number | < 1 = ratio of the smaller side of the screen, >= 1 = 240p size — see Ratio, percentage or pixels |
fontStyle | text | normal, bold, italic, bolditalic |
color | color | the text color |
backgroundColor | color | a background behind the text |
alignment | text | see below |
forceUppercase | yes/no | all capitals |
lineSpacing | number | line spacing, 1.5 by default — the step between two lines is lineSpacing × 0.8 × the height of a line |
multiline | yes/no | allow line breaks |
zIndex | number | depth |
disabled | yes/no | switch the component off |
alignment acts on two axes
The value combines the horizontal and the vertical.
Nine positions, thirteen ways to write them — four values are synonyms:
| Position | To write | Synonym |
|---|---|---|
| top-left | topleft | |
| top-center | topcenter | top |
| top-right | topright | |
| center-left | centerleft | left |
| center | center | |
| center-right | centerright | right |
| bottom-left | bottomleft | |
| bottom-center | bottomcenter | bottom |
| bottom-right | bottomright |
⚠️ An unknown value does not keep the previous alignment: it falls back to center-left, the default value.
The text is aligned within its size box: without size, the alignment has nothing to act on.
scrolltext — scrolling text (16 properties)
Same properties as text, without multiline and lineSpacing. The text scrolls horizontally when it overflows its box.
<scrolltext name="titre-long">
<size>0.4 0.06</size>
<text>${game.name}</text>
<fontSize>0.04</fontSize>
</scrolltext>
To be reserved for values whose length you do not control — a game name, a developer.
markdown — formatted text (15 properties)
<markdown name="synopsis">
<pos>0.06 0.5</pos>
<size>0.4 0.35</size>
<text>${game.synopsis}</text>
<fontSize>0.028</fontSize>
<color>C6CBD8</color>
</markdown>
Same properties as text, without fontStyle, backgroundColor or multiline. lineSpacing defaults to 1.1, and the space added between two lines is lineSpacing − 1 times the height of a line. Useful for a synopsis or an “about” page.
A text taller than its box scrolls on its own: it goes down, pauses at the bottom, then returns to the start. Scrolling calls for an alignment set to the top or the bottom — centred vertically, the text stays still.
Styling inside a line
| What you write | What you get |
|---|---|
**bold** | bold |
*italic* or _italic_ | italic |
***bold italic*** | bold and italic |
__underlined__ | underlined |
___italic underlined___ | italic and underlined |
~~struck~~ | struck-through text |
A word between backticks switches to a fixed-pitch font:
Run `retroarch` to play.
The fixed-pitch font keeps the Recalbox typeface: fontPath does not apply to it.
A marker you do not close is shown as is. A backslash cancels the marker that follows it: \* shows a star. Between backticks, everything is literal.
Headings
One to four hashes followed by a space. Each level has its own size, and a heading is always bold. Beyond four hashes, the heading stays at the fourth level. You may close it with hashes, leaving a space before them.
# Level 1
## Level 2
### Level 3
#### Level 4
# Closed #
The first two levels can also be written under the text: a line of = for level 1, a line of - for level 2.
Level 1
=======
Level 2
-------
Lists
| What you write | What you get |
|---|---|
- item | a bullet |
+ item | a bullet |
* item | a bullet |
1. item | a bullet — Recalbox draws the bullet, never the number |
The dash, the plus and the star are followed by a space or a tab; the dot of a number, by a space. A line that is too long wraps aligned under the text, not under the bullet. There is only one level: a list inside a list does not exist.
The separator line
A line of - or = after an empty line draws a rule across the full width.
The first paragraph.
---
The second one.
Lines and sizes
Every line of the text is a line on screen. An empty line adds a gap, and several empty lines in a row count as one.
fontSize gives the size of the running text; headings and the fixed pitch follow from it.
| Level | Size |
|---|---|
# | fontSize × 2.83 |
## | fontSize × 2.17 |
### | fontSize × 1.5 |
#### | fontSize × 1.17 |
| running text | fontSize |
| fixed pitch | fontSize × 0.7 |
Without fontSize, the running text is 0.030.
Links and images are not part of the formatting.