class_fontdata.rst 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  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. Methods
  15. -------
  16. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`clear_cache<class_FontData_method_clear_cache>` **(** **)** |
  18. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`clear_glyphs<class_FontData_method_clear_glyphs>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  20. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`clear_kerning_map<class_FontData_method_clear_kerning_map>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |
  22. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`clear_size_cache<class_FontData_method_clear_size_cache>` **(** :ref:`int<class_int>` cache_index **)** |
  24. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`clear_textures<class_FontData_method_clear_textures>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  26. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`RID<class_RID>` | :ref:`find_cache<class_FontData_method_find_cache>` **(** :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |const| |
  28. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`get_ascent<class_FontData_method_get_ascent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  30. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_cache_count<class_FontData_method_get_cache_count>` **(** **)** |const| |
  32. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`RID<class_RID>` | :ref:`get_cache_rid<class_FontData_method_get_cache_rid>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  34. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`get_data<class_FontData_method_get_data>` **(** **)** |const| |
  36. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`float<class_float>` | :ref:`get_descent<class_FontData_method_get_descent>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  38. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`String<class_String>` | :ref:`get_font_name<class_FontData_method_get_font_name>` **(** **)** |const| |
  40. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`int<class_int>` | :ref:`get_font_style<class_FontData_method_get_font_style>` **(** **)** |const| |
  42. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`String<class_String>` | :ref:`get_font_style_name<class_FontData_method_get_font_style_name>` **(** **)** |const| |
  44. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :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| |
  46. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :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| |
  48. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :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| |
  50. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :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| |
  52. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :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| |
  54. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :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| |
  56. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :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| |
  58. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`get_hinting<class_FontData_method_get_hinting>` **(** **)** |const| |
  60. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :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| |
  62. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :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| |
  64. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`get_language_support_override<class_FontData_method_get_language_support_override>` **(** :ref:`String<class_String>` language **)** |const| |
  66. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_language_support_overrides<class_FontData_method_get_language_support_overrides>` **(** **)** |const| |
  68. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_msdf_pixel_range<class_FontData_method_get_msdf_pixel_range>` **(** **)** |const| |
  70. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`get_msdf_size<class_FontData_method_get_msdf_size>` **(** **)** |const| |
  72. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`float<class_float>` | :ref:`get_oversampling<class_FontData_method_get_oversampling>` **(** **)** |const| |
  74. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`float<class_float>` | :ref:`get_scale<class_FontData_method_get_scale>` **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const| |
  76. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`bool<class_bool>` | :ref:`get_script_support_override<class_FontData_method_get_script_support_override>` **(** :ref:`String<class_String>` script **)** |const| |
  78. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_script_support_overrides<class_FontData_method_get_script_support_overrides>` **(** **)** |const| |
  80. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`Array<class_Array>` | :ref:`get_size_cache_list<class_FontData_method_get_size_cache_list>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  82. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :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| |
  84. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`String<class_String>` | :ref:`get_supported_chars<class_FontData_method_get_supported_chars>` **(** **)** |const| |
  86. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_supported_feature_list<class_FontData_method_get_supported_feature_list>` **(** **)** |const| |
  88. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_supported_variation_list<class_FontData_method_get_supported_variation_list>` **(** **)** |const| |
  90. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :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| |
  92. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :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| |
  94. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :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| |
  96. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :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| |
  98. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :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| |
  100. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_variation_coordinates<class_FontData_method_get_variation_coordinates>` **(** :ref:`int<class_int>` cache_index **)** |const| |
  102. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`bool<class_bool>` | :ref:`has_char<class_FontData_method_has_char>` **(** :ref:`int<class_int>` char **)** |const| |
  104. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`bool<class_bool>` | :ref:`is_antialiased<class_FontData_method_is_antialiased>` **(** **)** |const| |
  106. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`bool<class_bool>` | :ref:`is_force_autohinter<class_FontData_method_is_force_autohinter>` **(** **)** |const| |
  108. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`bool<class_bool>` | :ref:`is_language_supported<class_FontData_method_is_language_supported>` **(** :ref:`String<class_String>` language **)** |const| |
  110. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`is_multichannel_signed_distance_field<class_FontData_method_is_multichannel_signed_distance_field>` **(** **)** |const| |
  112. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`bool<class_bool>` | :ref:`is_script_supported<class_FontData_method_is_script_supported>` **(** :ref:`String<class_String>` script **)** |const| |
  114. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | void | :ref:`remove_cache<class_FontData_method_remove_cache>` **(** :ref:`int<class_int>` cache_index **)** |
  116. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | 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 **)** |
  118. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | 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 **)** |
  120. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`remove_language_support_override<class_FontData_method_remove_language_support_override>` **(** :ref:`String<class_String>` language **)** |
  122. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | void | :ref:`remove_script_support_override<class_FontData_method_remove_script_support_override>` **(** :ref:`String<class_String>` script **)** |
  124. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`remove_size_cache<class_FontData_method_remove_size_cache>` **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |
  126. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | 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 **)** |
  128. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | 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 **)** |
  130. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | 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 **)** |
  132. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`set_antialiased<class_FontData_method_set_antialiased>` **(** :ref:`bool<class_bool>` antialiased **)** |
  134. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | 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 **)** |
  136. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`set_data<class_FontData_method_set_data>` **(** :ref:`PackedByteArray<class_PackedByteArray>` data **)** |
  138. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | 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 **)** |
  140. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`set_font_name<class_FontData_method_set_font_name>` **(** :ref:`String<class_String>` name **)** |
  142. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`set_font_style<class_FontData_method_set_font_style>` **(** :ref:`int<class_int>` style **)** |
  144. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`set_font_style_name<class_FontData_method_set_font_style_name>` **(** :ref:`String<class_String>` name **)** |
  146. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | void | :ref:`set_force_autohinter<class_FontData_method_set_force_autohinter>` **(** :ref:`bool<class_bool>` force_autohinter **)** |
  148. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | 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 **)** |
  150. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | 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 **)** |
  152. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | 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 **)** |
  154. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | 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 **)** |
  156. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | 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 **)** |
  158. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | void | :ref:`set_hinting<class_FontData_method_set_hinting>` **(** :ref:`Hinting<enum_TextServer_Hinting>` hinting **)** |
  160. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | 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 **)** |
  162. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | void | :ref:`set_language_support_override<class_FontData_method_set_language_support_override>` **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)** |
  164. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | void | :ref:`set_msdf_pixel_range<class_FontData_method_set_msdf_pixel_range>` **(** :ref:`int<class_int>` msdf_pixel_range **)** |
  166. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | void | :ref:`set_msdf_size<class_FontData_method_set_msdf_size>` **(** :ref:`int<class_int>` msdf_size **)** |
  168. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | void | :ref:`set_multichannel_signed_distance_field<class_FontData_method_set_multichannel_signed_distance_field>` **(** :ref:`bool<class_bool>` msdf **)** |
  170. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | void | :ref:`set_oversampling<class_FontData_method_set_oversampling>` **(** :ref:`float<class_float>` oversampling **)** |
  172. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | 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 **)** |
  174. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`set_script_support_override<class_FontData_method_set_script_support_override>` **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)** |
  176. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | 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 **)** |
  178. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | 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 **)** |
  180. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | 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 **)** |
  182. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | 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 **)** |
  184. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | 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 **)** |
  186. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | void | :ref:`set_variation_coordinates<class_FontData_method_set_variation_coordinates>` **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |
  188. +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. Method Descriptions
  190. -------------------
  191. .. _class_FontData_method_clear_cache:
  192. - void **clear_cache** **(** **)**
  193. Removes all font cache entries.
  194. ----
  195. .. _class_FontData_method_clear_glyphs:
  196. - void **clear_glyphs** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  197. Removes all rendered glyphs information from the cache entry.
  198. **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontData_method_remove_texture>` to remove them manually.
  199. ----
  200. .. _class_FontData_method_clear_kerning_map:
  201. - void **clear_kerning_map** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)**
  202. Removes all kerning overrides.
  203. ----
  204. .. _class_FontData_method_clear_size_cache:
  205. - void **clear_size_cache** **(** :ref:`int<class_int>` cache_index **)**
  206. Removes all font sizes from the cache entry
  207. ----
  208. .. _class_FontData_method_clear_textures:
  209. - void **clear_textures** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  210. Removes all textures from font cache entry.
  211. **Note:** This function will not remove glyphs associated with the texture, use :ref:`remove_glyph<class_FontData_method_remove_glyph>` to remove them manually.
  212. ----
  213. .. _class_FontData_method_find_cache:
  214. - :ref:`RID<class_RID>` **find_cache** **(** :ref:`Dictionary<class_Dictionary>` variation_coordinates **)** |const|
  215. Returns existing or creates a new font cache entry for the specified variation coordinates.
  216. ----
  217. .. _class_FontData_method_get_ascent:
  218. - :ref:`float<class_float>` **get_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  219. Returns the font ascent (number of pixels above the baseline).
  220. ----
  221. .. _class_FontData_method_get_cache_count:
  222. - :ref:`int<class_int>` **get_cache_count** **(** **)** |const|
  223. Returns number of the font cache entries.
  224. ----
  225. .. _class_FontData_method_get_cache_rid:
  226. - :ref:`RID<class_RID>` **get_cache_rid** **(** :ref:`int<class_int>` cache_index **)** |const|
  227. Returns text server font cache entry resource id.
  228. ----
  229. .. _class_FontData_method_get_data:
  230. - :ref:`PackedByteArray<class_PackedByteArray>` **get_data** **(** **)** |const|
  231. Returns contents of the dynamic font source file.
  232. ----
  233. .. _class_FontData_method_get_descent:
  234. - :ref:`float<class_float>` **get_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  235. Returns font descent (number of pixels below the baseline).
  236. ----
  237. .. _class_FontData_method_get_font_name:
  238. - :ref:`String<class_String>` **get_font_name** **(** **)** |const|
  239. Returns font family name.
  240. ----
  241. .. _class_FontData_method_get_font_style:
  242. - :ref:`int<class_int>` **get_font_style** **(** **)** |const|
  243. Returns font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
  244. ----
  245. .. _class_FontData_method_get_font_style_name:
  246. - :ref:`String<class_String>` **get_font_style_name** **(** **)** |const|
  247. Returns font style name.
  248. ----
  249. .. _class_FontData_method_get_glyph_advance:
  250. - :ref:`Vector2<class_Vector2>` **get_glyph_advance** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`int<class_int>` glyph **)** |const|
  251. Returns glyph advance (offset of the next glyph).
  252. **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  253. ----
  254. .. _class_FontData_method_get_glyph_index:
  255. - :ref:`int<class_int>` **get_glyph_index** **(** :ref:`int<class_int>` size, :ref:`int<class_int>` char, :ref:`int<class_int>` variation_selector **)** |const|
  256. Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
  257. ----
  258. .. _class_FontData_method_get_glyph_list:
  259. - :ref:`Array<class_Array>` **get_glyph_list** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
  260. Returns list of rendered glyphs in the cache entry.
  261. ----
  262. .. _class_FontData_method_get_glyph_offset:
  263. - :ref:`Vector2<class_Vector2>` **get_glyph_offset** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  264. Returns glyph offset from the baseline.
  265. ----
  266. .. _class_FontData_method_get_glyph_size:
  267. - :ref:`Vector2<class_Vector2>` **get_glyph_size** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)** |const|
  268. Returns glyph size.
  269. ----
  270. .. _class_FontData_method_get_glyph_texture_idx:
  271. - :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|
  272. Returns index of the cache texture containing the glyph.
  273. ----
  274. .. _class_FontData_method_get_glyph_uv_rect:
  275. - :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|
  276. Returns rectangle in the cache texture containing the glyph.
  277. ----
  278. .. _class_FontData_method_get_hinting:
  279. - :ref:`Hinting<enum_TextServer_Hinting>` **get_hinting** **(** **)** |const|
  280. Returns the font hinting mode. Used by dynamic fonts only.
  281. ----
  282. .. _class_FontData_method_get_kerning:
  283. - :ref:`Vector2<class_Vector2>` **get_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)** |const|
  284. Returns kerning for the pair of glyphs.
  285. ----
  286. .. _class_FontData_method_get_kerning_list:
  287. - :ref:`Array<class_Array>` **get_kerning_list** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  288. Returns list of the kerning overrides.
  289. ----
  290. .. _class_FontData_method_get_language_support_override:
  291. - :ref:`bool<class_bool>` **get_language_support_override** **(** :ref:`String<class_String>` language **)** |const|
  292. Returns ``true`` if support override is enabled for the ``language``.
  293. ----
  294. .. _class_FontData_method_get_language_support_overrides:
  295. - :ref:`PackedStringArray<class_PackedStringArray>` **get_language_support_overrides** **(** **)** |const|
  296. Returns list of language support overrides.
  297. ----
  298. .. _class_FontData_method_get_msdf_pixel_range:
  299. - :ref:`int<class_int>` **get_msdf_pixel_range** **(** **)** |const|
  300. Returns the width of the range around the shape between the minimum and maximum representable signed distance.
  301. ----
  302. .. _class_FontData_method_get_msdf_size:
  303. - :ref:`int<class_int>` **get_msdf_size** **(** **)** |const|
  304. Returns source font size used to generate MSDF textures.
  305. ----
  306. .. _class_FontData_method_get_oversampling:
  307. - :ref:`float<class_float>` **get_oversampling** **(** **)** |const|
  308. Returns font oversampling factor, if set to ``0.0`` global oversampling factor is used instead. Used by dynamic fonts only.
  309. ----
  310. .. _class_FontData_method_get_scale:
  311. - :ref:`float<class_float>` **get_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  312. Returns scaling factor of the color bitmap font.
  313. ----
  314. .. _class_FontData_method_get_script_support_override:
  315. - :ref:`bool<class_bool>` **get_script_support_override** **(** :ref:`String<class_String>` script **)** |const|
  316. Returns ``true`` if support override is enabled for the ``script``.
  317. ----
  318. .. _class_FontData_method_get_script_support_overrides:
  319. - :ref:`PackedStringArray<class_PackedStringArray>` **get_script_support_overrides** **(** **)** |const|
  320. Returns list of script support overrides.
  321. ----
  322. .. _class_FontData_method_get_size_cache_list:
  323. - :ref:`Array<class_Array>` **get_size_cache_list** **(** :ref:`int<class_int>` cache_index **)** |const|
  324. Return list of the font sizes in the cache. Each size is ``Vector2i`` with font size and outline size.
  325. ----
  326. .. _class_FontData_method_get_spacing:
  327. - :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|
  328. Returns extra spacing added between glyphs in pixels.
  329. ----
  330. .. _class_FontData_method_get_supported_chars:
  331. - :ref:`String<class_String>` **get_supported_chars** **(** **)** |const|
  332. Returns a string containing all the characters available in the font.
  333. ----
  334. .. _class_FontData_method_get_supported_feature_list:
  335. - :ref:`Dictionary<class_Dictionary>` **get_supported_feature_list** **(** **)** |const|
  336. Returns list of OpenType features supported by font.
  337. ----
  338. .. _class_FontData_method_get_supported_variation_list:
  339. - :ref:`Dictionary<class_Dictionary>` **get_supported_variation_list** **(** **)** |const|
  340. 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)``.
  341. Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant.
  342. ----
  343. .. _class_FontData_method_get_texture_count:
  344. - :ref:`int<class_int>` **get_texture_count** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)** |const|
  345. Returns number of textures used by font cache entry.
  346. ----
  347. .. _class_FontData_method_get_texture_image:
  348. - :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|
  349. Returns a copy of the font cache texture image.
  350. ----
  351. .. _class_FontData_method_get_texture_offsets:
  352. - :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|
  353. 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.
  354. ----
  355. .. _class_FontData_method_get_underline_position:
  356. - :ref:`float<class_float>` **get_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  357. Returns pixel offset of the underline below the baseline.
  358. ----
  359. .. _class_FontData_method_get_underline_thickness:
  360. - :ref:`float<class_float>` **get_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size **)** |const|
  361. Returns thickness of the underline in pixels.
  362. ----
  363. .. _class_FontData_method_get_variation_coordinates:
  364. - :ref:`Dictionary<class_Dictionary>` **get_variation_coordinates** **(** :ref:`int<class_int>` cache_index **)** |const|
  365. 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.
  366. ----
  367. .. _class_FontData_method_has_char:
  368. - :ref:`bool<class_bool>` **has_char** **(** :ref:`int<class_int>` char **)** |const|
  369. Return ``true`` if a Unicode ``char`` is available in the font.
  370. ----
  371. .. _class_FontData_method_is_antialiased:
  372. - :ref:`bool<class_bool>` **is_antialiased** **(** **)** |const|
  373. Returns ``true`` if font 8-bit anitialiased glyph rendering is supported and enabled.
  374. ----
  375. .. _class_FontData_method_is_force_autohinter:
  376. - :ref:`bool<class_bool>` **is_force_autohinter** **(** **)** |const|
  377. Returns ``true`` if auto-hinting is supported and preffered over font built-in hinting. Used by dynamic fonts only.
  378. ----
  379. .. _class_FontData_method_is_language_supported:
  380. - :ref:`bool<class_bool>` **is_language_supported** **(** :ref:`String<class_String>` language **)** |const|
  381. Returns ``true``, if font supports given language (`ISO 639 <https://en.wikipedia.org/wiki/ISO_639-1>`__ code).
  382. ----
  383. .. _class_FontData_method_is_multichannel_signed_distance_field:
  384. - :ref:`bool<class_bool>` **is_multichannel_signed_distance_field** **(** **)** |const|
  385. Returns ``true`` if glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data.
  386. ----
  387. .. _class_FontData_method_is_script_supported:
  388. - :ref:`bool<class_bool>` **is_script_supported** **(** :ref:`String<class_String>` script **)** |const|
  389. Returns ``true``, if font supports given script (`ISO 15924 <https://en.wikipedia.org/wiki/ISO_15924>`__ code).
  390. ----
  391. .. _class_FontData_method_remove_cache:
  392. - void **remove_cache** **(** :ref:`int<class_int>` cache_index **)**
  393. Removes specified font cache entry.
  394. ----
  395. .. _class_FontData_method_remove_glyph:
  396. - void **remove_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` glyph **)**
  397. Removes specified rendered glyph information from the cache entry.
  398. **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture<class_FontData_method_remove_texture>` to remove them manually.
  399. ----
  400. .. _class_FontData_method_remove_kerning:
  401. - void **remove_kerning** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`Vector2i<class_Vector2i>` glyph_pair **)**
  402. Removes kerning override for the pair of glyphs.
  403. ----
  404. .. _class_FontData_method_remove_language_support_override:
  405. - void **remove_language_support_override** **(** :ref:`String<class_String>` language **)**
  406. Remove language support override.
  407. ----
  408. .. _class_FontData_method_remove_script_support_override:
  409. - void **remove_script_support_override** **(** :ref:`String<class_String>` script **)**
  410. Removes script support override.
  411. ----
  412. .. _class_FontData_method_remove_size_cache:
  413. - void **remove_size_cache** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size **)**
  414. Removes specified font size from the cache entry.
  415. ----
  416. .. _class_FontData_method_remove_texture:
  417. - void **remove_texture** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` texture_index **)**
  418. Removes specified texture from font cache entry.
  419. **Note:** This function will not remove glyphs associated with the texture, remove them manually, using :ref:`remove_glyph<class_FontData_method_remove_glyph>`.
  420. ----
  421. .. _class_FontData_method_render_glyph:
  422. - void **render_glyph** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` index **)**
  423. Renders specified glyph the the font cache texture.
  424. ----
  425. .. _class_FontData_method_render_range:
  426. - void **render_range** **(** :ref:`int<class_int>` cache_index, :ref:`Vector2i<class_Vector2i>` size, :ref:`int<class_int>` start, :ref:`int<class_int>` end **)**
  427. Renders the range of characters to the font cache texture.
  428. ----
  429. .. _class_FontData_method_set_antialiased:
  430. - void **set_antialiased** **(** :ref:`bool<class_bool>` antialiased **)**
  431. If set to ``true``, 8-bit antialiased glyph rendering is used, otherwise 1-bit rendering is used. Used by dynamic fonts only.
  432. ----
  433. .. _class_FontData_method_set_ascent:
  434. - void **set_ascent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` ascent **)**
  435. Sets the font ascent (number of pixels above the baseline).
  436. ----
  437. .. _class_FontData_method_set_data:
  438. - void **set_data** **(** :ref:`PackedByteArray<class_PackedByteArray>` data **)**
  439. Sets font source data, e.g contents of the dynamic font source file.
  440. ----
  441. .. _class_FontData_method_set_descent:
  442. - void **set_descent** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` descent **)**
  443. Sets the font descent (number of pixels below the baseline).
  444. ----
  445. .. _class_FontData_method_set_font_name:
  446. - void **set_font_name** **(** :ref:`String<class_String>` name **)**
  447. Sets the font family name.
  448. ----
  449. .. _class_FontData_method_set_font_style:
  450. - void **set_font_style** **(** :ref:`int<class_int>` style **)**
  451. Sets the font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
  452. ----
  453. .. _class_FontData_method_set_font_style_name:
  454. - void **set_font_style_name** **(** :ref:`String<class_String>` name **)**
  455. Sets the font style name.
  456. ----
  457. .. _class_FontData_method_set_force_autohinter:
  458. - void **set_force_autohinter** **(** :ref:`bool<class_bool>` force_autohinter **)**
  459. If set to ``true`` auto-hinting is preffered over font built-in hinting.
  460. ----
  461. .. _class_FontData_method_set_glyph_advance:
  462. - 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 **)**
  463. Sets glyph advance (offset of the next glyph).
  464. **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  465. ----
  466. .. _class_FontData_method_set_glyph_offset:
  467. - 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 **)**
  468. Sets glyph offset from the baseline.
  469. ----
  470. .. _class_FontData_method_set_glyph_size:
  471. - 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 **)**
  472. Sets glyph size.
  473. ----
  474. .. _class_FontData_method_set_glyph_texture_idx:
  475. - 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 **)**
  476. Sets index of the cache texture containing the glyph.
  477. ----
  478. .. _class_FontData_method_set_glyph_uv_rect:
  479. - 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 **)**
  480. Sets rectangle in the cache texture containing the glyph.
  481. ----
  482. .. _class_FontData_method_set_hinting:
  483. - void **set_hinting** **(** :ref:`Hinting<enum_TextServer_Hinting>` hinting **)**
  484. Sets font hinting mode. Used by dynamic fonts only.
  485. ----
  486. .. _class_FontData_method_set_kerning:
  487. - 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 **)**
  488. Sets kerning for the pair of glyphs.
  489. ----
  490. .. _class_FontData_method_set_language_support_override:
  491. - void **set_language_support_override** **(** :ref:`String<class_String>` language, :ref:`bool<class_bool>` supported **)**
  492. Adds override for :ref:`is_language_supported<class_FontData_method_is_language_supported>`.
  493. ----
  494. .. _class_FontData_method_set_msdf_pixel_range:
  495. - void **set_msdf_pixel_range** **(** :ref:`int<class_int>` msdf_pixel_range **)**
  496. Sets the width of the range around the shape between the minimum and maximum representable signed distance.
  497. ----
  498. .. _class_FontData_method_set_msdf_size:
  499. - void **set_msdf_size** **(** :ref:`int<class_int>` msdf_size **)**
  500. Sets source font size used to generate MSDF textures.
  501. ----
  502. .. _class_FontData_method_set_multichannel_signed_distance_field:
  503. - void **set_multichannel_signed_distance_field** **(** :ref:`bool<class_bool>` msdf **)**
  504. If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. MSDF rendering allows displaying the font at any scaling factor without blurriness, and without incurring a CPU cost when the font size changes (since the font no longer needs to be rasterized on the CPU). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes.
  505. **Note:** MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts.
  506. ----
  507. .. _class_FontData_method_set_oversampling:
  508. - void **set_oversampling** **(** :ref:`float<class_float>` oversampling **)**
  509. Sets font oversampling factor, if set to ``0.0`` global oversampling factor is used instead. Used by dynamic fonts only.
  510. ----
  511. .. _class_FontData_method_set_scale:
  512. - void **set_scale** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` scale **)**
  513. Sets scaling factor of the color bitmap font.
  514. ----
  515. .. _class_FontData_method_set_script_support_override:
  516. - void **set_script_support_override** **(** :ref:`String<class_String>` script, :ref:`bool<class_bool>` supported **)**
  517. Adds override for :ref:`is_script_supported<class_FontData_method_is_script_supported>`.
  518. ----
  519. .. _class_FontData_method_set_spacing:
  520. - 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 **)**
  521. Sets extra spacing added between glyphs in pixels.
  522. ----
  523. .. _class_FontData_method_set_texture_image:
  524. - 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 **)**
  525. Sets font cache texture image.
  526. ----
  527. .. _class_FontData_method_set_texture_offsets:
  528. - 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 **)**
  529. 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).
  530. ----
  531. .. _class_FontData_method_set_underline_position:
  532. - void **set_underline_position** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_position **)**
  533. Sets pixel offset of the underline below the baseline.
  534. ----
  535. .. _class_FontData_method_set_underline_thickness:
  536. - void **set_underline_thickness** **(** :ref:`int<class_int>` cache_index, :ref:`int<class_int>` size, :ref:`float<class_float>` underline_thickness **)**
  537. Sets thickness of the underline in pixels.
  538. ----
  539. .. _class_FontData_method_set_variation_coordinates:
  540. - void **set_variation_coordinates** **(** :ref:`int<class_int>` cache_index, :ref:`Dictionary<class_Dictionary>` variation_coordinates **)**
  541. 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.
  542. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  543. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  544. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  545. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  546. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  547. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`