Text Markup Codes

When you write texts which will be used in JugiMap Framework you must use special markup codes which allow correct parsing of text into text segment objects. The markup codes also provide basic formating options.

There are several things about the way the text get parsed into text segment which are important to know:

General markup codes

//

The comment text. All text after this markup code is considered as comment and is discarded during parsing. A line which contain only comment text is discarded.

an example:

Markup codes for defining text segments and text sequences

Important! These markup codes must be placed at the beginning of a line!

>id:{number} [OPTIONAL: customParameterName1:customParameterValue1 , customParameterName2:customParameterValue2 , …]

The identification number of a text segment. It must be an unique integer value starting from 0. If you use the same number more times then only the text segment at the first usage is stored and the other segments with that number are discarded. To avoid that situation it is advised to write text segments with id in ascending order: 0, 1, 2, 3, …

Optional custom parameters are defined in the brackets [] and separated by comma. You can define a pair name:value or just name in which case the value will be empty string.

an example:

>seqId:{number} [OPTIONAL: customParameterName1:customParameterValue1 , customParameterName2:customParameterValue2 , …]

The identification number of a text sequence. A sequence is a subgroup of text segments which can allow better organization of texts. It must be an unique integer value starting from 0. If you use the same number more times then only the text sequence at the first usage is stored and the other sequences with that number are discarded. To avoid that situation it is advised to write text sequences with seqId in ascending order: 0, 1, 2, 3, …

Optional custom parameters are defined in the brackets [] and separated by comma. You can define a pair name:value or just name in which case the value will be empty string.

After we start a sequence with >seqId: we add text segments to it. This is done with the following markup code:

>add

Add a text segment to a sequence. The text segments are stored in the text sequence in same order as they are being added.

an example:

The current sequence is finalized when a new sequence is defined with >seqId: or a new global text segment is defined with >id: or the end of file is reached.

Formating parameters

Formatting parameters are used for setting the text properties like font, color, offset and spacing.

Markup Codes for default formating parameters

Important! These markup codes must be placed at the beginning of a line!

Default parameter values are automatically assigned to active parameters every time a text segment is parsed. They are usually set at the beginning of text file. They can be changed at any point which will affect all text segments after the change.

>defColor:{colorIndex OR #HexColor}

Set the default text color. The value can be the index of a color in the colors library or a color in hex format.

If this parameter is not defined, the global color equals the color at the index 0 in the colors library.

>defFont:{fontIndex}

Set the default font. The value is the index of a font in the fonts library.

If this parameter is not defined, the global font equals the font at the index 0 in the fonts library.

>defIndent:{value in pixels}

Set the default indent of a paragraph in pixels.

If this parameter is not defined, the default indent is 0.

>defTabSpacing::{value in pixels}

Set the default value of tab spacing in pixels.

If this parameter is not defined, the default tab spacing is 0.

>buttonColors:{colorIndex_normalState OR #HexColor_normalState , colorIndex_cursorOver OR #HexColor_cursorOver}

Set the two colors which are used for the text buttons if they are defined within the text. The first color is used for the normal button state and the second color is used when the cursor is over the text button.

If this parameter is not defined, the default color for the normal button state is white and the color when the cursor is over the button is red.

Markup Codes for active formating parameters

Important! These markup codes are placed within the text but they must be a separate ‘word’ - there must be a space before and after the code!

<color:{colorIndex OR #HexColor}>

Set the active text color. The value can be the index of a color in the color library or a color in hex format. All words within the text segment after this code are colored with this color.

On new text segment this color is automatically set to default text color!

Set the active text color to the default text color. This is equivalent to using <color:{defaultColorIndex OR #HexDefaultColor}>.

<font:{fontIndex}>

Set the active font. The value is the index of a font in the fonts library. All words within the text segment after this code use this font.

On new text segment this font is automatically set to default font.

Set the active font to the default font. This is equivalent to using <font:{defaultFontIndex}>.

<offset:{value in pixels}>

Set the active text offset in pixels. This is the distance from the left edge at which the text get ‘printed’. This offset affects all lines within the text segment after the code.

On new text segment this offset is set to 0.

<verSpacing:{value in pixels}>

Add the vertical spacing in pixels.

<tabSpacing:{value in pixels}>

Set the active value of tab spacing in pixels. This value is active within the text segment after this code.

On new text segment this value is automatically set to default tabSpacing.

Set the active tab spacing to default tab spacing. This is equivalent to using <tabSpacing:{defaultTabSpacingValue}>.

<indent:{value in pixels}>

Set the active indent of paragraphs in pixels. This indent is applied to all paragraphs within the text segment after the code.

On new text segment the active indent is set to default indent.

Set the active indent to default indent. This is equivalent to using <indent:{defaultIndentValue}>.

<button:{name}>

Start a text button. The value must be an unique identification name. All words within the text segment after this code are included in the button, until the code for the button end is reached.

End a button started with <button:{name}>

the following example is taken from ‘GUI demo’ application: