Risorse – Font

Le funzioni seguenti forniscono informazioni su un font:

font_exists() ind Dato l’indice di un font restituisce: esiste?, il nome, il fontname, bold?, italic?, l’indice del primo carattere, l’indice dell’ultimo carattere
font_get_name() ind
font_get_fontname() ind
font_get_bold() ind
font_get_italic() ind
font_get_first() ind
font_get_last() ind

 

Modificare Font

It is possible to create, replace, and delete fonts during the game using the following functions.
Don’t replace a font that is set as the current font or at least set it again afterwards.

font_add() name
size
bold
italic
first
last
Adds a new font and returns its index, indicating the name, size, whether it is bold or italic, and the first and last character that must be created.
font_add_sprite() spr
first
prop
sep
Adds a new font and returns its index.
The font is created from a sprite.
The sprite should contain a subimage for each character.
first indicate the index of the first character in the sprite.
For example, use ord(‘0’) if your sprite only contains the digits. prop indicates whether the font is proportional.
In a proportional font, for each character the width of the bounding box is used as the character width.
Finally, sep indicates the amount of white space that must separate the characters horizontally.
A typical value would lie between 2 and 8 depending on the font size.
font_replace() ind
name
size
bold
italic
first
last
Replaces the font ind with a new font, indicating the name, size, whether it is bold or italic, and the first and last character that must be created.
font_replace_sprite() ind
spr
first
prop
sep
Replaces the font ind with a new sprite-based font.
font_delete() ind Deletes the font with the given index, freeing the memory it uses.

Lascia un commento