From 57d495f43bb0b4e743cd4c2878a0f75f5931ae72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?CorentinBrul=C3=A9?= Date: Mon, 6 Feb 2023 14:07:35 +0100 Subject: Complete FontFile ref and update example I complete the ref items according to [TextServer ref](https://docs.godotengine.org/en/latest/classes/class_textserver.html) and update example with new properties path --- doc/classes/FontFile.xml | 17 +++++++++++++---- doc/classes/FontVariation.xml | 10 +++++----- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml index 69a7627774..a349c2b7b7 100644 --- a/doc/classes/FontFile.xml +++ b/doc/classes/FontFile.xml @@ -17,13 +17,13 @@ [codeblocks] [gdscript] var f = load("res://BarlowCondensed-Bold.ttf") - $"Label".set("custom_fonts/font", f) - $"Label".set("custom_fonts/font_size", 64) + $Label.add_theme_font_override("font", f) + $Label.add_theme_font_size_override("font_size", 64) [/gdscript] [csharp] var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf"); - GetNode("Label").Set("custom_fonts/font", f); - GetNode("Label").Set("custom_font_sizes/font_size", 64); + GetNode("Label").AddThemeFontOverride("font", f); + GetNode("Label").AddThemeFontSizeOverride("font_size", 64); [/csharp] [/codeblocks] @@ -88,6 +88,7 @@ + Returns the font descent (number of pixels below the baseline). @@ -95,6 +96,7 @@ + Returns scaling factor of the color bitmap font. @@ -102,6 +104,7 @@ + Returns pixel offset of the underline below the baseline. @@ -109,6 +112,7 @@ + Returns thickness of the underline in pixels. @@ -377,6 +381,7 @@ + Sets the font ascent (number of pixels above the baseline). @@ -385,6 +390,7 @@ + Sets the font descent (number of pixels below the baseline). @@ -393,6 +399,7 @@ + Sets scaling factor of the color bitmap font. @@ -401,6 +408,7 @@ + Sets pixel offset of the underline below the baseline. @@ -409,6 +417,7 @@ + Sets thickness of the underline in pixels. diff --git a/doc/classes/FontVariation.xml b/doc/classes/FontVariation.xml index e0fad126b9..5bc2606adb 100644 --- a/doc/classes/FontVariation.xml +++ b/doc/classes/FontVariation.xml @@ -10,16 +10,16 @@ [gdscript] var fv = FontVariation.new() fv.set_base_font(load("res://BarlowCondensed-Regular.ttf")) - fv.set_variation_embolden(1.2); - $"Label".set("custom_fonts/font", fv) - $"Label".set("custom_fonts/font_size", 64) + fv.set_variation_embolden(1.2) + $Label.add_theme_font_override("font", fv) + $Label.add_theme_font_size_override("font_size", 64) [/gdscript] [csharp] var fv = new FontVariation(); fv.SetBaseFont(ResourceLoader.Load<FontFile>("res://BarlowCondensed-Regular.ttf")); fv.SetVariationEmbolden(1.2); - GetNode("Label").Set("custom_fonts/font", fv); - GetNode("Label").Set("custom_font_sizes/font_size", 64); + GetNode("Label").AddThemeFontOverride("font", fv); + GetNode("Label").AddThemeFontSizeOverride("font_size", 64); [/csharp] [/codeblocks] -- cgit v1.2.3