mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
218 lines
12 KiB
ReStructuredText
218 lines
12 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_ResourceImporterImageFont:
|
|
|
|
ResourceImporterImageFont
|
|
=========================
|
|
|
|
**Eredita:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Importa un font bitmap in cui tutti i glifi hanno la stessa larghezza e altezza.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descrizione
|
|
----------------------
|
|
|
|
Questo flusso di lavoro basato sulle immagini può essere più semplice da usare rispetto a :ref:`ResourceImporterBMFont<class_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 :ref:`ResourceImporterDynamicFont<class_ResourceImporterDynamicFont>`.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutorial
|
|
----------------
|
|
|
|
- `Font bitmap - Utilizzo dei font <../tutorials/ui/gui_using_fonts.html#bitmap-fonts>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Proprietà
|
|
------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`int<class_int>` | :ref:`ascent<class_ResourceImporterImageFont_property_ascent>` | ``0`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`Rect2i<class_Rect2i>` | :ref:`character_margin<class_ResourceImporterImageFont_property_character_margin>` | ``Rect2i(0, 0, 0, 0)`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`character_ranges<class_ResourceImporterImageFont_property_character_ranges>` | ``PackedStringArray()`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`int<class_int>` | :ref:`columns<class_ResourceImporterImageFont_property_columns>` | ``1`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`compress<class_ResourceImporterImageFont_property_compress>` | ``true`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`int<class_int>` | :ref:`descent<class_ResourceImporterImageFont_property_descent>` | ``0`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`Array<class_Array>` | :ref:`fallbacks<class_ResourceImporterImageFont_property_fallbacks>` | ``[]`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`Rect2i<class_Rect2i>` | :ref:`image_margin<class_ResourceImporterImageFont_property_image_margin>` | ``Rect2i(0, 0, 0, 0)`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`kerning_pairs<class_ResourceImporterImageFont_property_kerning_pairs>` | ``PackedStringArray()`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`int<class_int>` | :ref:`rows<class_ResourceImporterImageFont_property_rows>` | ``1`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
| :ref:`int<class_int>` | :ref:`scaling_mode<class_ResourceImporterImageFont_property_scaling_mode>` | ``2`` |
|
|
+---------------------------------------------------+------------------------------------------------------------------------------------+-------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descrizioni delle proprietà
|
|
------------------------------------------------------
|
|
|
|
.. _class_ResourceImporterImageFont_property_ascent:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **ascent** = ``0`` :ref:`🔗<class_ResourceImporterImageFont_property_ascent>`
|
|
|
|
Ascesa del font (numero di pixel sopra la linea di base). Se impostato su ``0``, viene utilizzata la metà dell'altezza del carattere.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_character_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Rect2i<class_Rect2i>` **character_margin** = ``Rect2i(0, 0, 0, 0)`` :ref:`🔗<class_ResourceImporterImageFont_property_character_margin>`
|
|
|
|
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 :ref:`character_margin<class_ResourceImporterImageFont_property_character_margin>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_character_ranges:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`PackedStringArray<class_PackedStringArray>` **character_ranges** = ``PackedStringArray()`` :ref:`🔗<class_ResourceImporterImageFont_property_character_ranges>`
|
|
|
|
Gli intervalli dei caratteri da importare dall'immagine del font. Questo è un array che mappa ogni posizione sull'immagine (in coordinate piastrellate, non pixel). L'atlante del font è attraversato da sinistra verso destra e dall'alto verso il basso. È possibile specificare i caratteri con numeri decimali (127), numeri esadecimali (``0x007f`` o ``U+007f``) o tra virgolette singole (``'~'``). È possibile specificare gli intervalli con un trattino tra i caratteri.
|
|
|
|
Ad esempio, ``0-127`` rappresenta l'intervallo ASCII completo. Si può anche scrivere come ``0x0000-0x007f`` (o ``U+0000-U+007f``). Come un altro esempio, ``' '-'~'`` equivale a ``32-127`` e rappresenta l'intervallo di caratteri ASCII stampabili (visibili).
|
|
|
|
Per qualsiasi intervallo, è possibile personalizzare l'avanzamento e l'offset dei caratteri aggiungendo tre valori interi separati da spazi (avanzamento aggiuntivo, offset x, offset y) alla fine. Ad esempio, ``'a'-'b' 4 5 2`` imposta l'avanzamento su ``char_width + 4`` e l'offset su ``Vector2(5, 2)`` per entrambi i caratteri `a` e `b`.
|
|
|
|
\ **Nota:** Il numero totale di caratteri non deve superare il numero di :ref:`columns<class_ResourceImporterImageFont_property_columns>` moltiplicato per :ref:`rows<class_ResourceImporterImageFont_property_rows>`. Altrimenti, non sarà possibile importare il font.
|
|
|
|
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray<class_PackedStringArray>` for more details.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_columns:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **columns** = ``1`` :ref:`🔗<class_ResourceImporterImageFont_property_columns>`
|
|
|
|
Numero di colonne nell'immagine del font. Vedi anche :ref:`rows<class_ResourceImporterImageFont_property_rows>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_compress:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **compress** = ``true`` :ref:`🔗<class_ResourceImporterImageFont_property_compress>`
|
|
|
|
Se ``true``, utilizza la compressione senza perdite per il font risultante.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_descent:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **descent** = ``0`` :ref:`🔗<class_ResourceImporterImageFont_property_descent>`
|
|
|
|
Discesa del font (numero di pixel sotto la linea di base). Se impostato su ``0``, viene utilizzata la metà dell'altezza del carattere.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_fallbacks:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Array<class_Array>` **fallbacks** = ``[]`` :ref:`🔗<class_ResourceImporterImageFont_property_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.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_image_margin:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Rect2i<class_Rect2i>` **image_margin** = ``Rect2i(0, 0, 0, 0)`` :ref:`🔗<class_ResourceImporterImageFont_property_image_margin>`
|
|
|
|
Margine da tagliare sui lati dell'intera immagine. Può essere usato per tagliare parti dell'immagine che contengono informazioni di attribuzione o simili.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_kerning_pairs:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`PackedStringArray<class_PackedStringArray>` **kerning_pairs** = ``PackedStringArray()`` :ref:`🔗<class_ResourceImporterImageFont_property_kerning_pairs>`
|
|
|
|
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 :ref:`PackedStringArray<class_PackedStringArray>` for more details.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_rows:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **rows** = ``1`` :ref:`🔗<class_ResourceImporterImageFont_property_rows>`
|
|
|
|
Numero di righe nell'immagine del font. Vedi anche :ref:`columns<class_ResourceImporterImageFont_property_columns>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_ResourceImporterImageFont_property_scaling_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **scaling_mode** = ``2`` :ref:`🔗<class_ResourceImporterImageFont_property_scaling_mode>`
|
|
|
|
Modalità di scalatura del font.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Questo metodo dovrebbe solitamente essere sovrascritto dall'utente per aver un effetto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Questo metodo non ha effetti collaterali. Non modifica alcuna variabile appartenente all'istanza.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Questo metodo accetta qualsiasi numero di argomenti oltre a quelli descritti qui.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Questo metodo è utilizzato per creare un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Questo metodo non necessita di alcun'istanza per essere chiamato, quindi può essere chiamato direttamente usando il nome della classe.)`
|
|
.. |operator| replace:: :abbr:`operator (Questo metodo descrive un operatore valido da usare con questo tipo come operando di sinistra.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Questo valore è un intero composto da una maschera di bit dei seguenti flag.)`
|
|
.. |void| replace:: :abbr:`void (Nessun valore restituito.)`
|