0.2.0-dev Download ZIP
68 lines ·5.7 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="SystemFont" inherits="Font" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | A font loaded from a system font. Falls back to a default theme font if not implemented on the host OS. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | [SystemFont] loads a font from a system font with the first matching name from [member font_names]. |
| 8 | It will attempt to match font style, but it's not guaranteed. |
| 9 | The returned font might be part of a font collection or be a variable font with OpenType "weight", "width" and/or "italic" features set. |
| 10 | You can create [FontVariation] of the system font for precise control over its features. |
| 11 | [b]Note:[/b] This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font. |
| 12 | </description> |
| 13 | <tutorials> |
| 14 | </tutorials> |
| 15 | <members> |
| 16 | <member name="allow_system_fallback" type="bool" setter="set_allow_system_fallback" getter="is_allow_system_fallback" default="true"> |
| 17 | If set to [code]true[/code], system fonts can be automatically used as fallbacks. |
| 18 | </member> |
| 19 | <member name="antialiasing" type="int" setter="set_antialiasing" getter="get_antialiasing" enum="TextServer.FontAntialiasing" default="1"> |
| 20 | Font anti-aliasing mode. |
| 21 | </member> |
| 22 | <member name="disable_embedded_bitmaps" type="bool" setter="set_disable_embedded_bitmaps" getter="get_disable_embedded_bitmaps" default="true"> |
| 23 | If set to [code]true[/code], embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property). |
| 24 | </member> |
| 25 | <member name="font_italic" type="bool" setter="set_font_italic" getter="get_font_italic" default="false"> |
| 26 | If set to [code]true[/code], italic or oblique font is preferred. |
| 27 | </member> |
| 28 | <member name="font_names" type="PackedStringArray" setter="set_font_names" getter="get_font_names" default="PackedStringArray()"> |
| 29 | Array of font family names to search, first matching font found is used. |
| 30 | </member> |
| 31 | <member name="font_stretch" type="int" setter="set_font_stretch" getter="get_font_stretch" default="100"> |
| 32 | Preferred font stretch amount, compared to a normal width. A percentage value between [code]50%[/code] and [code]200%[/code]. |
| 33 | </member> |
| 34 | <member name="font_weight" type="int" setter="set_font_weight" getter="get_font_weight" default="400"> |
| 35 | Preferred weight (boldness) of the font. A value in the [code]100...999[/code] range, normal font weight is [code]400[/code], bold font weight is [code]700[/code]. |
| 36 | </member> |
| 37 | <member name="force_autohinter" type="bool" setter="set_force_autohinter" getter="is_force_autohinter" default="false"> |
| 38 | If set to [code]true[/code], auto-hinting is supported and preferred over font built-in hinting. |
| 39 | </member> |
| 40 | <member name="generate_mipmaps" type="bool" setter="set_generate_mipmaps" getter="get_generate_mipmaps" default="false"> |
| 41 | If set to [code]true[/code], generate mipmaps for the font textures. |
| 42 | </member> |
| 43 | <member name="hinting" type="int" setter="set_hinting" getter="get_hinting" enum="TextServer.Hinting" default="1"> |
| 44 | Font hinting mode. |
| 45 | </member> |
| 46 | <member name="keep_rounding_remainders" type="bool" setter="set_keep_rounding_remainders" getter="get_keep_rounding_remainders" default="true"> |
| 47 | If set to [code]true[/code], 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. |
| 48 | </member> |
| 49 | <member name="modulate_color_glyphs" type="bool" setter="set_modulate_color_glyphs" getter="is_modulate_color_glyphs" default="false"> |
| 50 | If set to [code]true[/code], color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only. |
| 51 | </member> |
| 52 | <member name="msdf_pixel_range" type="int" setter="set_msdf_pixel_range" getter="get_msdf_pixel_range" default="16"> |
| 53 | The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least [i]twice[/i] the size of the largest font outline. The default [member msdf_pixel_range] value of [code]16[/code] allows outline sizes up to [code]8[/code] to look correct. |
| 54 | </member> |
| 55 | <member name="msdf_size" type="int" setter="set_msdf_size" getter="get_msdf_size" default="48"> |
| 56 | 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. |
| 57 | </member> |
| 58 | <member name="multichannel_signed_distance_field" type="bool" setter="set_multichannel_signed_distance_field" getter="is_multichannel_signed_distance_field" default="false"> |
| 59 | If set to [code]true[/code], glyphs of all sizes are rendered using single multichannel signed distance field generated from the dynamic font vector data. |
| 60 | </member> |
| 61 | <member name="oversampling" type="float" setter="set_oversampling" getter="get_oversampling" default="0.0"> |
| 62 | If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See [member Viewport.oversampling]. This value doesn't override the [code skip-lint]oversampling[/code] parameter of [code skip-lint]draw_*[/code] methods. |
| 63 | </member> |
| 64 | <member name="subpixel_positioning" type="int" setter="set_subpixel_positioning" getter="get_subpixel_positioning" enum="TextServer.SubpixelPositioning" default="1"> |
| 65 | Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size. |
| 66 | </member> |
| 67 | </members> |
| 68 | </class> |