class_dynamicfont.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the DynamicFont.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_DynamicFont:
  5. DynamicFont
  6. ===========
  7. **Inherits:** :ref:`Font<class_font>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. DynamicFont renders vector font files at runtime.
  12. Member Functions
  13. ----------------
  14. +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_fallback<class_DynamicFont_add_fallback>` **(** :ref:`DynamicFontData<class_dynamicfontdata>` data **)** |
  16. +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`DynamicFontData<class_dynamicfontdata>` | :ref:`get_fallback<class_DynamicFont_get_fallback>` **(** :ref:`int<class_int>` idx **)** const |
  18. +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_fallback_count<class_DynamicFont_get_fallback_count>` **(** **)** const |
  20. +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`remove_fallback<class_DynamicFont_remove_fallback>` **(** :ref:`int<class_int>` idx **)** |
  22. +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_fallback<class_DynamicFont_set_fallback>` **(** :ref:`int<class_int>` idx, :ref:`DynamicFontData<class_dynamicfontdata>` data **)** |
  24. +------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  25. Member Variables
  26. ----------------
  27. .. _class_DynamicFont_extra_spacing_bottom:
  28. - :ref:`int<class_int>` **extra_spacing_bottom** - Extra spacing at the bottom in pixels.
  29. .. _class_DynamicFont_extra_spacing_char:
  30. - :ref:`int<class_int>` **extra_spacing_char** - Extra character spacing in pixels.
  31. .. _class_DynamicFont_extra_spacing_space:
  32. - :ref:`int<class_int>` **extra_spacing_space** - Extra space spacing in pixels.
  33. .. _class_DynamicFont_extra_spacing_top:
  34. - :ref:`int<class_int>` **extra_spacing_top** - Extra spacing at the top in pixels.
  35. .. _class_DynamicFont_font_data:
  36. - :ref:`DynamicFontData<class_dynamicfontdata>` **font_data** - The font data.
  37. .. _class_DynamicFont_size:
  38. - :ref:`int<class_int>` **size** - The font size.
  39. .. _class_DynamicFont_use_filter:
  40. - :ref:`bool<class_bool>` **use_filter** - If ``true`` filtering is used.
  41. .. _class_DynamicFont_use_mipmaps:
  42. - :ref:`bool<class_bool>` **use_mipmaps** - If ``true`` mipmapping is used.
  43. Enums
  44. -----
  45. .. _enum_DynamicFont_SpacingType:
  46. enum **SpacingType**
  47. - **SPACING_TOP** = **0** --- Spacing at the top.
  48. - **SPACING_BOTTOM** = **1** --- Spacing at the bottom.
  49. - **SPACING_CHAR** = **2** --- Character spacing.
  50. - **SPACING_SPACE** = **3** --- Space spacing.
  51. Description
  52. -----------
  53. 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.
  54. Member Function Description
  55. ---------------------------
  56. .. _class_DynamicFont_add_fallback:
  57. - void **add_fallback** **(** :ref:`DynamicFontData<class_dynamicfontdata>` data **)**
  58. Adds a fallback font.
  59. .. _class_DynamicFont_get_fallback:
  60. - :ref:`DynamicFontData<class_dynamicfontdata>` **get_fallback** **(** :ref:`int<class_int>` idx **)** const
  61. Returns the fallback font at index ``idx``.
  62. .. _class_DynamicFont_get_fallback_count:
  63. - :ref:`int<class_int>` **get_fallback_count** **(** **)** const
  64. Returns the number of fallback fonts.
  65. .. _class_DynamicFont_remove_fallback:
  66. - void **remove_fallback** **(** :ref:`int<class_int>` idx **)**
  67. Removes the fallback font at index ``idx``.
  68. .. _class_DynamicFont_set_fallback:
  69. - void **set_fallback** **(** :ref:`int<class_int>` idx, :ref:`DynamicFontData<class_dynamicfontdata>` data **)**
  70. Sets the fallback font at index ``idx``.