mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +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>`
|
|
|
|
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 :ref:`columns<class_ResourceImporterImageFont_property_columns>` multiplied by :ref:`rows<class_ResourceImporterImageFont_property_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 :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.)`
|