class_fontdata.rst 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the FontData.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_FontData:
  6. FontData
  7. ========
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Font source data and prerendered glyph cache, imported from dynamic or bitmap font.
  10. Supported font formats:
  11. - Dynamic font importer: TrueType (.ttf), OpenType (.otf), WOFF (.woff), Type 1 (.pfb, .pfm).
  12. - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants.
  13. - Monospace image font importer: All supported image formats.
  14. Properties
  15. ----------
  16. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`antialiased<class_FontData_property_antialiased>` | ``true`` |
  18. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  19. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_FontData_property_data>` | ``PackedByteArray()`` |
  20. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  21. | :ref:`float<class_float>` | :ref:`embolden<class_FontData_property_embolden>` | ``0.0`` |
  22. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  23. | :ref:`int<class_int>` | :ref:`fixed_size<class_FontData_property_fixed_size>` | ``0`` |
  24. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  25. | :ref:`String<class_String>` | :ref:`font_name<class_FontData_property_font_name>` | ``""`` |
  26. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  27. | :ref:`int<class_int>` | :ref:`font_style<class_FontData_property_font_style>` | ``0`` |
  28. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`force_autohinter<class_FontData_property_force_autohinter>` | ``false`` |
  30. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  31. | :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_FontData_property_hinting>` | ``1`` |
  32. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  33. | :ref:`int<class_int>` | :ref:`msdf_pixel_range<class_FontData_property_msdf_pixel_range>` | ``16`` |
  34. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  35. | :ref:`int<class_int>` | :ref:`msdf_size<class_FontData_property_msdf_size>` | ``48`` |
  36. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`multichannel_signed_distance_field<class_FontData_property_multichannel_signed_distance_field>` | ``false`` |
  38. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  39. | :ref:`Dictionary<class_Dictionary>` | :ref:`opentype_feature_overrides<class_FontData_property_opentype_feature_overrides>` | ``{}`` |
  40. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  41. | :ref:`float<class_float>` | :ref:`oversampling<class_FontData_property_oversampling>` | ``0.0`` |
  42. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  43. | :ref:`String<class_String>` | :ref:`style_name<class_FontData_property_style_name>` | ``""`` |
  44. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  45. | :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_FontData_property_subpixel_positioning>` | ``1`` |
  46. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  47. | :ref:`Transform2D<class_Transform2D>` | :ref:`transform<class_FontData_property_transform>` | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  48. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------------------+
  49. Methods
  50. -------
  51. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`clear_cache<class_FontData_method_clear_cache>` **(** **)** |
  53. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`clear_glyphs<class_FontData_method_clear_glyphs>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  55. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | void | :ref:`clear_kerning_map<class_FontData_method_clear_kerning_map>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |
  57. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | void | :ref:`clear_size_cache<class_FontData_method_clear_size_cache>` **(** :ref:`int<class_int>` cache_index **)** |
  59. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`clear_textures<class_FontData_method_clear_textures>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  61. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`RID<class_RID>` | :ref:`find_cache<class_FontData_method_find_cache>` **(** :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |const| |
  63. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`float<class_float>` | :ref:`get_ascent<class_FontData_method_get_ascent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  65. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_cache_count<class_FontData_method_get_cache_count>` **(** **)** |const| |
  67. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`RID<class_RID>` | :ref:`get_cache_rid<class_FontData_method_get_cache_rid>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  69. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`float<class_float>` | :ref:`get_descent<class_FontData_method_get_descent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  71. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_advance<class_FontData_method_get_glyph_advance>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph **)** |const| |
  73. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_glyph_index<class_FontData_method_get_glyph_index>` **(** :ref:`int<class_int>` size, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector **)** |const| |
  75. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Array<class_Array>` | :ref:`get_glyph_list<class_FontData_method_get_glyph_list>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const| |
  77. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_offset<class_FontData_method_get_glyph_offset>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
  79. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_size<class_FontData_method_get_glyph_size>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
  81. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_glyph_texture_idx<class_FontData_method_get_glyph_texture_idx>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
  83. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Rect2<class_Rect2>` | :ref:`get_glyph_uv_rect<class_FontData_method_get_glyph_uv_rect>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const| |
  85. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`Vector2<class_Vector2>` | :ref:`get_kerning<class_FontData_method_get_kerning>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |const| |
  87. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Array<class_Array>` | :ref:`get_kerning_list<class_FontData_method_get_kerning_list>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  89. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`bool<class_bool>` | :ref:`get_language_support_override<class_FontData_method_get_language_support_override>` **(** :ref:`String<class_String>` language **)** |const| |
  91. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_language_support_overrides<class_FontData_method_get_language_support_overrides>` **(** **)** |const| |
  93. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`float<class_float>` | :ref:`get_scale<class_FontData_method_get_scale>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  95. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`bool<class_bool>` | :ref:`get_script_support_override<class_FontData_method_get_script_support_override>` **(** :ref:`String<class_String>` script **)** |const| |
  97. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_script_support_overrides<class_FontData_method_get_script_support_overrides>` **(** **)** |const| |
  99. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Array<class_Array>` | :ref:`get_size_cache_list<class_FontData_method_get_size_cache_list>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  101. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`int<class_int>` | :ref:`get_spacing<class_FontData_method_get_spacing>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`SpacingType<enum_TextServer_SpacingType>` spacing_type **)** |const| |
  103. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`String<class_String>` | :ref:`get_supported_chars<class_FontData_method_get_supported_chars>` **(** **)** |const| |
  105. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_supported_feature_list<class_FontData_method_get_supported_feature_list>` **(** **)** |const| |
  107. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_supported_variation_list<class_FontData_method_get_supported_variation_list>` **(** **)** |const| |
  109. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | :ref:`int<class_int>` | :ref:`get_texture_count<class_FontData_method_get_texture_count>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const| |
  111. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | :ref:`Image<class_Image>` | :ref:`get_texture_image<class_FontData_method_get_texture_image>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const| |
  113. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_texture_offsets<class_FontData_method_get_texture_offsets>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const| |
  115. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | :ref:`float<class_float>` | :ref:`get_underline_position<class_FontData_method_get_underline_position>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  117. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | :ref:`float<class_float>` | :ref:`get_underline_thickness<class_FontData_method_get_underline_thickness>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  119. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_variation_coordinates<class_FontData_method_get_variation_coordinates>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  121. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | :ref:`bool<class_bool>` | :ref:`has_char<class_FontData_method_has_char>` **(** :ref:`int<class_int>` char **)** |const| |
  123. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | :ref:`bool<class_bool>` | :ref:`is_language_supported<class_FontData_method_is_language_supported>` **(** :ref:`String<class_String>` language **)** |const| |
  125. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | :ref:`bool<class_bool>` | :ref:`is_script_supported<class_FontData_method_is_script_supported>` **(** :ref:`String<class_String>` script **)** |const| |
  127. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bitmap_font<class_FontData_method_load_bitmap_font>` **(** :ref:`String<class_String>` path **)** |
  129. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dynamic_font<class_FontData_method_load_dynamic_font>` **(** :ref:`String<class_String>` path **)** |
  131. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | void | :ref:`remove_cache<class_FontData_method_remove_cache>` **(** :ref:`int<class_int>` cache_index **)** |
  133. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | void | :ref:`remove_glyph<class_FontData_method_remove_glyph>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |
  135. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | void | :ref:`remove_kerning<class_FontData_method_remove_kerning>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |
  137. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | void | :ref:`remove_language_support_override<class_FontData_method_remove_language_support_override>` **(** :ref:`String<class_String>` language **)** |
  139. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | void | :ref:`remove_script_support_override<class_FontData_method_remove_script_support_override>` **(** :ref:`String<class_String>` script **)** |
  141. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | void | :ref:`remove_size_cache<class_FontData_method_remove_size_cache>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  143. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. | void | :ref:`remove_texture<class_FontData_method_remove_texture>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |
  145. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  146. | void | :ref:`render_glyph<class_FontData_method_render_glyph>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` index **)** |
  147. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  148. | void | :ref:`render_range<class_FontData_method_render_range>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)** |
  149. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  150. | void | :ref:`set_ascent<class_FontData_method_set_ascent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` ascent **)** |
  151. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  152. | void | :ref:`set_descent<class_FontData_method_set_descent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` descent **)** |
  153. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  154. | void | :ref:`set_glyph_advance<class_FontData_method_set_glyph_advance>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` advance **)** |
  155. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  156. | void | :ref:`set_glyph_offset<class_FontData_method_set_glyph_offset>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` offset **)** |
  157. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  158. | void | :ref:`set_glyph_size<class_FontData_method_set_glyph_size>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` gl_size **)** |
  159. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  160. | void | :ref:`set_glyph_texture_idx<class_FontData_method_set_glyph_texture_idx>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`int<class_int>` texture_idx **)** |
  161. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  162. | void | :ref:`set_glyph_uv_rect<class_FontData_method_set_glyph_uv_rect>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Rect2<class_Rect2>` uv_rect **)** |
  163. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  164. | void | :ref:`set_kerning<class_FontData_method_set_kerning>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair, :ref:`Vector2<class_Vector2>` kerning **)** |
  165. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  166. | void | :ref:`set_language_support_override<class_FontData_method_set_language_support_override>` **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)** |
  167. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  168. | void | :ref:`set_scale<class_FontData_method_set_scale>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` scale **)** |
  169. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  170. | void | :ref:`set_script_support_override<class_FontData_method_set_script_support_override>` **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)** |
  171. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  172. | void | :ref:`set_spacing<class_FontData_method_set_spacing>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`SpacingType<enum_TextServer_SpacingType>` spacing_type, :ref:`int<class_int>` value **)** |
  173. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  174. | void | :ref:`set_texture_image<class_FontData_method_set_texture_image>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`Image<class_Image>` image **)** |
  175. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  176. | void | :ref:`set_texture_offsets<class_FontData_method_set_texture_offsets>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`PackedInt32Array<class_PackedInt32Array>` offset **)** |
  177. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  178. | void | :ref:`set_underline_position<class_FontData_method_set_underline_position>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_position **)** |
  179. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  180. | void | :ref:`set_underline_thickness<class_FontData_method_set_underline_thickness>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_thickness **)** |
  181. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  182. | void | :ref:`set_variation_coordinates<class_FontData_method_set_variation_coordinates>` **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |
  183. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  184. Property Descriptions
  185. ---------------------
  186. .. _class_FontData_property_antialiased:
  187. - :ref:`bool<class_bool>` **antialiased**
  188. +-----------+------------------------+
  189. | *Default* | ``true`` |
  190. +-----------+------------------------+
  191. | *Setter* | set_antialiased(value) |
  192. +-----------+------------------------+
  193. | *Getter* | is_antialiased() |
  194. +-----------+------------------------+
  195. If set to ``true``, font 8-bit anitialiased glyph rendering is supported and enabled.
  196. ----
  197. .. _class_FontData_property_data:
  198. - :ref:`PackedByteArray<class_PackedByteArray>` **data**
  199. +-----------+-----------------------+
  200. | *Default* | ``PackedByteArray()`` |
  201. +-----------+-----------------------+
  202. | *Setter* | set_data(value) |
  203. +-----------+-----------------------+
  204. | *Getter* | get_data() |
  205. +-----------+-----------------------+
  206. Contents of the dynamic font source file.
  207. ----
  208. .. _class_FontData_property_embolden:
  209. - :ref:`float<class_float>` **embolden**
  210. +-----------+---------------------+
  211. | *Default* | ``0.0`` |
  212. +-----------+---------------------+
  213. | *Setter* | set_embolden(value) |
  214. +-----------+---------------------+
  215. | *Getter* | get_embolden() |
  216. +-----------+---------------------+
  217. If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  218. ----
  219. .. _class_FontData_property_fixed_size:
  220. - :ref:`int<class_int>` **fixed_size**
  221. +-----------+-----------------------+
  222. | *Default* | ``0`` |
  223. +-----------+-----------------------+
  224. | *Setter* | set_fixed_size(value) |
  225. +-----------+-----------------------+
  226. | *Getter* | get_fixed_size() |
  227. +-----------+-----------------------+
  228. Font size, used only for the bitmap fonts.
  229. ----
  230. .. _class_FontData_property_font_name:
  231. - :ref:`String<class_String>` **font_name**
  232. +-----------+----------------------+
  233. | *Default* | ``""`` |
  234. +-----------+----------------------+
  235. | *Setter* | set_font_name(value) |
  236. +-----------+----------------------+
  237. | *Getter* | get_font_name() |
  238. +-----------+----------------------+
  239. Font family name.
  240. ----
  241. .. _class_FontData_property_font_style:
  242. - :ref:`int<class_int>` **font_style**
  243. +-----------+-----------------------+
  244. | *Default* | ``0`` |
  245. +-----------+-----------------------+
  246. | *Setter* | set_font_style(value) |
  247. +-----------+-----------------------+
  248. | *Getter* | get_font_style() |
  249. +-----------+-----------------------+
  250. Font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
  251. ----
  252. .. _class_FontData_property_force_autohinter:
  253. - :ref:`bool<class_bool>` **force_autohinter**
  254. +-----------+-----------------------------+
  255. | *Default* | ``false`` |
  256. +-----------+-----------------------------+
  257. | *Setter* | set_force_autohinter(value) |
  258. +-----------+-----------------------------+
  259. | *Getter* | is_force_autohinter() |
  260. +-----------+-----------------------------+
  261. If set to ``true``, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only.
  262. ----
  263. .. _class_FontData_property_hinting:
  264. - :ref:`Hinting<enum_TextServer_Hinting>` **hinting**
  265. +-----------+--------------------+
  266. | *Default* | ``1`` |
  267. +-----------+--------------------+
  268. | *Setter* | set_hinting(value) |
  269. +-----------+--------------------+
  270. | *Getter* | get_hinting() |
  271. +-----------+--------------------+
  272. Font hinting mode. Used by dynamic fonts only.
  273. ----
  274. .. _class_FontData_property_msdf_pixel_range:
  275. - :ref:`int<class_int>` **msdf_pixel_range**
  276. +-----------+-----------------------------+
  277. | *Default* | ``16`` |
  278. +-----------+-----------------------------+
  279. | *Setter* | set_msdf_pixel_range(value) |
  280. +-----------+-----------------------------+
  281. | *Getter* | get_msdf_pixel_range() |
  282. +-----------+-----------------------------+
  283. The width of the range around the shape between the minimum and maximum representable signed distance.
  284. ----
  285. .. _class_FontData_property_msdf_size:
  286. - :ref:`int<class_int>` **msdf_size**
  287. +-----------+----------------------+
  288. | *Default* | ``48`` |
  289. +-----------+----------------------+
  290. | *Setter* | set_msdf_size(value) |
  291. +-----------+----------------------+
  292. | *Getter* | get_msdf_size() |
  293. +-----------+----------------------+
  294. Source font size used to generate MSDF textures.
  295. ----
  296. .. _class_FontData_property_multichannel_signed_distance_field:
  297. - :ref:`bool<class_bool>` **multichannel_signed_distance_field**
  298. +-----------+-----------------------------------------------+
  299. | *Default* | ``false`` |
  300. +-----------+-----------------------------------------------+
  301. | *Setter* | set_multichannel_signed_distance_field(value) |
  302. +-----------+-----------------------------------------------+
  303. | *Getter* | is_multichannel_signed_distance_field() |
  304. +-----------+-----------------------------------------------+
  305. If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
  306. ----
  307. .. _class_FontData_property_opentype_feature_overrides:
  308. - :ref:`Dictionary<class_Dictionary>` **opentype_feature_overrides**
  309. +-----------+---------------------------------------+
  310. | *Default* | ``{}`` |
  311. +-----------+---------------------------------------+
  312. | *Setter* | set_opentype_feature_overrides(value) |
  313. +-----------+---------------------------------------+
  314. | *Getter* | get_opentype_feature_overrides() |
  315. +-----------+---------------------------------------+
  316. Font OpenType feature set override.
  317. ----
  318. .. _class_FontData_property_oversampling:
  319. - :ref:`float<class_float>` **oversampling**
  320. +-----------+-------------------------+
  321. | *Default* | ``0.0`` |
  322. +-----------+-------------------------+
  323. | *Setter* | set_oversampling(value) |
  324. +-----------+-------------------------+
  325. | *Getter* | get_oversampling() |
  326. +-----------+-------------------------+
  327. Font oversampling factor, if set to ``0.0`` global oversampling factor is used instead. Used by dynamic fonts only.
  328. ----
  329. .. _class_FontData_property_style_name:
  330. - :ref:`String<class_String>` **style_name**
  331. +-----------+----------------------------+
  332. | *Default* | ``""`` |
  333. +-----------+----------------------------+
  334. | *Setter* | set_font_style_name(value) |
  335. +-----------+----------------------------+
  336. | *Getter* | get_font_style_name() |
  337. +-----------+----------------------------+
  338. Font style name.
  339. ----
  340. .. _class_FontData_property_subpixel_positioning:
  341. - :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning**
  342. +-----------+---------------------------------+
  343. | *Default* | ``1`` |
  344. +-----------+---------------------------------+
  345. | *Setter* | set_subpixel_positioning(value) |
  346. +-----------+---------------------------------+
  347. | *Getter* | get_subpixel_positioning() |
  348. +-----------+---------------------------------+
  349. Font glyph sub-pixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO<class_TextServer_constant_SUBPIXEL_POSITIONING_AUTO>` to automatically enable it based on the font size.
  350. ----
  351. .. _class_FontData_property_transform:
  352. - :ref:`Transform2D<class_Transform2D>` **transform**
  353. +-----------+-----------------------------------+
  354. | *Default* | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  355. +-----------+-----------------------------------+
  356. | *Setter* | set_transform(value) |
  357. +-----------+-----------------------------------+
  358. | *Getter* | get_transform() |
  359. +-----------+-----------------------------------+
  360. 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
  361. For example, to simulate italic typeface by slanting, apply the following transform ``Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)``.
  362. Method Descriptions
  363. -------------------
  364. .. _class_FontData_method_clear_cache:
  365. - void **clear_cache** **(** **)**
  366. Removes all font cache entries.
  367. ----
  368. .. _class_FontData_method_clear_glyphs:
  369. - void **clear_glyphs** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  370. Removes all rendered glyphs information from the cache entry.
  371. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontData_method_remove_texture>` to remove them manually.
  372. ----
  373. .. _class_FontData_method_clear_kerning_map:
  374. - void **clear_kerning_map** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)**
  375. Removes all kerning overrides.
  376. ----
  377. .. _class_FontData_method_clear_size_cache:
  378. - void **clear_size_cache** **(** :ref:`int<class_int>` cache_index **)**
  379. Removes all font sizes from the cache entry
  380. ----
  381. .. _class_FontData_method_clear_textures:
  382. - void **clear_textures** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  383. Removes all textures from font cache entry.
  384. \ **Note:** This function will not remove glyphs associated with the texture, use :ref:`remove_glyph<class_FontData_method_remove_glyph>` to remove them manually.
  385. ----
  386. .. _class_FontData_method_find_cache:
  387. - :ref:`RID<class_RID>` **find_cache** **(** :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |const|
  388. Returns existing or creates a new font cache entry for the specified variation coordinates.
  389. ----
  390. .. _class_FontData_method_get_ascent:
  391. - :ref:`float<class_float>` **get_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  392. Returns the font ascent (number of pixels above the baseline).
  393. ----
  394. .. _class_FontData_method_get_cache_count:
  395. - :ref:`int<class_int>` **get_cache_count** **(** **)** |const|
  396. Returns number of the font cache entries.
  397. ----
  398. .. _class_FontData_method_get_cache_rid:
  399. - :ref:`RID<class_RID>` **get_cache_rid** **(** :ref:`int<class_int>` cache_index **)** |const|
  400. Returns text server font cache entry resource id.
  401. ----
  402. .. _class_FontData_method_get_descent:
  403. - :ref:`float<class_float>` **get_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  404. Returns font descent (number of pixels below the baseline).
  405. ----
  406. .. _class_FontData_method_get_glyph_advance:
  407. - :ref:`Vector2<class_Vector2>` **get_glyph_advance** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph **)** |const|
  408. Returns glyph advance (offset of the next glyph).
  409. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  410. ----
  411. .. _class_FontData_method_get_glyph_index:
  412. - :ref:`int<class_int>` **get_glyph_index** **(** :ref:`int<class_int>` size, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector **)** |const|
  413. Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
  414. ----
  415. .. _class_FontData_method_get_glyph_list:
  416. - :ref:`Array<class_Array>` **get_glyph_list** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
  417. Returns list of rendered glyphs in the cache entry.
  418. ----
  419. .. _class_FontData_method_get_glyph_offset:
  420. - :ref:`Vector2<class_Vector2>` **get_glyph_offset** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  421. Returns glyph offset from the baseline.
  422. ----
  423. .. _class_FontData_method_get_glyph_size:
  424. - :ref:`Vector2<class_Vector2>` **get_glyph_size** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  425. Returns glyph size.
  426. ----
  427. .. _class_FontData_method_get_glyph_texture_idx:
  428. - :ref:`int<class_int>` **get_glyph_texture_idx** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  429. Returns index of the cache texture containing the glyph.
  430. ----
  431. .. _class_FontData_method_get_glyph_uv_rect:
  432. - :ref:`Rect2<class_Rect2>` **get_glyph_uv_rect** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  433. Returns rectangle in the cache texture containing the glyph.
  434. ----
  435. .. _class_FontData_method_get_kerning:
  436. - :ref:`Vector2<class_Vector2>` **get_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |const|
  437. Returns kerning for the pair of glyphs.
  438. ----
  439. .. _class_FontData_method_get_kerning_list:
  440. - :ref:`Array<class_Array>` **get_kerning_list** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  441. Returns list of the kerning overrides.
  442. ----
  443. .. _class_FontData_method_get_language_support_override:
  444. - :ref:`bool<class_bool>` **get_language_support_override** **(** :ref:`String<class_String>` language **)** |const|
  445. Returns ``true`` if support override is enabled for the ``language``.
  446. ----
  447. .. _class_FontData_method_get_language_support_overrides:
  448. - :ref:`PackedStringArray<class_PackedStringArray>` **get_language_support_overrides** **(** **)** |const|
  449. Returns list of language support overrides.
  450. ----
  451. .. _class_FontData_method_get_scale:
  452. - :ref:`float<class_float>` **get_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  453. Returns scaling factor of the color bitmap font.
  454. ----
  455. .. _class_FontData_method_get_script_support_override:
  456. - :ref:`bool<class_bool>` **get_script_support_override** **(** :ref:`String<class_String>` script **)** |const|
  457. Returns ``true`` if support override is enabled for the ``script``.
  458. ----
  459. .. _class_FontData_method_get_script_support_overrides:
  460. - :ref:`PackedStringArray<class_PackedStringArray>` **get_script_support_overrides** **(** **)** |const|
  461. Returns list of script support overrides.
  462. ----
  463. .. _class_FontData_method_get_size_cache_list:
  464. - :ref:`Array<class_Array>` **get_size_cache_list** **(** :ref:`int<class_int>` cache_index **)** |const|
  465. Returns list of the font sizes in the cache. Each size is ``Vector2i`` with font size and outline size.
  466. ----
  467. .. _class_FontData_method_get_spacing:
  468. - :ref:`int<class_int>` **get_spacing** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`SpacingType<enum_TextServer_SpacingType>` spacing_type **)** |const|
  469. Returns extra spacing added between glyphs in pixels.
  470. ----
  471. .. _class_FontData_method_get_supported_chars:
  472. - :ref:`String<class_String>` **get_supported_chars** **(** **)** |const|
  473. Returns a string containing all the characters available in the font.
  474. ----
  475. .. _class_FontData_method_get_supported_feature_list:
  476. - :ref:`Dictionary<class_Dictionary>` **get_supported_feature_list** **(** **)** |const|
  477. Returns list of OpenType features supported by font.
  478. ----
  479. .. _class_FontData_method_get_supported_variation_list:
  480. - :ref:`Dictionary<class_Dictionary>` **get_supported_variation_list** **(** **)** |const|
  481. Returns list of supported `variation coordinates <https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg>`__, each coordinate is returned as ``tag: Vector3i(min_value,max_value,default_value)``.
  482. Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
  483. ----
  484. .. _class_FontData_method_get_texture_count:
  485. - :ref:`int<class_int>` **get_texture_count** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
  486. Returns number of textures used by font cache entry.
  487. ----
  488. .. _class_FontData_method_get_texture_image:
  489. - :ref:`Image<class_Image>` **get_texture_image** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const|
  490. Returns a copy of the font cache texture image.
  491. ----
  492. .. _class_FontData_method_get_texture_offsets:
  493. - :ref:`PackedInt32Array<class_PackedInt32Array>` **get_texture_offsets** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)** |const|
  494. Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty.
  495. ----
  496. .. _class_FontData_method_get_underline_position:
  497. - :ref:`float<class_float>` **get_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  498. Returns pixel offset of the underline below the baseline.
  499. ----
  500. .. _class_FontData_method_get_underline_thickness:
  501. - :ref:`float<class_float>` **get_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  502. Returns thickness of the underline in pixels.
  503. ----
  504. .. _class_FontData_method_get_variation_coordinates:
  505. - :ref:`Dictionary<class_Dictionary>` **get_variation_coordinates** **(** :ref:`int<class_int>` cache_index **)** |const|
  506. Returns variation coordinates for the specified font cache entry. See :ref:`get_supported_variation_list<class_FontData_method_get_supported_variation_list>` for more info.
  507. ----
  508. .. _class_FontData_method_has_char:
  509. - :ref:`bool<class_bool>` **has_char** **(** :ref:`int<class_int>` char **)** |const|
  510. Returns ``true`` if a Unicode ``char`` is available in the font.
  511. ----
  512. .. _class_FontData_method_is_language_supported:
  513. - :ref:`bool<class_bool>` **is_language_supported** **(** :ref:`String<class_String>` language **)** |const|
  514. Returns ``true``, if font supports given language (`ISO 639 <https://en.wikipedia.org/wiki/ISO_639-1>`__ code).
  515. ----
  516. .. _class_FontData_method_is_script_supported:
  517. - :ref:`bool<class_bool>` **is_script_supported** **(** :ref:`String<class_String>` script **)** |const|
  518. Returns ``true``, if font supports given script (`ISO 15924 <https://en.wikipedia.org/wiki/ISO_15924>`__ code).
  519. ----
  520. .. _class_FontData_method_load_bitmap_font:
  521. - :ref:`Error<enum_@GlobalScope_Error>` **load_bitmap_font** **(** :ref:`String<class_String>` path **)**
  522. Loads an AngelCode BMFont (.fnt, .font) bitmap font from file ``path``.
  523. \ **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the ``user://`` directory.
  524. ----
  525. .. _class_FontData_method_load_dynamic_font:
  526. - :ref:`Error<enum_@GlobalScope_Error>` **load_dynamic_font** **(** :ref:`String<class_String>` path **)**
  527. Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff) or Type 1 (.pfb, .pfm) dynamic font from file ``path``.
  528. \ **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the ``user://`` directory.
  529. ----
  530. .. _class_FontData_method_remove_cache:
  531. - void **remove_cache** **(** :ref:`int<class_int>` cache_index **)**
  532. Removes specified font cache entry.
  533. ----
  534. .. _class_FontData_method_remove_glyph:
  535. - void **remove_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)**
  536. Removes specified rendered glyph information from the cache entry.
  537. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontData_method_remove_texture>` to remove them manually.
  538. ----
  539. .. _class_FontData_method_remove_kerning:
  540. - void **remove_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)**
  541. Removes kerning override for the pair of glyphs.
  542. ----
  543. .. _class_FontData_method_remove_language_support_override:
  544. - void **remove_language_support_override** **(** :ref:`String<class_String>` language **)**
  545. Remove language support override.
  546. ----
  547. .. _class_FontData_method_remove_script_support_override:
  548. - void **remove_script_support_override** **(** :ref:`String<class_String>` script **)**
  549. Removes script support override.
  550. ----
  551. .. _class_FontData_method_remove_size_cache:
  552. - void **remove_size_cache** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  553. Removes specified font size from the cache entry.
  554. ----
  555. .. _class_FontData_method_remove_texture:
  556. - void **remove_texture** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)**
  557. Removes specified texture from font cache entry.
  558. \ **Note:** This function will not remove glyphs associated with the texture, remove them manually, using :ref:`remove_glyph<class_FontData_method_remove_glyph>`.
  559. ----
  560. .. _class_FontData_method_render_glyph:
  561. - void **render_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` index **)**
  562. Renders specified glyph the the font cache texture.
  563. ----
  564. .. _class_FontData_method_render_range:
  565. - void **render_range** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)**
  566. Renders the range of characters to the font cache texture.
  567. ----
  568. .. _class_FontData_method_set_ascent:
  569. - void **set_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` ascent **)**
  570. Sets the font ascent (number of pixels above the baseline).
  571. ----
  572. .. _class_FontData_method_set_descent:
  573. - void **set_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` descent **)**
  574. Sets the font descent (number of pixels below the baseline).
  575. ----
  576. .. _class_FontData_method_set_glyph_advance:
  577. - void **set_glyph_advance** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` advance **)**
  578. Sets glyph advance (offset of the next glyph).
  579. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  580. ----
  581. .. _class_FontData_method_set_glyph_offset:
  582. - void **set_glyph_offset** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` offset **)**
  583. Sets glyph offset from the baseline.
  584. ----
  585. .. _class_FontData_method_set_glyph_size:
  586. - void **set_glyph_size** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Vector2<class_Vector2>` gl_size **)**
  587. Sets glyph size.
  588. ----
  589. .. _class_FontData_method_set_glyph_texture_idx:
  590. - void **set_glyph_texture_idx** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`int<class_int>` texture_idx **)**
  591. Sets index of the cache texture containing the glyph.
  592. ----
  593. .. _class_FontData_method_set_glyph_uv_rect:
  594. - void **set_glyph_uv_rect** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph, :ref:`Rect2<class_Rect2>` uv_rect **)**
  595. Sets rectangle in the cache texture containing the glyph.
  596. ----
  597. .. _class_FontData_method_set_kerning:
  598. - void **set_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair, :ref:`Vector2<class_Vector2>` kerning **)**
  599. Sets kerning for the pair of glyphs.
  600. ----
  601. .. _class_FontData_method_set_language_support_override:
  602. - void **set_language_support_override** **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)**
  603. Adds override for :ref:`is_language_supported<class_FontData_method_is_language_supported>`.
  604. ----
  605. .. _class_FontData_method_set_scale:
  606. - void **set_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` scale **)**
  607. Sets scaling factor of the color bitmap font.
  608. ----
  609. .. _class_FontData_method_set_script_support_override:
  610. - void **set_script_support_override** **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)**
  611. Adds override for :ref:`is_script_supported<class_FontData_method_is_script_supported>`.
  612. ----
  613. .. _class_FontData_method_set_spacing:
  614. - void **set_spacing** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`SpacingType<enum_TextServer_SpacingType>` spacing_type, :ref:`int<class_int>` value **)**
  615. Sets extra spacing added between glyphs in pixels.
  616. ----
  617. .. _class_FontData_method_set_texture_image:
  618. - void **set_texture_image** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`Image<class_Image>` image **)**
  619. Sets font cache texture image.
  620. ----
  621. .. _class_FontData_method_set_texture_offsets:
  622. - void **set_texture_offsets** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index, :ref:`PackedInt32Array<class_PackedInt32Array>` offset **)**
  623. Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support).
  624. ----
  625. .. _class_FontData_method_set_underline_position:
  626. - void **set_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_position **)**
  627. Sets pixel offset of the underline below the baseline.
  628. ----
  629. .. _class_FontData_method_set_underline_thickness:
  630. - void **set_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_thickness **)**
  631. Sets thickness of the underline in pixels.
  632. ----
  633. .. _class_FontData_method_set_variation_coordinates:
  634. - void **set_variation_coordinates** **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)**
  635. Sets variation coordinates for the specified font cache entry. See :ref:`get_supported_variation_list<class_FontData_method_get_supported_variation_list>` for more info.
  636. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  637. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  638. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  639. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  640. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  641. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`