Files
godot-docs/classes/class_dynamicfont.rst
2017-11-27 08:32:15 +01:00

117 lines
5.1 KiB
ReStructuredText

.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the DynamicFont.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_DynamicFont:
DynamicFont
===========
**Inherits:** :ref:`Font<class_font>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
**Category:** Core
Brief Description
-----------------
DynamicFont renders vector font files at runtime.
Member Functions
----------------
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_fallback<class_DynamicFont_add_fallback>` **(** :ref:`DynamicFontData<class_dynamicfontdata>` data **)** |
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`DynamicFontData<class_dynamicfontdata>` | :ref:`get_fallback<class_DynamicFont_get_fallback>` **(** :ref:`int<class_int>` idx **)** const |
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_fallback_count<class_DynamicFont_get_fallback_count>` **(** **)** const |
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_fallback<class_DynamicFont_remove_fallback>` **(** :ref:`int<class_int>` idx **)** |
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_fallback<class_DynamicFont_set_fallback>` **(** :ref:`int<class_int>` idx, :ref:`DynamicFontData<class_dynamicfontdata>` data **)** |
+------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
Member Variables
----------------
.. _class_DynamicFont_extra_spacing_bottom:
- :ref:`int<class_int>` **extra_spacing_bottom** - Extra spacing at the bottom in pixels.
.. _class_DynamicFont_extra_spacing_char:
- :ref:`int<class_int>` **extra_spacing_char** - Extra character spacing in pixels.
.. _class_DynamicFont_extra_spacing_space:
- :ref:`int<class_int>` **extra_spacing_space** - Extra space spacing in pixels.
.. _class_DynamicFont_extra_spacing_top:
- :ref:`int<class_int>` **extra_spacing_top** - Extra spacing at the top in pixels.
.. _class_DynamicFont_font_data:
- :ref:`DynamicFontData<class_dynamicfontdata>` **font_data** - The font data.
.. _class_DynamicFont_size:
- :ref:`int<class_int>` **size** - The font size.
.. _class_DynamicFont_use_filter:
- :ref:`bool<class_bool>` **use_filter** - If ``true`` filtering is used.
.. _class_DynamicFont_use_mipmaps:
- :ref:`bool<class_bool>` **use_mipmaps** - If ``true`` mipmapping is used.
Numeric Constants
-----------------
- **SPACING_TOP** = **0** --- Spacing at the top.
- **SPACING_BOTTOM** = **1** --- Spacing at the bottom.
- **SPACING_CHAR** = **2** --- Character spacing.
- **SPACING_SPACE** = **3** --- Space spacing.
Description
-----------
DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like :ref:`BitmapFont<class_bitmapfont>`. This trades the faster loading time of :ref:`BitmapFont<class_bitmapfont>`\ s for the ability to change font parameters like size and spacing during runtime. :ref:`DynamicFontData<class_dynamicfontdata>` is used for referencing the font file paths.
Member Function Description
---------------------------
.. _class_DynamicFont_add_fallback:
- void **add_fallback** **(** :ref:`DynamicFontData<class_dynamicfontdata>` data **)**
Adds a fallback font.
.. _class_DynamicFont_get_fallback:
- :ref:`DynamicFontData<class_dynamicfontdata>` **get_fallback** **(** :ref:`int<class_int>` idx **)** const
Returns the fallback font at index ``idx``.
.. _class_DynamicFont_get_fallback_count:
- :ref:`int<class_int>` **get_fallback_count** **(** **)** const
Returns the number of fallback fonts.
.. _class_DynamicFont_remove_fallback:
- void **remove_fallback** **(** :ref:`int<class_int>` idx **)**
Removes the fallback font at index ``idx``.
.. _class_DynamicFont_set_fallback:
- void **set_fallback** **(** :ref:`int<class_int>` idx, :ref:`DynamicFontData<class_dynamicfontdata>` data **)**
Sets the fallback font at index ``idx``.