Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ResourceImporterImageFont

Eredita: ResourceImporter < RefCounted < Object

Importa un font bitmap in cui tutti i glifi hanno la stessa larghezza e altezza.

Descrizione

Questo flusso di lavoro basato sulle immagini può essere più semplice da usare rispetto a ResourceImporterBMFont, ma richiede che tutti i glifi abbiano la stessa larghezza e altezza, anche se è possibile personalizzare gli avanzamenti e gli offset di disegno per ogni glifo. Ciò rende ResourceImporterImageFont più adatto ai font a larghezza fissa.

Vedi anche ResourceImporterDynamicFont.

Tutorial

Proprietà

int

ascent

0

Rect2i

character_margin

Rect2i(0, 0, 0, 0)

PackedStringArray

character_ranges

PackedStringArray()

int

columns

1

bool

compress

true

int

descent

0

Array

fallbacks

[]

Rect2i

image_margin

Rect2i(0, 0, 0, 0)

PackedStringArray

kerning_pairs

PackedStringArray()

int

rows

1

int

scaling_mode

2


Descrizioni delle proprietà

int ascent = 0 🔗

Ascesa del font (numero di pixel sopra la linea di base). Se impostato su 0, viene utilizzata la metà dell'altezza del carattere.


Rect2i character_margin = Rect2i(0, 0, 0, 0) 🔗

Margine applicato attorno a ogni glifo importato. Se l'immagine del tuo font contiene guide (sotto forma di linee tra i glifi) o se la spaziatura tra i caratteri sembra sbagliata, prova a regolare character_margin.


PackedStringArray character_ranges = PackedStringArray() 🔗

The character ranges to import from the font image. This is an array that maps each position on the image (in tile coordinates, not pixels). The font atlas is traversed from left to right and top to bottom. Characters can be specified with decimal numbers (126), hexadecimal numbers (0x007e or U+007e), or between single quotes ('~'). Ranges can be specified with a hyphen between characters.

For example, 0-127 represents the full ASCII range. It can also be written as 0x0000-0x007f (or U+0000-U+007f). As another example, ' '-'~' is equivalent to 32-126 and represents the range of printable (visible) ASCII characters.

For any range, the character advance and offset can be customized by appending three space-separated integer values (additional advance, x offset, y offset) to the end. For example 'a'-'b' 4 5 2 sets the advance to char_width + 4 and offset to Vector2(5, 2) for both a and b characters.

Note: The overall number of characters must not exceed the number of columns multiplied by rows. Otherwise, the font will fail to import.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.


int columns = 1 🔗

Numero di colonne nell'immagine del font. Vedi anche rows.


bool compress = true 🔗

Se true, utilizza la compressione senza perdite per il font risultante.


int descent = 0 🔗

Discesa del font (numero di pixel sotto la linea di base). Se impostato su 0, viene utilizzata la metà dell'altezza del carattere.


Array fallbacks = [] 🔗

Lista di font di riserva da usare se un glifo non viene trovato in questo font bitmap. I font all'inizio dell'array vengono tentati per primi.


Rect2i image_margin = Rect2i(0, 0, 0, 0) 🔗

Margine da tagliare sui lati dell'intera immagine. Può essere usato per tagliare parti dell'immagine che contengono informazioni di attribuzione o simili.


PackedStringArray kerning_pairs = PackedStringArray() 🔗

Coppie di crenatura per il font. Le coppie di crenatura regolano la spaziatura tra due caratteri.

Ogni stringa è composta da tre valori separati da spazi: stringa "da", stringa "a" e offset intero. Ogni combinazione forma le due stringhe per una coppia di crenatura, ad esempio, ab cd -3 creerà le coppie di crenatura ac, ad, bc e bd con un'offset di -3. È possibile usare le sequenze di escape \uXXXX per aggiungere caratteri Unicode.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.


int rows = 1 🔗

Numero di righe nell'immagine del font. Vedi anche columns.


int scaling_mode = 2 🔗

Modalità di scalatura del font.