SystemFont

Hereda: Font < Resource < RefCounted < Object

Una fuente cargada desde una fuente del sistema. Recurre a una fuente de tema por defecto si no está implementada en el SO anfitrión.

Descripción

SystemFont loads a font from a system font with the first matching name from font_names.

It will attempt to match font style, but it's not guaranteed.

The returned font might be part of a font collection or be a variable font with OpenType "weight", "width" and/or "italic" features set.

You can create FontVariation of the system font for precise control over its features.

Note: This class is implemented on iOS, Linux, macOS and Windows, on other platforms it will fallback to default theme font.

Propiedades

bool

allow_system_fallback

true

FontAntialiasing

antialiasing

1

bool

disable_embedded_bitmaps

true

bool

font_italic

false

PackedStringArray

font_names

PackedStringArray()

int

font_stretch

100

int

font_weight

400

bool

force_autohinter

false

bool

generate_mipmaps

false

Hinting

hinting

1

bool

keep_rounding_remainders

true

bool

modulate_color_glyphs

false

int

msdf_pixel_range

16

int

msdf_size

48

bool

multichannel_signed_distance_field

false

float

oversampling

0.0

SubpixelPositioning

subpixel_positioning

1


Descripciones de Propiedades

bool allow_system_fallback = true 🔗

  • void set_allow_system_fallback(value: bool)

  • bool is_allow_system_fallback()

Si se establece en true, las fuentes del sistema se pueden utilizar automáticamente como alternativas.


FontAntialiasing antialiasing = 1 🔗

Modo de antialiasing de la fuente.


bool disable_embedded_bitmaps = true 🔗

  • void set_disable_embedded_bitmaps(value: bool)

  • bool get_disable_embedded_bitmaps()

If set to true, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property).


bool font_italic = false 🔗

  • void set_font_italic(value: bool)

  • bool get_font_italic()

Si se establece en true, se prefiere la fuente cursiva u oblicua.


PackedStringArray font_names = PackedStringArray() 🔗

Array de nombres de familias de fuentes a buscar, se utiliza la primera fuente encontrada que coincida.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.


int font_stretch = 100 🔗

  • void set_font_stretch(value: int)

  • int get_font_stretch()

Cantidad de estiramiento de la fuente preferida, en comparación con un ancho normal. Un valor porcentual entre 50% y 200%.


int font_weight = 400 🔗

  • void set_font_weight(value: int)

  • int get_font_weight()

Peso (grosor) preferido de la fuente. Un valor en el rango 100...999, el peso normal de la fuente es 400, el peso de la fuente en negrita es 700.


bool force_autohinter = false 🔗

  • void set_force_autohinter(value: bool)

  • bool is_force_autohinter()

Si se establece como true, se admite y prefiere el hinting automático sobre el hinting incorporado de la fuente.


bool generate_mipmaps = false 🔗

  • void set_generate_mipmaps(value: bool)

  • bool get_generate_mipmaps()

Si se establece en true, se generan mipmaps para las texturas de la fuente.


Hinting hinting = 1 🔗

Modo de sugerencia de fuente.


bool keep_rounding_remainders = true 🔗

  • void set_keep_rounding_remainders(value: bool)

  • bool get_keep_rounding_remainders()

Si se establece en true, al alinear los glifos a los límites de los píxeles, los restos de redondeo se acumulan para asegurar una distribución de glifos más uniforme. Este ajuste no tiene efecto si el posicionamiento subpíxel está habilitado.


bool modulate_color_glyphs = false 🔗

  • void set_modulate_color_glyphs(value: bool)

  • bool is_modulate_color_glyphs()

If set to true, color modulation is applied when drawing colored glyphs, otherwise it's applied to the monochrome glyphs only.


int msdf_pixel_range = 16 🔗

  • void set_msdf_pixel_range(value: int)

  • int get_msdf_pixel_range()

The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, msdf_pixel_range must be set to at least twice the size of the largest font outline. The default msdf_pixel_range value of 16 allows outline sizes up to 8 to look correct.


int msdf_size = 48 🔗

  • void set_msdf_size(value: int)

  • int get_msdf_size()

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.


bool multichannel_signed_distance_field = false 🔗

  • void set_multichannel_signed_distance_field(value: bool)

  • bool is_multichannel_signed_distance_field()

Si se establece en true, los glifos de todos los tamaños se renderizan utilizando un único campo de distancia con signo multicanal generado a partir de los datos vectoriales de la fuente dinámica.


float oversampling = 0.0 🔗

  • void set_oversampling(value: float)

  • float get_oversampling()

If set to a positive value, overrides the oversampling factor of the viewport this font is used in. See Viewport.oversampling. This value doesn't override the oversampling parameter of draw_* methods.


SubpixelPositioning subpixel_positioning = 1 🔗

Modo de posicionamiento de subpíxeles de los glifos de la fuente. El posicionamiento de subpíxeles proporciona un texto más nítido y un mejor kerning para tamaños de fuente más pequeños, a costa del uso de memoria y la velocidad de rasterización de la fuente. Utiliza TextServer.SUBPIXEL_POSITIONING_AUTO para activarlo automáticamente según el tamaño de la fuente.