Merge pull request #27724 from follower/patch-2

Add example of loading a font from .ttf file
This commit is contained in:
Hein-Pieter van Braam 2019-04-23 06:04:25 +03:00 committed by GitHub
commit 2779bdf557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,12 @@
</brief_description>
<description>
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.
[codeblock]
var dynamic_font = DynamicFont.new()
dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf")
dynamic_font.size = 64
$"Label".set("custom_fonts/font", dynamic_font)
[/codeblock]
</description>
<tutorials>
</tutorials>