Skip to content

Configuration

Joan Andrés edited this page Dec 5, 2019 · 15 revisions

Configuration is handled by set and get functions and by configuration file.

set

This is probably the most complex function in BearLibTerminal API. Configuring library options and mechanics, managing fonts, tilesets and even configuration file is performed with it:

terminal_set("window: size=80x25; font: ./UbuntuMono-R.ttf, size=12");

The function returns a boolean value indicating success or failure.

It is possible to set several options at once. However, this function tries to behave in transaction-like way: in case of error, it does not change anything and return false.

Configuration string format

A string passed to the function specifies a set of key-value parameters separated by semicolons:

window.title='foo'; window.size=80x25;

Related parameters can be grouped together:

window: title='foo', size=80x25;

Extra spaces, commas and semicolons are ignored. For now, all newline characters are also ignored, even inside quoted values, but this may change.

Quoting of string values is mostly optional and required only if value contains some delimiter characters like semicolons or you want to preserve leading/trailing whitespaces. Quoting may be done with both single and double quotes. There is no escape sequences besides Pascal-like double-quote escaping:

window.title='I''m feeling lucky!';

Library configuration

There is a number of options directly affecting library behavior and/or window appearance:

Clone this wiki locally