class_fontfile.rst 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/FontFile.xml.
  6. .. _class_FontFile:
  7. FontFile
  8. ========
  9. **Inherits:** :ref:`Font<class_Font>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Holds font source data and prerendered glyph cache, imported from a dynamic or a bitmap font.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **FontFile** contains a set of glyphs to represent Unicode characters imported from a font file, as well as a cache of rasterized glyphs, and a set of fallback :ref:`Font<class_Font>`\ s to use.
  15. Use :ref:`FontVariation<class_FontVariation>` to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text.
  16. For more complex text processing, use :ref:`FontVariation<class_FontVariation>` in conjunction with :ref:`TextLine<class_TextLine>` or :ref:`TextParagraph<class_TextParagraph>`.
  17. Supported font formats:
  18. - Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm).
  19. - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants.
  20. - Monospace image font importer: All supported image formats.
  21. \ **Note:** A character is a symbol that represents an item (letter, digit etc.) in an abstract way.
  22. \ **Note:** A glyph is a bitmap or a shape used to draw one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source.
  23. \ **Note:** If none of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code.
  24. .. tabs::
  25. .. code-tab:: gdscript
  26. var f = load("res://BarlowCondensed-Bold.ttf")
  27. $Label.add_theme_font_override("font", f)
  28. $Label.add_theme_font_size_override("font_size", 64)
  29. .. code-tab:: csharp
  30. var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf");
  31. GetNode("Label").AddThemeFontOverride("font", f);
  32. GetNode("Label").AddThemeFontSizeOverride("font_size", 64);
  33. .. rst-class:: classref-introduction-group
  34. Tutorials
  35. ---------
  36. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  37. .. rst-class:: classref-reftable-group
  38. Properties
  39. ----------
  40. .. table::
  41. :widths: auto
  42. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  43. | :ref:`bool<class_bool>` | :ref:`allow_system_fallback<class_FontFile_property_allow_system_fallback>` | ``true`` |
  44. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  45. | :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` | :ref:`antialiasing<class_FontFile_property_antialiasing>` | ``1`` |
  46. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  47. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data<class_FontFile_property_data>` | ``PackedByteArray()`` |
  48. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  49. | :ref:`bool<class_bool>` | :ref:`disable_embedded_bitmaps<class_FontFile_property_disable_embedded_bitmaps>` | ``true`` |
  50. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  51. | :ref:`int<class_int>` | :ref:`fixed_size<class_FontFile_property_fixed_size>` | ``0`` |
  52. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  53. | :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>` | :ref:`fixed_size_scale_mode<class_FontFile_property_fixed_size_scale_mode>` | ``0`` |
  54. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  55. | :ref:`String<class_String>` | :ref:`font_name<class_FontFile_property_font_name>` | ``""`` |
  56. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  57. | :ref:`int<class_int>` | :ref:`font_stretch<class_FontFile_property_font_stretch>` | ``100`` |
  58. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  59. | |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] | :ref:`font_style<class_FontFile_property_font_style>` | ``0`` |
  60. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  61. | :ref:`int<class_int>` | :ref:`font_weight<class_FontFile_property_font_weight>` | ``400`` |
  62. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  63. | :ref:`bool<class_bool>` | :ref:`force_autohinter<class_FontFile_property_force_autohinter>` | ``false`` |
  64. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  65. | :ref:`bool<class_bool>` | :ref:`generate_mipmaps<class_FontFile_property_generate_mipmaps>` | ``false`` |
  66. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  67. | :ref:`Hinting<enum_TextServer_Hinting>` | :ref:`hinting<class_FontFile_property_hinting>` | ``1`` |
  68. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  69. | :ref:`bool<class_bool>` | :ref:`keep_rounding_remainders<class_FontFile_property_keep_rounding_remainders>` | ``true`` |
  70. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  71. | :ref:`int<class_int>` | :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` | ``16`` |
  72. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  73. | :ref:`int<class_int>` | :ref:`msdf_size<class_FontFile_property_msdf_size>` | ``48`` |
  74. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  75. | :ref:`bool<class_bool>` | :ref:`multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` | ``false`` |
  76. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  77. | :ref:`Dictionary<class_Dictionary>` | :ref:`opentype_feature_overrides<class_FontFile_property_opentype_feature_overrides>` | ``{}`` |
  78. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  79. | :ref:`float<class_float>` | :ref:`oversampling<class_FontFile_property_oversampling>` | ``0.0`` |
  80. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  81. | :ref:`String<class_String>` | :ref:`style_name<class_FontFile_property_style_name>` | ``""`` |
  82. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  83. | :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` | :ref:`subpixel_positioning<class_FontFile_property_subpixel_positioning>` | ``1`` |
  84. +-----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------+-----------------------+
  85. .. rst-class:: classref-reftable-group
  86. Methods
  87. -------
  88. .. table::
  89. :widths: auto
  90. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | |void| | :ref:`clear_cache<class_FontFile_method_clear_cache>`\ (\ ) |
  92. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | |void| | :ref:`clear_glyphs<class_FontFile_method_clear_glyphs>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  94. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | |void| | :ref:`clear_kerning_map<class_FontFile_method_clear_kerning_map>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |
  96. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | |void| | :ref:`clear_size_cache<class_FontFile_method_clear_size_cache>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |
  98. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`clear_textures<class_FontFile_method_clear_textures>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  100. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`float<class_float>` | :ref:`get_cache_ascent<class_FontFile_method_get_cache_ascent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  102. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | :ref:`int<class_int>` | :ref:`get_cache_count<class_FontFile_method_get_cache_count>`\ (\ ) |const| |
  104. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`float<class_float>` | :ref:`get_cache_descent<class_FontFile_method_get_cache_descent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  106. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | :ref:`float<class_float>` | :ref:`get_cache_scale<class_FontFile_method_get_cache_scale>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  108. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | :ref:`float<class_float>` | :ref:`get_cache_underline_position<class_FontFile_method_get_cache_underline_position>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  110. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`float<class_float>` | :ref:`get_cache_underline_thickness<class_FontFile_method_get_cache_underline_thickness>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  112. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`int<class_int>` | :ref:`get_char_from_glyph_index<class_FontFile_method_get_char_from_glyph_index>`\ (\ size\: :ref:`int<class_int>`, glyph_index\: :ref:`int<class_int>`\ ) |const| |
  114. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`float<class_float>` | :ref:`get_embolden<class_FontFile_method_get_embolden>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  116. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`float<class_float>` | :ref:`get_extra_baseline_offset<class_FontFile_method_get_extra_baseline_offset>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  118. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`int<class_int>` | :ref:`get_extra_spacing<class_FontFile_method_get_extra_spacing>`\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`\ ) |const| |
  120. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`int<class_int>` | :ref:`get_face_index<class_FontFile_method_get_face_index>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  122. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_advance<class_FontFile_method_get_glyph_advance>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  124. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`int<class_int>` | :ref:`get_glyph_index<class_FontFile_method_get_glyph_index>`\ (\ size\: :ref:`int<class_int>`, char\: :ref:`int<class_int>`, variation_selector\: :ref:`int<class_int>`\ ) |const| |
  126. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_glyph_list<class_FontFile_method_get_glyph_list>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  128. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_offset<class_FontFile_method_get_glyph_offset>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  130. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`Vector2<class_Vector2>` | :ref:`get_glyph_size<class_FontFile_method_get_glyph_size>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  132. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | :ref:`int<class_int>` | :ref:`get_glyph_texture_idx<class_FontFile_method_get_glyph_texture_idx>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  134. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | :ref:`Rect2<class_Rect2>` | :ref:`get_glyph_uv_rect<class_FontFile_method_get_glyph_uv_rect>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| |
  136. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | :ref:`Vector2<class_Vector2>` | :ref:`get_kerning<class_FontFile_method_get_kerning>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  138. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] | :ref:`get_kerning_list<class_FontFile_method_get_kerning_list>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| |
  140. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | :ref:`bool<class_bool>` | :ref:`get_language_support_override<class_FontFile_method_get_language_support_override>`\ (\ language\: :ref:`String<class_String>`\ ) |const| |
  142. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_language_support_overrides<class_FontFile_method_get_language_support_overrides>`\ (\ ) |const| |
  144. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | :ref:`bool<class_bool>` | :ref:`get_script_support_override<class_FontFile_method_get_script_support_override>`\ (\ script\: :ref:`String<class_String>`\ ) |const| |
  146. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_script_support_overrides<class_FontFile_method_get_script_support_overrides>`\ (\ ) |const| |
  148. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] | :ref:`get_size_cache_list<class_FontFile_method_get_size_cache_list>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  150. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`int<class_int>` | :ref:`get_texture_count<class_FontFile_method_get_texture_count>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| |
  152. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | :ref:`Image<class_Image>` | :ref:`get_texture_image<class_FontFile_method_get_texture_image>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| |
  154. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`get_texture_offsets<class_FontFile_method_get_texture_offsets>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| |
  156. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | :ref:`Transform2D<class_Transform2D>` | :ref:`get_transform<class_FontFile_method_get_transform>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  158. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_variation_coordinates<class_FontFile_method_get_variation_coordinates>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| |
  160. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_bitmap_font<class_FontFile_method_load_bitmap_font>`\ (\ path\: :ref:`String<class_String>`\ ) |
  162. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_dynamic_font<class_FontFile_method_load_dynamic_font>`\ (\ path\: :ref:`String<class_String>`\ ) |
  164. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | |void| | :ref:`remove_cache<class_FontFile_method_remove_cache>`\ (\ cache_index\: :ref:`int<class_int>`\ ) |
  166. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | |void| | :ref:`remove_glyph<class_FontFile_method_remove_glyph>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |
  168. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | |void| | :ref:`remove_kerning<class_FontFile_method_remove_kerning>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) |
  170. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | |void| | :ref:`remove_language_support_override<class_FontFile_method_remove_language_support_override>`\ (\ language\: :ref:`String<class_String>`\ ) |
  172. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | |void| | :ref:`remove_script_support_override<class_FontFile_method_remove_script_support_override>`\ (\ script\: :ref:`String<class_String>`\ ) |
  174. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | |void| | :ref:`remove_size_cache<class_FontFile_method_remove_size_cache>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |
  176. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | |void| | :ref:`remove_texture<class_FontFile_method_remove_texture>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |
  178. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | |void| | :ref:`render_glyph<class_FontFile_method_render_glyph>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, index\: :ref:`int<class_int>`\ ) |
  180. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | |void| | :ref:`render_range<class_FontFile_method_render_range>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, start\: :ref:`int<class_int>`, end\: :ref:`int<class_int>`\ ) |
  182. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | |void| | :ref:`set_cache_ascent<class_FontFile_method_set_cache_ascent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, ascent\: :ref:`float<class_float>`\ ) |
  184. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | |void| | :ref:`set_cache_descent<class_FontFile_method_set_cache_descent>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, descent\: :ref:`float<class_float>`\ ) |
  186. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. | |void| | :ref:`set_cache_scale<class_FontFile_method_set_cache_scale>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, scale\: :ref:`float<class_float>`\ ) |
  188. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  189. | |void| | :ref:`set_cache_underline_position<class_FontFile_method_set_cache_underline_position>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_position\: :ref:`float<class_float>`\ ) |
  190. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  191. | |void| | :ref:`set_cache_underline_thickness<class_FontFile_method_set_cache_underline_thickness>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_thickness\: :ref:`float<class_float>`\ ) |
  192. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  193. | |void| | :ref:`set_embolden<class_FontFile_method_set_embolden>`\ (\ cache_index\: :ref:`int<class_int>`, strength\: :ref:`float<class_float>`\ ) |
  194. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  195. | |void| | :ref:`set_extra_baseline_offset<class_FontFile_method_set_extra_baseline_offset>`\ (\ cache_index\: :ref:`int<class_int>`, baseline_offset\: :ref:`float<class_float>`\ ) |
  196. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  197. | |void| | :ref:`set_extra_spacing<class_FontFile_method_set_extra_spacing>`\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`, value\: :ref:`int<class_int>`\ ) |
  198. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  199. | |void| | :ref:`set_face_index<class_FontFile_method_set_face_index>`\ (\ cache_index\: :ref:`int<class_int>`, face_index\: :ref:`int<class_int>`\ ) |
  200. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  201. | |void| | :ref:`set_glyph_advance<class_FontFile_method_set_glyph_advance>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`, advance\: :ref:`Vector2<class_Vector2>`\ ) |
  202. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  203. | |void| | :ref:`set_glyph_offset<class_FontFile_method_set_glyph_offset>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, offset\: :ref:`Vector2<class_Vector2>`\ ) |
  204. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  205. | |void| | :ref:`set_glyph_size<class_FontFile_method_set_glyph_size>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, gl_size\: :ref:`Vector2<class_Vector2>`\ ) |
  206. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  207. | |void| | :ref:`set_glyph_texture_idx<class_FontFile_method_set_glyph_texture_idx>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, texture_idx\: :ref:`int<class_int>`\ ) |
  208. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  209. | |void| | :ref:`set_glyph_uv_rect<class_FontFile_method_set_glyph_uv_rect>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, uv_rect\: :ref:`Rect2<class_Rect2>`\ ) |
  210. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  211. | |void| | :ref:`set_kerning<class_FontFile_method_set_kerning>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`, kerning\: :ref:`Vector2<class_Vector2>`\ ) |
  212. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  213. | |void| | :ref:`set_language_support_override<class_FontFile_method_set_language_support_override>`\ (\ language\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) |
  214. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  215. | |void| | :ref:`set_script_support_override<class_FontFile_method_set_script_support_override>`\ (\ script\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) |
  216. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  217. | |void| | :ref:`set_texture_image<class_FontFile_method_set_texture_image>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, image\: :ref:`Image<class_Image>`\ ) |
  218. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  219. | |void| | :ref:`set_texture_offsets<class_FontFile_method_set_texture_offsets>`\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, offset\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ ) |
  220. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  221. | |void| | :ref:`set_transform<class_FontFile_method_set_transform>`\ (\ cache_index\: :ref:`int<class_int>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) |
  222. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  223. | |void| | :ref:`set_variation_coordinates<class_FontFile_method_set_variation_coordinates>`\ (\ cache_index\: :ref:`int<class_int>`, variation_coordinates\: :ref:`Dictionary<class_Dictionary>`\ ) |
  224. +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  225. .. rst-class:: classref-section-separator
  226. ----
  227. .. rst-class:: classref-descriptions-group
  228. Property Descriptions
  229. ---------------------
  230. .. _class_FontFile_property_allow_system_fallback:
  231. .. rst-class:: classref-property
  232. :ref:`bool<class_bool>` **allow_system_fallback** = ``true`` :ref:`🔗<class_FontFile_property_allow_system_fallback>`
  233. .. rst-class:: classref-property-setget
  234. - |void| **set_allow_system_fallback**\ (\ value\: :ref:`bool<class_bool>`\ )
  235. - :ref:`bool<class_bool>` **is_allow_system_fallback**\ (\ )
  236. If set to ``true``, system fonts can be automatically used as fallbacks.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_FontFile_property_antialiasing:
  240. .. rst-class:: classref-property
  241. :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` **antialiasing** = ``1`` :ref:`🔗<class_FontFile_property_antialiasing>`
  242. .. rst-class:: classref-property-setget
  243. - |void| **set_antialiasing**\ (\ value\: :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>`\ )
  244. - :ref:`FontAntialiasing<enum_TextServer_FontAntialiasing>` **get_antialiasing**\ (\ )
  245. Font anti-aliasing mode.
  246. .. rst-class:: classref-item-separator
  247. ----
  248. .. _class_FontFile_property_data:
  249. .. rst-class:: classref-property
  250. :ref:`PackedByteArray<class_PackedByteArray>` **data** = ``PackedByteArray()`` :ref:`🔗<class_FontFile_property_data>`
  251. .. rst-class:: classref-property-setget
  252. - |void| **set_data**\ (\ value\: :ref:`PackedByteArray<class_PackedByteArray>`\ )
  253. - :ref:`PackedByteArray<class_PackedByteArray>` **get_data**\ (\ )
  254. Contents of the dynamic font source file.
  255. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedByteArray<class_PackedByteArray>` for more details.
  256. .. rst-class:: classref-item-separator
  257. ----
  258. .. _class_FontFile_property_disable_embedded_bitmaps:
  259. .. rst-class:: classref-property
  260. :ref:`bool<class_bool>` **disable_embedded_bitmaps** = ``true`` :ref:`🔗<class_FontFile_property_disable_embedded_bitmaps>`
  261. .. rst-class:: classref-property-setget
  262. - |void| **set_disable_embedded_bitmaps**\ (\ value\: :ref:`bool<class_bool>`\ )
  263. - :ref:`bool<class_bool>` **get_disable_embedded_bitmaps**\ (\ )
  264. If set to ``true``, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_FontFile_property_fixed_size:
  268. .. rst-class:: classref-property
  269. :ref:`int<class_int>` **fixed_size** = ``0`` :ref:`🔗<class_FontFile_property_fixed_size>`
  270. .. rst-class:: classref-property-setget
  271. - |void| **set_fixed_size**\ (\ value\: :ref:`int<class_int>`\ )
  272. - :ref:`int<class_int>` **get_fixed_size**\ (\ )
  273. Font size, used only for the bitmap fonts.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_FontFile_property_fixed_size_scale_mode:
  277. .. rst-class:: classref-property
  278. :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>` **fixed_size_scale_mode** = ``0`` :ref:`🔗<class_FontFile_property_fixed_size_scale_mode>`
  279. .. rst-class:: classref-property-setget
  280. - |void| **set_fixed_size_scale_mode**\ (\ value\: :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>`\ )
  281. - :ref:`FixedSizeScaleMode<enum_TextServer_FixedSizeScaleMode>` **get_fixed_size_scale_mode**\ (\ )
  282. Scaling mode, used only for the bitmap fonts with :ref:`fixed_size<class_FontFile_property_fixed_size>` greater than zero.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_FontFile_property_font_name:
  286. .. rst-class:: classref-property
  287. :ref:`String<class_String>` **font_name** = ``""`` :ref:`🔗<class_FontFile_property_font_name>`
  288. .. rst-class:: classref-property-setget
  289. - |void| **set_font_name**\ (\ value\: :ref:`String<class_String>`\ )
  290. - :ref:`String<class_String>` **get_font_name**\ (\ )
  291. Font family name.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_FontFile_property_font_stretch:
  295. .. rst-class:: classref-property
  296. :ref:`int<class_int>` **font_stretch** = ``100`` :ref:`🔗<class_FontFile_property_font_stretch>`
  297. .. rst-class:: classref-property-setget
  298. - |void| **set_font_stretch**\ (\ value\: :ref:`int<class_int>`\ )
  299. - :ref:`int<class_int>` **get_font_stretch**\ (\ )
  300. Font stretch amount, compared to a normal width. A percentage value between ``50%`` and ``200%``.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_FontFile_property_font_style:
  304. .. rst-class:: classref-property
  305. |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] **font_style** = ``0`` :ref:`🔗<class_FontFile_property_font_style>`
  306. .. rst-class:: classref-property-setget
  307. - |void| **set_font_style**\ (\ value\: |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\]\ )
  308. - |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] **get_font_style**\ (\ )
  309. Font style flags, see :ref:`FontStyle<enum_TextServer_FontStyle>`.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_FontFile_property_font_weight:
  313. .. rst-class:: classref-property
  314. :ref:`int<class_int>` **font_weight** = ``400`` :ref:`🔗<class_FontFile_property_font_weight>`
  315. .. rst-class:: classref-property-setget
  316. - |void| **set_font_weight**\ (\ value\: :ref:`int<class_int>`\ )
  317. - :ref:`int<class_int>` **get_font_weight**\ (\ )
  318. Weight (boldness) of the font. A value in the ``100...999`` range, normal font weight is ``400``, bold font weight is ``700``.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_FontFile_property_force_autohinter:
  322. .. rst-class:: classref-property
  323. :ref:`bool<class_bool>` **force_autohinter** = ``false`` :ref:`🔗<class_FontFile_property_force_autohinter>`
  324. .. rst-class:: classref-property-setget
  325. - |void| **set_force_autohinter**\ (\ value\: :ref:`bool<class_bool>`\ )
  326. - :ref:`bool<class_bool>` **is_force_autohinter**\ (\ )
  327. If set to ``true``, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only (MSDF fonts don't support hinting).
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_FontFile_property_generate_mipmaps:
  331. .. rst-class:: classref-property
  332. :ref:`bool<class_bool>` **generate_mipmaps** = ``false`` :ref:`🔗<class_FontFile_property_generate_mipmaps>`
  333. .. rst-class:: classref-property-setget
  334. - |void| **set_generate_mipmaps**\ (\ value\: :ref:`bool<class_bool>`\ )
  335. - :ref:`bool<class_bool>` **get_generate_mipmaps**\ (\ )
  336. If set to ``true``, generate mipmaps for the font textures.
  337. .. rst-class:: classref-item-separator
  338. ----
  339. .. _class_FontFile_property_hinting:
  340. .. rst-class:: classref-property
  341. :ref:`Hinting<enum_TextServer_Hinting>` **hinting** = ``1`` :ref:`🔗<class_FontFile_property_hinting>`
  342. .. rst-class:: classref-property-setget
  343. - |void| **set_hinting**\ (\ value\: :ref:`Hinting<enum_TextServer_Hinting>`\ )
  344. - :ref:`Hinting<enum_TextServer_Hinting>` **get_hinting**\ (\ )
  345. Font hinting mode. Used by dynamic fonts only.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_FontFile_property_keep_rounding_remainders:
  349. .. rst-class:: classref-property
  350. :ref:`bool<class_bool>` **keep_rounding_remainders** = ``true`` :ref:`🔗<class_FontFile_property_keep_rounding_remainders>`
  351. .. rst-class:: classref-property-setget
  352. - |void| **set_keep_rounding_remainders**\ (\ value\: :ref:`bool<class_bool>`\ )
  353. - :ref:`bool<class_bool>` **get_keep_rounding_remainders**\ (\ )
  354. If set to ``true``, when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_FontFile_property_msdf_pixel_range:
  358. .. rst-class:: classref-property
  359. :ref:`int<class_int>` **msdf_pixel_range** = ``16`` :ref:`🔗<class_FontFile_property_msdf_pixel_range>`
  360. .. rst-class:: classref-property-setget
  361. - |void| **set_msdf_pixel_range**\ (\ value\: :ref:`int<class_int>`\ )
  362. - :ref:`int<class_int>` **get_msdf_pixel_range**\ (\ )
  363. The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the size of the largest font outline. The default :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` value of ``16`` allows outline sizes up to ``8`` to look correct.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_FontFile_property_msdf_size:
  367. .. rst-class:: classref-property
  368. :ref:`int<class_int>` **msdf_size** = ``48`` :ref:`🔗<class_FontFile_property_msdf_size>`
  369. .. rst-class:: classref-property-setget
  370. - |void| **set_msdf_size**\ (\ value\: :ref:`int<class_int>`\ )
  371. - :ref:`int<class_int>` **get_msdf_size**\ (\ )
  372. Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_FontFile_property_multichannel_signed_distance_field:
  376. .. rst-class:: classref-property
  377. :ref:`bool<class_bool>` **multichannel_signed_distance_field** = ``false`` :ref:`🔗<class_FontFile_property_multichannel_signed_distance_field>`
  378. .. rst-class:: classref-property-setget
  379. - |void| **set_multichannel_signed_distance_field**\ (\ value\: :ref:`bool<class_bool>`\ )
  380. - :ref:`bool<class_bool>` **is_multichannel_signed_distance_field**\ (\ )
  381. If set to ``true``, glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for :ref:`Control<class_Control>`\ s that are scaled down (or for :ref:`Label3D<class_Label3D>`\ s viewed from a long distance). 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.
  382. \ **Note:** If using font outlines, :ref:`msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the size of the largest font outline.
  383. \ **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.
  384. .. rst-class:: classref-item-separator
  385. ----
  386. .. _class_FontFile_property_opentype_feature_overrides:
  387. .. rst-class:: classref-property
  388. :ref:`Dictionary<class_Dictionary>` **opentype_feature_overrides** = ``{}`` :ref:`🔗<class_FontFile_property_opentype_feature_overrides>`
  389. .. rst-class:: classref-property-setget
  390. - |void| **set_opentype_feature_overrides**\ (\ value\: :ref:`Dictionary<class_Dictionary>`\ )
  391. - :ref:`Dictionary<class_Dictionary>` **get_opentype_feature_overrides**\ (\ )
  392. Font OpenType feature set override.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_FontFile_property_oversampling:
  396. .. rst-class:: classref-property
  397. :ref:`float<class_float>` **oversampling** = ``0.0`` :ref:`🔗<class_FontFile_property_oversampling>`
  398. .. rst-class:: classref-property-setget
  399. - |void| **set_oversampling**\ (\ value\: :ref:`float<class_float>`\ )
  400. - :ref:`float<class_float>` **get_oversampling**\ (\ )
  401. Font oversampling factor. If set to ``0.0``, the global oversampling factor is used instead. Used by dynamic fonts only (MSDF fonts ignore oversampling).
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_FontFile_property_style_name:
  405. .. rst-class:: classref-property
  406. :ref:`String<class_String>` **style_name** = ``""`` :ref:`🔗<class_FontFile_property_style_name>`
  407. .. rst-class:: classref-property-setget
  408. - |void| **set_font_style_name**\ (\ value\: :ref:`String<class_String>`\ )
  409. - :ref:`String<class_String>` **get_font_style_name**\ (\ )
  410. Font style name.
  411. .. rst-class:: classref-item-separator
  412. ----
  413. .. _class_FontFile_property_subpixel_positioning:
  414. .. rst-class:: classref-property
  415. :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **subpixel_positioning** = ``1`` :ref:`🔗<class_FontFile_property_subpixel_positioning>`
  416. .. rst-class:: classref-property-setget
  417. - |void| **set_subpixel_positioning**\ (\ value\: :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>`\ )
  418. - :ref:`SubpixelPositioning<enum_TextServer_SubpixelPositioning>` **get_subpixel_positioning**\ (\ )
  419. Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of higher memory usage and lower font rasterization speed. Use :ref:`TextServer.SUBPIXEL_POSITIONING_AUTO<class_TextServer_constant_SUBPIXEL_POSITIONING_AUTO>` to automatically enable it based on the font size.
  420. .. rst-class:: classref-section-separator
  421. ----
  422. .. rst-class:: classref-descriptions-group
  423. Method Descriptions
  424. -------------------
  425. .. _class_FontFile_method_clear_cache:
  426. .. rst-class:: classref-method
  427. |void| **clear_cache**\ (\ ) :ref:`🔗<class_FontFile_method_clear_cache>`
  428. Removes all font cache entries.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_FontFile_method_clear_glyphs:
  432. .. rst-class:: classref-method
  433. |void| **clear_glyphs**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_clear_glyphs>`
  434. Removes all rendered glyph information from the cache entry.
  435. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture()<class_FontFile_method_remove_texture>` to remove them manually.
  436. .. rst-class:: classref-item-separator
  437. ----
  438. .. _class_FontFile_method_clear_kerning_map:
  439. .. rst-class:: classref-method
  440. |void| **clear_kerning_map**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_clear_kerning_map>`
  441. Removes all kerning overrides.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_FontFile_method_clear_size_cache:
  445. .. rst-class:: classref-method
  446. |void| **clear_size_cache**\ (\ cache_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_clear_size_cache>`
  447. Removes all font sizes from the cache entry.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_FontFile_method_clear_textures:
  451. .. rst-class:: classref-method
  452. |void| **clear_textures**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_clear_textures>`
  453. Removes all textures from font cache entry.
  454. \ **Note:** This function will not remove glyphs associated with the texture, use :ref:`remove_glyph()<class_FontFile_method_remove_glyph>` to remove them manually.
  455. .. rst-class:: classref-item-separator
  456. ----
  457. .. _class_FontFile_method_get_cache_ascent:
  458. .. rst-class:: classref-method
  459. :ref:`float<class_float>` **get_cache_ascent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_ascent>`
  460. Returns the font ascent (number of pixels above the baseline).
  461. .. rst-class:: classref-item-separator
  462. ----
  463. .. _class_FontFile_method_get_cache_count:
  464. .. rst-class:: classref-method
  465. :ref:`int<class_int>` **get_cache_count**\ (\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_count>`
  466. Returns number of the font cache entries.
  467. .. rst-class:: classref-item-separator
  468. ----
  469. .. _class_FontFile_method_get_cache_descent:
  470. .. rst-class:: classref-method
  471. :ref:`float<class_float>` **get_cache_descent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_descent>`
  472. Returns the font descent (number of pixels below the baseline).
  473. .. rst-class:: classref-item-separator
  474. ----
  475. .. _class_FontFile_method_get_cache_scale:
  476. .. rst-class:: classref-method
  477. :ref:`float<class_float>` **get_cache_scale**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_scale>`
  478. Returns scaling factor of the color bitmap font.
  479. .. rst-class:: classref-item-separator
  480. ----
  481. .. _class_FontFile_method_get_cache_underline_position:
  482. .. rst-class:: classref-method
  483. :ref:`float<class_float>` **get_cache_underline_position**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_underline_position>`
  484. Returns pixel offset of the underline below the baseline.
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _class_FontFile_method_get_cache_underline_thickness:
  488. .. rst-class:: classref-method
  489. :ref:`float<class_float>` **get_cache_underline_thickness**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_cache_underline_thickness>`
  490. Returns thickness of the underline in pixels.
  491. .. rst-class:: classref-item-separator
  492. ----
  493. .. _class_FontFile_method_get_char_from_glyph_index:
  494. .. rst-class:: classref-method
  495. :ref:`int<class_int>` **get_char_from_glyph_index**\ (\ size\: :ref:`int<class_int>`, glyph_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_char_from_glyph_index>`
  496. Returns character code associated with ``glyph_index``, or ``0`` if ``glyph_index`` is invalid. See :ref:`get_glyph_index()<class_FontFile_method_get_glyph_index>`.
  497. .. rst-class:: classref-item-separator
  498. ----
  499. .. _class_FontFile_method_get_embolden:
  500. .. rst-class:: classref-method
  501. :ref:`float<class_float>` **get_embolden**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_embolden>`
  502. Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  503. .. rst-class:: classref-item-separator
  504. ----
  505. .. _class_FontFile_method_get_extra_baseline_offset:
  506. .. rst-class:: classref-method
  507. :ref:`float<class_float>` **get_extra_baseline_offset**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_extra_baseline_offset>`
  508. Returns extra baseline offset (as a fraction of font height).
  509. .. rst-class:: classref-item-separator
  510. ----
  511. .. _class_FontFile_method_get_extra_spacing:
  512. .. rst-class:: classref-method
  513. :ref:`int<class_int>` **get_extra_spacing**\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`\ ) |const| :ref:`🔗<class_FontFile_method_get_extra_spacing>`
  514. Returns spacing for ``spacing`` (see :ref:`SpacingType<enum_TextServer_SpacingType>`) in pixels (not relative to the font size).
  515. .. rst-class:: classref-item-separator
  516. ----
  517. .. _class_FontFile_method_get_face_index:
  518. .. rst-class:: classref-method
  519. :ref:`int<class_int>` **get_face_index**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_face_index>`
  520. Returns an active face index in the TrueType / OpenType collection.
  521. .. rst-class:: classref-item-separator
  522. ----
  523. .. _class_FontFile_method_get_glyph_advance:
  524. .. rst-class:: classref-method
  525. :ref:`Vector2<class_Vector2>` **get_glyph_advance**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_advance>`
  526. Returns glyph advance (offset of the next glyph).
  527. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  528. .. rst-class:: classref-item-separator
  529. ----
  530. .. _class_FontFile_method_get_glyph_index:
  531. .. rst-class:: classref-method
  532. :ref:`int<class_int>` **get_glyph_index**\ (\ size\: :ref:`int<class_int>`, char\: :ref:`int<class_int>`, variation_selector\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_index>`
  533. Returns the glyph index of a ``char``, optionally modified by the ``variation_selector``.
  534. .. rst-class:: classref-item-separator
  535. ----
  536. .. _class_FontFile_method_get_glyph_list:
  537. .. rst-class:: classref-method
  538. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_glyph_list**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_list>`
  539. Returns list of rendered glyphs in the cache entry.
  540. .. rst-class:: classref-item-separator
  541. ----
  542. .. _class_FontFile_method_get_glyph_offset:
  543. .. rst-class:: classref-method
  544. :ref:`Vector2<class_Vector2>` **get_glyph_offset**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_offset>`
  545. Returns glyph offset from the baseline.
  546. .. rst-class:: classref-item-separator
  547. ----
  548. .. _class_FontFile_method_get_glyph_size:
  549. .. rst-class:: classref-method
  550. :ref:`Vector2<class_Vector2>` **get_glyph_size**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_size>`
  551. Returns glyph size.
  552. .. rst-class:: classref-item-separator
  553. ----
  554. .. _class_FontFile_method_get_glyph_texture_idx:
  555. .. rst-class:: classref-method
  556. :ref:`int<class_int>` **get_glyph_texture_idx**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_texture_idx>`
  557. Returns index of the cache texture containing the glyph.
  558. .. rst-class:: classref-item-separator
  559. ----
  560. .. _class_FontFile_method_get_glyph_uv_rect:
  561. .. rst-class:: classref-method
  562. :ref:`Rect2<class_Rect2>` **get_glyph_uv_rect**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_glyph_uv_rect>`
  563. Returns rectangle in the cache texture containing the glyph.
  564. .. rst-class:: classref-item-separator
  565. ----
  566. .. _class_FontFile_method_get_kerning:
  567. .. rst-class:: classref-method
  568. :ref:`Vector2<class_Vector2>` **get_kerning**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_FontFile_method_get_kerning>`
  569. Returns kerning for the pair of glyphs.
  570. .. rst-class:: classref-item-separator
  571. ----
  572. .. _class_FontFile_method_get_kerning_list:
  573. .. rst-class:: classref-method
  574. :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] **get_kerning_list**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_kerning_list>`
  575. Returns list of the kerning overrides.
  576. .. rst-class:: classref-item-separator
  577. ----
  578. .. _class_FontFile_method_get_language_support_override:
  579. .. rst-class:: classref-method
  580. :ref:`bool<class_bool>` **get_language_support_override**\ (\ language\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_FontFile_method_get_language_support_override>`
  581. Returns ``true`` if support override is enabled for the ``language``.
  582. .. rst-class:: classref-item-separator
  583. ----
  584. .. _class_FontFile_method_get_language_support_overrides:
  585. .. rst-class:: classref-method
  586. :ref:`PackedStringArray<class_PackedStringArray>` **get_language_support_overrides**\ (\ ) |const| :ref:`🔗<class_FontFile_method_get_language_support_overrides>`
  587. Returns list of language support overrides.
  588. .. rst-class:: classref-item-separator
  589. ----
  590. .. _class_FontFile_method_get_script_support_override:
  591. .. rst-class:: classref-method
  592. :ref:`bool<class_bool>` **get_script_support_override**\ (\ script\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_FontFile_method_get_script_support_override>`
  593. Returns ``true`` if support override is enabled for the ``script``.
  594. .. rst-class:: classref-item-separator
  595. ----
  596. .. _class_FontFile_method_get_script_support_overrides:
  597. .. rst-class:: classref-method
  598. :ref:`PackedStringArray<class_PackedStringArray>` **get_script_support_overrides**\ (\ ) |const| :ref:`🔗<class_FontFile_method_get_script_support_overrides>`
  599. Returns list of script support overrides.
  600. .. rst-class:: classref-item-separator
  601. ----
  602. .. _class_FontFile_method_get_size_cache_list:
  603. .. rst-class:: classref-method
  604. :ref:`Array<class_Array>`\[:ref:`Vector2i<class_Vector2i>`\] **get_size_cache_list**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_size_cache_list>`
  605. Returns list of the font sizes in the cache. Each size is :ref:`Vector2i<class_Vector2i>` with font size and outline size.
  606. .. rst-class:: classref-item-separator
  607. ----
  608. .. _class_FontFile_method_get_texture_count:
  609. .. rst-class:: classref-method
  610. :ref:`int<class_int>` **get_texture_count**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) |const| :ref:`🔗<class_FontFile_method_get_texture_count>`
  611. Returns number of textures used by font cache entry.
  612. .. rst-class:: classref-item-separator
  613. ----
  614. .. _class_FontFile_method_get_texture_image:
  615. .. rst-class:: classref-method
  616. :ref:`Image<class_Image>` **get_texture_image**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_texture_image>`
  617. Returns a copy of the font cache texture image.
  618. .. rst-class:: classref-item-separator
  619. ----
  620. .. _class_FontFile_method_get_texture_offsets:
  621. .. rst-class:: classref-method
  622. :ref:`PackedInt32Array<class_PackedInt32Array>` **get_texture_offsets**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_texture_offsets>`
  623. Returns a copy of the array containing glyph packing data.
  624. .. rst-class:: classref-item-separator
  625. ----
  626. .. _class_FontFile_method_get_transform:
  627. .. rst-class:: classref-method
  628. :ref:`Transform2D<class_Transform2D>` **get_transform**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_transform>`
  629. Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.
  630. .. rst-class:: classref-item-separator
  631. ----
  632. .. _class_FontFile_method_get_variation_coordinates:
  633. .. rst-class:: classref-method
  634. :ref:`Dictionary<class_Dictionary>` **get_variation_coordinates**\ (\ cache_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FontFile_method_get_variation_coordinates>`
  635. Returns variation coordinates for the specified font cache entry. See :ref:`Font.get_supported_variation_list()<class_Font_method_get_supported_variation_list>` for more info.
  636. .. rst-class:: classref-item-separator
  637. ----
  638. .. _class_FontFile_method_load_bitmap_font:
  639. .. rst-class:: classref-method
  640. :ref:`Error<enum_@GlobalScope_Error>` **load_bitmap_font**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_load_bitmap_font>`
  641. Loads an AngelCode BMFont (.fnt, .font) bitmap font from file ``path``.
  642. \ **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.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_FontFile_method_load_dynamic_font:
  646. .. rst-class:: classref-method
  647. :ref:`Error<enum_@GlobalScope_Error>` **load_dynamic_font**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_load_dynamic_font>`
  648. Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file ``path``.
  649. \ **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.
  650. .. rst-class:: classref-item-separator
  651. ----
  652. .. _class_FontFile_method_remove_cache:
  653. .. rst-class:: classref-method
  654. |void| **remove_cache**\ (\ cache_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_remove_cache>`
  655. Removes specified font cache entry.
  656. .. rst-class:: classref-item-separator
  657. ----
  658. .. _class_FontFile_method_remove_glyph:
  659. .. rst-class:: classref-method
  660. |void| **remove_glyph**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_remove_glyph>`
  661. Removes specified rendered glyph information from the cache entry.
  662. \ **Note:** This function will not remove textures associated with the glyphs, use :ref:`remove_texture()<class_FontFile_method_remove_texture>` to remove them manually.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_FontFile_method_remove_kerning:
  666. .. rst-class:: classref-method
  667. |void| **remove_kerning**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_remove_kerning>`
  668. Removes kerning override for the pair of glyphs.
  669. .. rst-class:: classref-item-separator
  670. ----
  671. .. _class_FontFile_method_remove_language_support_override:
  672. .. rst-class:: classref-method
  673. |void| **remove_language_support_override**\ (\ language\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_remove_language_support_override>`
  674. Remove language support override.
  675. .. rst-class:: classref-item-separator
  676. ----
  677. .. _class_FontFile_method_remove_script_support_override:
  678. .. rst-class:: classref-method
  679. |void| **remove_script_support_override**\ (\ script\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FontFile_method_remove_script_support_override>`
  680. Removes script support override.
  681. .. rst-class:: classref-item-separator
  682. ----
  683. .. _class_FontFile_method_remove_size_cache:
  684. .. rst-class:: classref-method
  685. |void| **remove_size_cache**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_FontFile_method_remove_size_cache>`
  686. Removes specified font size from the cache entry.
  687. .. rst-class:: classref-item-separator
  688. ----
  689. .. _class_FontFile_method_remove_texture:
  690. .. rst-class:: classref-method
  691. |void| **remove_texture**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_remove_texture>`
  692. Removes specified texture from the cache entry.
  693. \ **Note:** This function will not remove glyphs associated with the texture. Remove them manually using :ref:`remove_glyph()<class_FontFile_method_remove_glyph>`.
  694. .. rst-class:: classref-item-separator
  695. ----
  696. .. _class_FontFile_method_render_glyph:
  697. .. rst-class:: classref-method
  698. |void| **render_glyph**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_render_glyph>`
  699. Renders specified glyph to the font cache texture.
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_FontFile_method_render_range:
  703. .. rst-class:: classref-method
  704. |void| **render_range**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, start\: :ref:`int<class_int>`, end\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_render_range>`
  705. Renders the range of characters to the font cache texture.
  706. .. rst-class:: classref-item-separator
  707. ----
  708. .. _class_FontFile_method_set_cache_ascent:
  709. .. rst-class:: classref-method
  710. |void| **set_cache_ascent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, ascent\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_ascent>`
  711. Sets the font ascent (number of pixels above the baseline).
  712. .. rst-class:: classref-item-separator
  713. ----
  714. .. _class_FontFile_method_set_cache_descent:
  715. .. rst-class:: classref-method
  716. |void| **set_cache_descent**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, descent\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_descent>`
  717. Sets the font descent (number of pixels below the baseline).
  718. .. rst-class:: classref-item-separator
  719. ----
  720. .. _class_FontFile_method_set_cache_scale:
  721. .. rst-class:: classref-method
  722. |void| **set_cache_scale**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, scale\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_scale>`
  723. Sets scaling factor of the color bitmap font.
  724. .. rst-class:: classref-item-separator
  725. ----
  726. .. _class_FontFile_method_set_cache_underline_position:
  727. .. rst-class:: classref-method
  728. |void| **set_cache_underline_position**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_position\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_underline_position>`
  729. Sets pixel offset of the underline below the baseline.
  730. .. rst-class:: classref-item-separator
  731. ----
  732. .. _class_FontFile_method_set_cache_underline_thickness:
  733. .. rst-class:: classref-method
  734. |void| **set_cache_underline_thickness**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, underline_thickness\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_cache_underline_thickness>`
  735. Sets thickness of the underline in pixels.
  736. .. rst-class:: classref-item-separator
  737. ----
  738. .. _class_FontFile_method_set_embolden:
  739. .. rst-class:: classref-method
  740. |void| **set_embolden**\ (\ cache_index\: :ref:`int<class_int>`, strength\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_embolden>`
  741. Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.
  742. .. rst-class:: classref-item-separator
  743. ----
  744. .. _class_FontFile_method_set_extra_baseline_offset:
  745. .. rst-class:: classref-method
  746. |void| **set_extra_baseline_offset**\ (\ cache_index\: :ref:`int<class_int>`, baseline_offset\: :ref:`float<class_float>`\ ) :ref:`🔗<class_FontFile_method_set_extra_baseline_offset>`
  747. Sets extra baseline offset (as a fraction of font height).
  748. .. rst-class:: classref-item-separator
  749. ----
  750. .. _class_FontFile_method_set_extra_spacing:
  751. .. rst-class:: classref-method
  752. |void| **set_extra_spacing**\ (\ cache_index\: :ref:`int<class_int>`, spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`, value\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_set_extra_spacing>`
  753. Sets the spacing for ``spacing`` (see :ref:`SpacingType<enum_TextServer_SpacingType>`) to ``value`` in pixels (not relative to the font size).
  754. .. rst-class:: classref-item-separator
  755. ----
  756. .. _class_FontFile_method_set_face_index:
  757. .. rst-class:: classref-method
  758. |void| **set_face_index**\ (\ cache_index\: :ref:`int<class_int>`, face_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_set_face_index>`
  759. Sets an active face index in the TrueType / OpenType collection.
  760. .. rst-class:: classref-item-separator
  761. ----
  762. .. _class_FontFile_method_set_glyph_advance:
  763. .. rst-class:: classref-method
  764. |void| **set_glyph_advance**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph\: :ref:`int<class_int>`, advance\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_advance>`
  765. Sets glyph advance (offset of the next glyph).
  766. \ **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved.
  767. .. rst-class:: classref-item-separator
  768. ----
  769. .. _class_FontFile_method_set_glyph_offset:
  770. .. rst-class:: classref-method
  771. |void| **set_glyph_offset**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, offset\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_offset>`
  772. Sets glyph offset from the baseline.
  773. .. rst-class:: classref-item-separator
  774. ----
  775. .. _class_FontFile_method_set_glyph_size:
  776. .. rst-class:: classref-method
  777. |void| **set_glyph_size**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, gl_size\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_size>`
  778. Sets glyph size.
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _class_FontFile_method_set_glyph_texture_idx:
  782. .. rst-class:: classref-method
  783. |void| **set_glyph_texture_idx**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, texture_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_texture_idx>`
  784. Sets index of the cache texture containing the glyph.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_FontFile_method_set_glyph_uv_rect:
  788. .. rst-class:: classref-method
  789. |void| **set_glyph_uv_rect**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, glyph\: :ref:`int<class_int>`, uv_rect\: :ref:`Rect2<class_Rect2>`\ ) :ref:`🔗<class_FontFile_method_set_glyph_uv_rect>`
  790. Sets rectangle in the cache texture containing the glyph.
  791. .. rst-class:: classref-item-separator
  792. ----
  793. .. _class_FontFile_method_set_kerning:
  794. .. rst-class:: classref-method
  795. |void| **set_kerning**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`int<class_int>`, glyph_pair\: :ref:`Vector2i<class_Vector2i>`, kerning\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_FontFile_method_set_kerning>`
  796. Sets kerning for the pair of glyphs.
  797. .. rst-class:: classref-item-separator
  798. ----
  799. .. _class_FontFile_method_set_language_support_override:
  800. .. rst-class:: classref-method
  801. |void| **set_language_support_override**\ (\ language\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_FontFile_method_set_language_support_override>`
  802. Adds override for :ref:`Font.is_language_supported()<class_Font_method_is_language_supported>`.
  803. .. rst-class:: classref-item-separator
  804. ----
  805. .. _class_FontFile_method_set_script_support_override:
  806. .. rst-class:: classref-method
  807. |void| **set_script_support_override**\ (\ script\: :ref:`String<class_String>`, supported\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_FontFile_method_set_script_support_override>`
  808. Adds override for :ref:`Font.is_script_supported()<class_Font_method_is_script_supported>`.
  809. .. rst-class:: classref-item-separator
  810. ----
  811. .. _class_FontFile_method_set_texture_image:
  812. .. rst-class:: classref-method
  813. |void| **set_texture_image**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, image\: :ref:`Image<class_Image>`\ ) :ref:`🔗<class_FontFile_method_set_texture_image>`
  814. Sets font cache texture image.
  815. .. rst-class:: classref-item-separator
  816. ----
  817. .. _class_FontFile_method_set_texture_offsets:
  818. .. rst-class:: classref-method
  819. |void| **set_texture_offsets**\ (\ cache_index\: :ref:`int<class_int>`, size\: :ref:`Vector2i<class_Vector2i>`, texture_index\: :ref:`int<class_int>`, offset\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ ) :ref:`🔗<class_FontFile_method_set_texture_offsets>`
  820. Sets array containing glyph packing data.
  821. .. rst-class:: classref-item-separator
  822. ----
  823. .. _class_FontFile_method_set_transform:
  824. .. rst-class:: classref-method
  825. |void| **set_transform**\ (\ cache_index\: :ref:`int<class_int>`, transform\: :ref:`Transform2D<class_Transform2D>`\ ) :ref:`🔗<class_FontFile_method_set_transform>`
  826. Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs.
  827. .. rst-class:: classref-item-separator
  828. ----
  829. .. _class_FontFile_method_set_variation_coordinates:
  830. .. rst-class:: classref-method
  831. |void| **set_variation_coordinates**\ (\ cache_index\: :ref:`int<class_int>`, variation_coordinates\: :ref:`Dictionary<class_Dictionary>`\ ) :ref:`🔗<class_FontFile_method_set_variation_coordinates>`
  832. Sets variation coordinates for the specified font cache entry. See :ref:`Font.get_supported_variation_list()<class_Font_method_get_supported_variation_list>` for more info.
  833. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  834. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  835. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  836. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  837. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  838. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  839. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  840. .. |void| replace:: :abbr:`void (No return value.)`