2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2019-04-01 12:33:56 +02:00
<class name= "Font" inherits= "Resource" category= "Core" version= "3.2" >
2017-09-12 22:42:36 +02:00
<brief_description >
Internationalized font and text drawing support.
</brief_description>
<description >
2019-06-22 01:04:47 +02:00
Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts.
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "draw" qualifiers= "const" >
<return type= "void" >
</return>
<argument index= "0" name= "canvas_item" type= "RID" >
</argument>
2017-09-10 15:37:49 +02:00
<argument index= "1" name= "position" type= "Vector2" >
2017-09-12 22:42:36 +02:00
</argument>
<argument index= "2" name= "string" type= "String" >
</argument>
<argument index= "3" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
<argument index= "4" name= "clip_w" type= "int" default= "-1" >
</argument>
2018-05-12 09:38:00 +02:00
<argument index= "5" name= "outline_modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Draw [code]string[/code] into a canvas item using the font at a given position, with [code]modulate[/code] color, and optionally clipping the width. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "draw_char" qualifiers= "const" >
<return type= "float" >
</return>
<argument index= "0" name= "canvas_item" type= "RID" >
</argument>
2017-09-10 15:37:49 +02:00
<argument index= "1" name= "position" type= "Vector2" >
2017-09-12 22:42:36 +02:00
</argument>
<argument index= "2" name= "char" type= "int" >
</argument>
<argument index= "3" name= "next" type= "int" default= "-1" >
</argument>
<argument index= "4" name= "modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
</argument>
2018-05-12 09:38:00 +02:00
<argument index= "5" name= "outline" type= "bool" default= "false" >
</argument>
2017-09-12 22:42:36 +02:00
<description >
2019-06-22 01:04:47 +02:00
Draw character [code]char[/code] into a canvas item using the font at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. clipping the width. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_ascent" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2019-05-24 04:15:43 +02:00
Returns the font ascent (number of pixels above the baseline).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_descent" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2019-05-24 04:15:43 +02:00
Returns the font descent (number of pixels below the baseline).
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_height" qualifiers= "const" >
<return type= "float" >
</return>
<description >
2019-05-24 04:15:43 +02:00
Returns the total font height (ascent plus descent) in pixels.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "get_string_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "string" type= "String" >
</argument>
<description >
2019-05-24 04:15:43 +02:00
Returns the size of a string, taking kerning and advance into account.
2017-09-12 22:42:36 +02:00
</description>
</method>
2019-05-15 12:51:58 +02:00
<method name= "get_wordwrap_string_size" qualifiers= "const" >
<return type= "Vector2" >
</return>
<argument index= "0" name= "string" type= "String" >
</argument>
2019-09-27 22:16:32 +02:00
<argument index= "1" name= "width" type= "float" >
2019-05-15 12:51:58 +02:00
</argument>
<description >
</description>
</method>
2018-05-12 09:38:00 +02:00
<method name= "has_outline" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "is_distance_field_hint" qualifiers= "const" >
<return type= "bool" >
</return>
<description >
</description>
</method>
<method name= "update_changes" >
<return type= "void" >
</return>
<description >
After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it.
</description>
</method>
</methods>
<constants >
</constants>
</class>