Skip to content

Font Block

In ROLEG, you can adjust the font typeface, size, colour and style with a font block. Its parameters are summarized below.

face
Optional, defaults to "Times New Roman".
String that specifies the typeface of the text.
size
Optional, defaults to 12.
Integer that specifies size of the text in points.
color
Optional, defaults to "black".
String from the list black, dark gray, blue, teal, white, cyan, gray, light gray, red, green, olive, purple, magenta, pink, maroon, dark red, yellow, orange and navy that specifies the color of the text.
style
Optional, defaults to "normal".
String from the list normal, bold, italic and both that specifies the style of the text.

Note

The font block is special in ROLEG, in that it can be added inside any block other than itself.

Note

The specified font settings are inherited by every following block on the same level (see Example usage). If a new font block is provided, only the specified style aspects will be overwritten. Other style aspects will be inherited still.

Example usage

The code snippets below illustrates how the font block might be used.

Inside blocks

experiment {
    info {
        display = "This text is styled red."
        font {
            face = "Arial"
            size = 20
            color = "maroon"
            type = "bold"
        }
    }
    info {
        display = "This text is styled regularly."
    }
}

Inheritance

experiment {
    font {
        face = "Arial"
        size = 20
        color = "maroon"
        type = "bold"
    }
    info {
        display = "This text is styled red by inheritance."
    }
    info {
        display = "Only this text is styled blue, but also bold."
        font {
            color = "blue"
        }
    }
    info {
        display = "This text still styled red by inheritance."
    }
    font {
        face = "Times New Roman"
        size = 12
        color = "black"
        type = "normal"
    }
    info {
        display = "This text is styled as regular again."
    }
}
Back to top