From 673bd79a9ea2e704365cfa3557ba630a5e28ffd7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 3 Dec 2019 09:55:20 +0100 Subject: [PATCH] Improve the DynamicFont class documentation --- doc/classes/DynamicFont.xml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml index 0820d4e1b6d..ac8595d783b 100644 --- a/doc/classes/DynamicFont.xml +++ b/doc/classes/DynamicFont.xml @@ -4,7 +4,8 @@ DynamicFont renders vector font files at runtime. - DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. + DynamicFont renders vector font files (such as TTF or OTF) dynamically at runtime instead of using a prerendered texture atlas like [BitmapFont]. This trades the faster loading time of [BitmapFont]s for the ability to change font parameters like size and spacing during runtime. [DynamicFontData] is used for referencing the font file paths. DynamicFont also supports defining one or more fallbacks fonts, which will be used when displaying a character not supported by the main font. + DynamicFont uses the [url=https://www.freetype.org/]FreeType[/url] library for rasterization. [codeblock] var dynamic_font = DynamicFont.new() dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf") @@ -46,6 +47,7 @@ + Returns the spacing for the given [code]type[/code] (see [enum SpacingType]). @@ -76,6 +78,7 @@ + Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size). @@ -96,17 +99,20 @@ The font data. + The font outline's color. + [b]Note:[/b] It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item. + The font outline's thickness in pixels (not relative to the font size). - The font size. + The font size in pixels. - If [code]true[/code], filtering is used. + If [code]true[/code], filtering is used. This makes the font blurry instead of pixelated when scaling it if font oversampling is disabled or ineffective. It's recommended to enable this when using the font in a control whose size changes over time, unless a pixel art aesthetic is desired. - If [code]true[/code], mipmapping is used. + If [code]true[/code], mipmapping is used. This improves the font's appearance when downscaling it if font oversampling is disabled or ineffective.