class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCountedResourceFont FontVariation
A variation of a font with additional settings.
Provides OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing.
To use simulated bold font variant:
var fv = FontVariation.new() fv.base_font = load("res://BarlowCondensed-Regular.ttf") fv.variation_embolden = 1.2 $Label.add_theme_font_override("font", fv) $Label.add_theme_font_size_override("font_size", 64)
var fv = new FontVariation(); fv.SetBaseFont(ResourceLoader.Load<FontFile>("res://BarlowCondensed-Regular.ttf")); fv.SetVariationEmbolden(1.2); GetNode("Label").AddThemeFontOverride("font", fv); GetNode("Label").AddThemeFontSizeOverride("font_size", 64);

To set the coordinate of multiple variation axes:
var fv = FontVariation.new(); var ts = TextServerManager.get_primary_interface() fv.base_font = load("res://BarlowCondensed-Regular.ttf") fv.variation_opentype = { ts.name_to_tag("wght"): 900, ts.name_to_tag("custom_hght"): 900 }
set get Font base_font<>():Font set get
Base font used to create a variation. If not set, default Theme font is used.

set get float baseline_offset<>():float set get
Extra baseline offset (as a fraction of font height).

set get Dictionary opentype_features<>():Dictionary set get
A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url].

set get PackedColorArray palette_custom_colors<>():PackedColorArray set get
An array of colors to override predefined palette. Use Color(0, 0, 0, 0), to keep predefined palette color at specific position.

set get int palette_index<>():int set get
A palette index.

set get int spacing_bottom<>():int set get
Extra spacing at the bottom of the line in pixels.

set get int spacing_glyph<>():int set get
Extra spacing between graphical glyphs.

set get int spacing_space<>():int set get
Extra width of the space glyphs.

set get int spacing_top<>():int set get
Extra spacing at the top of the line in pixels.

set get float variation_embolden<>():float set get
If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness.

Note: Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and TextMesh from working correctly.
set get int variation_face_index<>():int set get
Active face index in the TrueType / OpenType collection file.

set get Dictionary variation_opentype<>():Dictionary set get
Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url].

Note: This Dictionary uses OpenType tags as keys. Variation axes can be identified both by tags (int, e.g. 0x77678674) and names (String, e.g. wght). Some axes might be accessible by multiple names. For example, wght refers to the same axis as weight. Tags on the other hand are unique. To convert between names and tags, use [method TextServer.name_to_tag] and [method TextServer.tag_to_name].
Note: To get available variation axes of a font, use [method Font.get_supported_variation_list].
set get Transform2D variation_transform<>():Transform2D set get
2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs.

For example, to simulate italic typeface by slanting, apply the following transform Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0).
void set_spacing<>( int spacing=, spacing:int=, int value=, value:int=, ):void
Sets the spacing for spacing to value in pixels (not relative to the font size).




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...