Files
godot-docs-l10n/classes/ru/class_font.rst
Rémi Verschelde c3f2364c10 Sync classref with 4.6 branch
Lots of translations invalidated (fuzzied) as we just synced Weblate.
2025-12-19 16:39:51 +01:00

593 lines
90 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_Font:
Font
====
**Наследует:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
**Наследуется от:** :ref:`FontFile<class_FontFile>`, :ref:`FontVariation<class_FontVariation>`, :ref:`SystemFont<class_SystemFont>`
Абстрактный базовый класс для шрифтов и вариаций шрифтов.
.. rst-class:: classref-introduction-group
Описание
----------------
Абстрактный базовый класс для разных типов шрифтов. Имеет методы для рисования текста и интроспекции символов шрифта.
.. rst-class:: classref-reftable-group
Свойства
----------------
.. table::
:widths: auto
+------------------------------------------------------+-------------------------------------------------+--------+
| :ref:`Array<class_Array>`\[:ref:`Font<class_Font>`\] | :ref:`fallbacks<class_Font_property_fallbacks>` | ``[]`` |
+------------------------------------------------------+-------------------------------------------------+--------+
.. rst-class:: classref-reftable-group
Методы
------------
.. table::
:widths: auto
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`draw_char<class_Font_method_draw_char>`\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, char\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`draw_char_outline<class_Font_method_draw_char_outline>`\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, char\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`, size\: :ref:`int<class_int>` = -1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`draw_multiline_string<class_Font_method_draw_multiline_string>`\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, max_lines\: :ref:`int<class_int>` = -1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), brk_flags\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] = 3, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`draw_multiline_string_outline<class_Font_method_draw_multiline_string_outline>`\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, max_lines\: :ref:`int<class_int>` = -1, size\: :ref:`int<class_int>` = 1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), brk_flags\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] = 3, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`draw_string<class_Font_method_draw_string>`\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`draw_string_outline<class_Font_method_draw_string_outline>`\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, size\: :ref:`int<class_int>` = 1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`find_variation<class_Font_method_find_variation>`\ (\ variation_coordinates\: :ref:`Dictionary<class_Dictionary>`, face_index\: :ref:`int<class_int>` = 0, strength\: :ref:`float<class_float>` = 0.0, transform\: :ref:`Transform2D<class_Transform2D>` = Transform2D(1, 0, 0, 1, 0, 0), spacing_top\: :ref:`int<class_int>` = 0, spacing_bottom\: :ref:`int<class_int>` = 0, spacing_space\: :ref:`int<class_int>` = 0, spacing_glyph\: :ref:`int<class_int>` = 0, baseline_offset\: :ref:`float<class_float>` = 0.0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_ascent<class_Font_method_get_ascent>`\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_char_size<class_Font_method_get_char_size>`\ (\ char\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_descent<class_Font_method_get_descent>`\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_face_count<class_Font_method_get_face_count>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_font_name<class_Font_method_get_font_name>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_font_stretch<class_Font_method_get_font_stretch>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] | :ref:`get_font_style<class_Font_method_get_font_style>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_font_style_name<class_Font_method_get_font_style_name>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_font_weight<class_Font_method_get_font_weight>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_height<class_Font_method_get_height>`\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_multiline_string_size<class_Font_method_get_multiline_string_size>`\ (\ text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, max_lines\: :ref:`int<class_int>` = -1, brk_flags\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] = 3, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_opentype_features<class_Font_method_get_opentype_features>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_ot_name_strings<class_Font_method_get_ot_name_strings>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] | :ref:`get_rids<class_Font_method_get_rids>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_spacing<class_Font_method_get_spacing>`\ (\ spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_string_size<class_Font_method_get_string_size>`\ (\ text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_supported_chars<class_Font_method_get_supported_chars>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_supported_feature_list<class_Font_method_get_supported_feature_list>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Dictionary<class_Dictionary>` | :ref:`get_supported_variation_list<class_Font_method_get_supported_variation_list>`\ (\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_underline_position<class_Font_method_get_underline_position>`\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_underline_thickness<class_Font_method_get_underline_thickness>`\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_char<class_Font_method_has_char>`\ (\ char\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_language_supported<class_Font_method_is_language_supported>`\ (\ language\: :ref:`String<class_String>`\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_script_supported<class_Font_method_is_script_supported>`\ (\ script\: :ref:`String<class_String>`\ ) |const| |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_cache_capacity<class_Font_method_set_cache_capacity>`\ (\ single_line\: :ref:`int<class_int>`, multi_line\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Описания свойств
--------------------------------
.. _class_Font_property_fallbacks:
.. rst-class:: classref-property
:ref:`Array<class_Array>`\[:ref:`Font<class_Font>`\] **fallbacks** = ``[]`` :ref:`🔗<class_Font_property_fallbacks>`
.. rst-class:: classref-property-setget
- |void| **set_fallbacks**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`Font<class_Font>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`Font<class_Font>`\] **get_fallbacks**\ (\ )
Массив резервных **Font** для использования в качестве замены, если глиф не найден в текущем **Font**.
Если этот массив пуст в :ref:`FontVariation<class_FontVariation>`, вместо него используются резервные :ref:`FontVariation.base_font<class_FontVariation_property_base_font>`.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Описания метода
------------------------------
.. _class_Font_method_draw_char:
.. rst-class:: classref-method
:ref:`float<class_float>` **draw_char**\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, char\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_draw_char>`
Нарисуйте один символ Unicode ``char`` на элементе холста, используя шрифт, в заданной позиции, с цветом ``modulate``. ``pos`` указывает базовую линию, а не верхнюю. Чтобы рисовать сверху, *ascent* необходимо добавить к оси Y. Если ``oversampling`` больше нуля, он используется как фактор передискретизации шрифта, в противном случае используются настройки передискретизации области просмотра.
\ **Примечание:** Не используйте эту функцию для рисования строк посимвольно, используйте вместо этого :ref:`draw_string()<class_Font_method_draw_string>` или :ref:`TextLine<class_TextLine>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_draw_char_outline:
.. rst-class:: classref-method
:ref:`float<class_float>` **draw_char_outline**\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, char\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`, size\: :ref:`int<class_int>` = -1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_draw_char_outline>`
Нарисуйте контур одного символа Unicode ``char`` в элементе холста, используя шрифт, в заданной позиции, с цветом ``modulate`` и размером контура ``size``. ``pos`` указывает базовую линию, а не верхнюю. Чтобы рисовать сверху, *ascent* необходимо добавить к оси Y. Если ``oversampling`` больше нуля, он используется как фактор передискретизации шрифта, в противном случае используются настройки передискретизации области просмотра.
\ **Примечание:** Не используйте эту функцию для рисования строк посимвольно, вместо этого используйте :ref:`draw_string()<class_Font_method_draw_string>` или :ref:`TextLine<class_TextLine>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_draw_multiline_string:
.. rst-class:: classref-method
|void| **draw_multiline_string**\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, max_lines\: :ref:`int<class_int>` = -1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), brk_flags\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] = 3, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_draw_multiline_string>`
Разбивает ``text`` на строки, используя правила, заданные ``brk_flags``, и рисует его в элементе холста, используя шрифт, в заданной позиции, с цветом ``modulate``, опционально обрезая ширину и выравнивая по горизонтали. ``pos`` указывает базовую линию первой строки, а не верхнюю. Чтобы рисовать сверху, *ascent* необходимо добавить к оси Y. Если ``oversampling`` больше нуля, он используется как фактор передискретизации шрифта, в противном случае используются настройки передискретизации области просмотра.
См. также :ref:`CanvasItem.draw_multiline_string()<class_CanvasItem_method_draw_multiline_string>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_draw_multiline_string_outline:
.. rst-class:: classref-method
|void| **draw_multiline_string_outline**\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, max_lines\: :ref:`int<class_int>` = -1, size\: :ref:`int<class_int>` = 1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), brk_flags\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] = 3, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_draw_multiline_string_outline>`
Разбивает ``text`` на строки, используя правила, заданные ``brk_flags``, и рисует контур текста в элементе холста, используя шрифт, в заданной позиции, с цветом ``modulate`` и размером контура ``size``, опционально обрезая ширину и выравнивая по горизонтали. ``pos`` указывает базовую линию первой строки, а не верх. Чтобы рисовать сверху, *ascent* необходимо добавить к оси Y. Если ``oversampling`` больше нуля, он используется как фактор передискретизации шрифта, в противном случае используются настройки передискретизации области просмотра.
См. также :ref:`CanvasItem.draw_multiline_string_outline()<class_CanvasItem_method_draw_multiline_string_outline>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_draw_string:
.. rst-class:: classref-method
|void| **draw_string**\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_draw_string>`
Нарисуйте ``text`` на элементе холста, используя шрифт, в заданной позиции, с ``modulate`` цветом, опционально обрезав ширину и выровняв по горизонтали. ``pos`` указывает базовую линию, а не верх. Чтобы рисовать сверху, *ascent* необходимо добавить к оси Y. Если ``oversampling`` больше нуля, он используется как фактор передискретизации шрифта, в противном случае используются настройки передискретизации области просмотра.
См. также :ref:`CanvasItem.draw_string()<class_CanvasItem_method_draw_string>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_draw_string_outline:
.. rst-class:: classref-method
|void| **draw_string_outline**\ (\ canvas_item\: :ref:`RID<class_RID>`, pos\: :ref:`Vector2<class_Vector2>`, text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, size\: :ref:`int<class_int>` = 1, modulate\: :ref:`Color<class_Color>` = Color(1, 1, 1, 1), justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0, oversampling\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_draw_string_outline>`
Нарисовать ``text`` контур в элементе холста, используя шрифт, в заданной позиции, с ``modulate`` цветом и ``size`` размером контура, опционально обрезая ширину и выравнивая по горизонтали. ``pos`` указывает базовую линию, а не верх. Чтобы рисовать сверху, *ascent* необходимо добавить к оси Y. Если ``oversampling`` больше нуля, он используется как фактор передискретизации шрифта, в противном случае используются настройки передискретизации области просмотра.
См. также :ref:`CanvasItem.draw_string_outline()<class_CanvasItem_method_draw_string_outline>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_find_variation:
.. rst-class:: classref-method
:ref:`RID<class_RID>` **find_variation**\ (\ variation_coordinates\: :ref:`Dictionary<class_Dictionary>`, face_index\: :ref:`int<class_int>` = 0, strength\: :ref:`float<class_float>` = 0.0, transform\: :ref:`Transform2D<class_Transform2D>` = Transform2D(1, 0, 0, 1, 0, 0), spacing_top\: :ref:`int<class_int>` = 0, spacing_bottom\: :ref:`int<class_int>` = 0, spacing_space\: :ref:`int<class_int>` = 0, spacing_glyph\: :ref:`int<class_int>` = 0, baseline_offset\: :ref:`float<class_float>` = 0.0\ ) |const| :ref:`🔗<class_Font_method_find_variation>`
Возвращает :ref:`TextServer<class_TextServer>` RID кэша шрифтов для определенной вариации.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_ascent:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_ascent**\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| :ref:`🔗<class_Font_method_get_ascent>`
Возвращает средний подъем шрифта (количество пикселей над базовой линией).
\ **Примечание:** Реальный подъем строки зависит от контекста и может значительно отличаться от значения, возвращаемого этой функцией. Используйте его только как грубую оценку (например, как подъем пустой строки).
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_char_size:
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_char_size**\ (\ char\: :ref:`int<class_int>`, font_size\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Font_method_get_char_size>`
Возвращает размер символа. Не учитывает кернинг.
\ **Примечание:** Не используйте эту функцию для вычисления ширины строки символ за символом, вместо этого используйте :ref:`get_string_size()<class_Font_method_get_string_size>` или :ref:`TextLine<class_TextLine>`. Возвращаемая высота — это высота шрифта (см. также :ref:`get_height()<class_Font_method_get_height>`) и не имеет отношения к высоте глифа.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_descent:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_descent**\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| :ref:`🔗<class_Font_method_get_descent>`
Возвращает средний спуск шрифта (количество пикселей ниже базовой линии).
\ **Примечание:** Реальный спуск строки зависит от контекста и может значительно отличаться от значения, возвращаемого этой функцией. Используйте его только как грубую оценку (например, как спуск пустой строки).
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_face_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_face_count**\ (\ ) |const| :ref:`🔗<class_Font_method_get_face_count>`
Возвращает количество шрифтов в коллекции TrueType / OpenType.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_font_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_font_name**\ (\ ) |const| :ref:`🔗<class_Font_method_get_font_name>`
Возвращает имя семейства шрифтов.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_font_stretch:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_font_stretch**\ (\ ) |const| :ref:`🔗<class_Font_method_get_font_stretch>`
Возвращает величину растяжения шрифта по сравнению с нормальной шириной. Процентное значение между ``50%`` и ``200%``.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_font_style:
.. rst-class:: classref-method
|bitfield|\[:ref:`FontStyle<enum_TextServer_FontStyle>`\] **get_font_style**\ (\ ) |const| :ref:`🔗<class_Font_method_get_font_style>`
Возвращает флаги стиля шрифта.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_font_style_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_font_style_name**\ (\ ) |const| :ref:`🔗<class_Font_method_get_font_style_name>`
Возвращает имя стиля шрифта.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_font_weight:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_font_weight**\ (\ ) |const| :ref:`🔗<class_Font_method_get_font_weight>`
Возвращает жирность (начертание) шрифта. Значение в диапазоне ``100...999``, нормальный шрифт — ``400``, жирный шрифт — ``700``.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_height:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_height**\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| :ref:`🔗<class_Font_method_get_height>`
Возвращает общую среднюю высоту шрифта (подъем плюс спуск) в пикселях.
\ **Примечание:** Реальная высота строки зависит от контекста и может значительно отличаться от значения, возвращаемого этой функцией. Используйте ее только как грубую оценку (например, как высоту пустой строки).
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_multiline_string_size:
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_multiline_string_size**\ (\ text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, max_lines\: :ref:`int<class_int>` = -1, brk_flags\: |bitfield|\[:ref:`LineBreakFlag<enum_TextServer_LineBreakFlag>`\] = 3, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0\ ) |const| :ref:`🔗<class_Font_method_get_multiline_string_size>`
Возвращает размер ограничивающего прямоугольника строки, разбитой на строки, с учетом кернинга и продвижения.
См. также :ref:`draw multiline string()<class_Font_method_draw multiline string>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_opentype_features:
.. rst-class:: classref-method
:ref:`Dictionary<class_Dictionary>` **get_opentype_features**\ (\ ) |const| :ref:`🔗<class_Font_method_get_opentype_features>`
Возвращает набор тегов функций OpenType. Дополнительная информация: `Теги функций OpenType <https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags>`__.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_ot_name_strings:
.. rst-class:: classref-method
:ref:`Dictionary<class_Dictionary>` **get_ot_name_strings**\ (\ ) |const| :ref:`🔗<class_Font_method_get_ot_name_strings>`
Возвращает :ref:`Dictionary<class_Dictionary>` со строками названий шрифтов OpenType (локализованные названия шрифтов, версия, описание, информация о лицензии, пример текста и т. д.).
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_rids:
.. rst-class:: classref-method
:ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **get_rids**\ (\ ) |const| :ref:`🔗<class_Font_method_get_rids>`
Возвращает :ref:`Array<class_Array>` допустимых **Font** :ref:`RID<class_RID>`, которые можно передать методам :ref:`TextServer<class_TextServer>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_spacing:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_spacing**\ (\ spacing\: :ref:`SpacingType<enum_TextServer_SpacingType>`\ ) |const| :ref:`🔗<class_Font_method_get_spacing>`
Возвращает величину интервала для заданного типа ``spacing``.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_string_size:
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_string_size**\ (\ text\: :ref:`String<class_String>`, alignment\: :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` = 0, width\: :ref:`float<class_float>` = -1, font_size\: :ref:`int<class_int>` = 16, justification_flags\: |bitfield|\[:ref:`JustificationFlag<enum_TextServer_JustificationFlag>`\] = 3, direction\: :ref:`Direction<enum_TextServer_Direction>` = 0, orientation\: :ref:`Orientation<enum_TextServer_Orientation>` = 0\ ) |const| :ref:`🔗<class_Font_method_get_string_size>`
Возвращает размер ограничивающего прямоугольника однострочной строки с учетом кернинга, продвижения и субпиксельного позиционирования. См. также :ref:`get_multiline_string_size()<class_Font_method_get_multiline_string_size>` и :ref:`draw_string()<class_Font_method_draw_string>`.
Например, чтобы получить размер строки, отображаемый однострочной меткой (Label), используйте:
.. tabs::
.. code-tab:: gdscript
var string_size = $Label.get_theme_font("font").get_string_size($Label.text, HORIZONTAL_ALIGNMENT_LEFT, -1, $Label.get_theme_font_size("font_size"))
.. code-tab:: csharp
Label label = GetNode<Label>("Label");
Vector2 stringSize = label.GetThemeFont("font").GetStringSize(label.Text, HorizontalAlignment.Left, -1, label.GetThemeFontSize("font_size"));
\ **Примечание:** Поскольку кернинг, продвижение и субпиксельное позиционирование учитываются :ref:`get_string_size()<class_Font_method_get_string_size>`, использование отдельных вызовов :ref:`get_string_size()<class_Font_method_get_string_size>` для подстрок строки, а затем сложение результатов вернет другой результат по сравнению с использованием одного вызова :ref:`get_string_size()<class_Font_method_get_string_size>` для всей строки.
\ **Примечание:** Реальная высота строки зависит от контекста и может значительно отличаться от значения, возвращаемого :ref:`get_height()<class_Font_method_get_height>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_supported_chars:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_supported_chars**\ (\ ) |const| :ref:`🔗<class_Font_method_get_supported_chars>`
Возвращает строку, содержащую все символы, доступные в шрифте.
Если заданный символ включен в более чем один источник данных шрифта, он появляется только один раз в возвращаемой строке.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_supported_feature_list:
.. rst-class:: classref-method
:ref:`Dictionary<class_Dictionary>` **get_supported_feature_list**\ (\ ) |const| :ref:`🔗<class_Font_method_get_supported_feature_list>`
Возвращает список функций OpenType, поддерживаемых шрифтом.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_supported_variation_list:
.. rst-class:: classref-method
:ref:`Dictionary<class_Dictionary>` **get_supported_variation_list**\ (\ ) |const| :ref:`🔗<class_Font_method_get_supported_variation_list>`
Возвращает список поддерживаемых `координат вариантов <https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg>`__, каждая координата возвращается как ``tag: Vector3i(min_value,max_value,default_value)``.
Вариации шрифта позволяют непрерывно изменять характеристики глифов вдоль некоторой заданной оси дизайна, такой как толщина, ширина или наклон.
Чтобы распечатать доступные оси вариаций переменного шрифта:
::
var fv = FontVariation.new()
fv.base_font = load("res://RobotoFlex.ttf")
var variation_list = fv.get_supported_variation_list()
for tag in variation_list:
var name = TextServerManager.get_primary_interface().tag_to_name(tag)
var values = variation_list[tag]
print("variation axis: %s (%d)\n\tmin, max, default: %s" % [name, tag, values])
\ **Примечание:** Чтобы задать и получить координаты вариации :ref:`FontVariation<class_FontVariation>`, используйте :ref:`FontVariation.variation_opentype<class_FontVariation_property_variation_opentype>`.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_underline_position:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_underline_position**\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| :ref:`🔗<class_Font_method_get_underline_position>`
Возвращает среднее смещение подчеркивания в пикселях ниже базовой линии.
\ **Примечание:** Реальное положение подчеркивания строки зависит от контекста и может значительно отличаться от значения, возвращаемого этой функцией. Используйте его только как грубую оценку.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_get_underline_thickness:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_underline_thickness**\ (\ font_size\: :ref:`int<class_int>` = 16\ ) |const| :ref:`🔗<class_Font_method_get_underline_thickness>`
Возвращает среднюю толщину подчеркивания.
\ **Примечание:** Реальная толщина подчеркивания строки зависит от контекста и может значительно отличаться от значения, возвращаемого этой функцией. Используйте ее только как грубую оценку.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_has_char:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_char**\ (\ char\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Font_method_has_char>`
Возвращает ``true``, если в шрифте доступен символ Unicode ``char``.
.. rst-class:: classref-item-separator
----
.. _class_Font_method_is_language_supported:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_language_supported**\ (\ language\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Font_method_is_language_supported>`
Returns ``true`` if the font supports the given language (as a `ISO 639 <https://en.wikipedia.org/wiki/ISO_639-1>`__ code).
.. rst-class:: classref-item-separator
----
.. _class_Font_method_is_script_supported:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_script_supported**\ (\ script\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_Font_method_is_script_supported>`
Returns ``true`` if the font supports the given script (as a `ISO 15924 <https://en.wikipedia.org/wiki/ISO_15924>`__ code).
.. rst-class:: classref-item-separator
----
.. _class_Font_method_set_cache_capacity:
.. rst-class:: classref-method
|void| **set_cache_capacity**\ (\ single_line\: :ref:`int<class_int>`, multi_line\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Font_method_set_cache_capacity>`
Устанавливает емкость кэша LRU для методов ``draw_*``.
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (Этот метод не имеет побочных эффектов. Он не изменяет ни одну из переменных-членов экземпляра.)`
.. |vararg| replace:: :abbr:`vararg (Этот метод принимает любое количество аргументов после описанных здесь.)`
.. |constructor| replace:: :abbr:`constructor (Этот метод используется для создания типа.)`
.. |static| replace:: :abbr:`static (Этот метод не нуждается в вызове экземпляра, поэтому его можно вызвать напрямую, используя имя класса.)`
.. |operator| replace:: :abbr:`operator (Этот метод описывает допустимый оператор для использования с этим типом в качестве левого операнда.)`
.. |bitfield| replace:: :abbr:`BitField (Это значение является целым числом, составленным как битовая маска следующих флагов.)`
.. |void| replace:: :abbr:`void (Нет возвращаемого значения.)`