class_dynamicfont.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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_outline_color:
  38. - :ref:`Color<class_color>` **outline_color**
  39. .. _class_DynamicFont_outline_size:
  40. - :ref:`int<class_int>` **outline_size**
  41. .. _class_DynamicFont_size:
  42. - :ref:`int<class_int>` **size** - The font size.
  43. .. _class_DynamicFont_use_filter:
  44. - :ref:`bool<class_bool>` **use_filter** - If ``true`` filtering is used.
  45. .. _class_DynamicFont_use_mipmaps:
  46. - :ref:`bool<class_bool>` **use_mipmaps** - If ``true`` mipmapping is used.
  47. Enums
  48. -----
  49. .. _enum_DynamicFont_SpacingType:
  50. enum **SpacingType**
  51. - **SPACING_TOP** = **0** --- Spacing at the top.
  52. - **SPACING_BOTTOM** = **1** --- Spacing at the bottom.
  53. - **SPACING_CHAR** = **2** --- Character spacing.
  54. - **SPACING_SPACE** = **3** --- Space spacing.
  55. Description
  56. -----------
  57. 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.
  58. Member Function Description
  59. ---------------------------
  60. .. _class_DynamicFont_add_fallback:
  61. - void **add_fallback** **(** :ref:`DynamicFontData<class_dynamicfontdata>` data **)**
  62. Adds a fallback font.
  63. .. _class_DynamicFont_get_fallback:
  64. - :ref:`DynamicFontData<class_dynamicfontdata>` **get_fallback** **(** :ref:`int<class_int>` idx **)** const
  65. Returns the fallback font at index ``idx``.
  66. .. _class_DynamicFont_get_fallback_count:
  67. - :ref:`int<class_int>` **get_fallback_count** **(** **)** const
  68. Returns the number of fallback fonts.
  69. .. _class_DynamicFont_remove_fallback:
  70. - void **remove_fallback** **(** :ref:`int<class_int>` idx **)**
  71. Removes the fallback font at index ``idx``.
  72. .. _class_DynamicFont_set_fallback:
  73. - void **set_fallback** **(** :ref:`int<class_int>` idx, :ref:`DynamicFontData<class_dynamicfontdata>` data **)**
  74. Sets the fallback font at index ``idx``.