summaryrefslogtreecommitdiff
path: root/doc/classes/Font.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Font.xml')
-rw-r--r--doc/classes/Font.xml219
1 files changed, 73 insertions, 146 deletions
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index 186bfbb931..06dcaca846 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -64,188 +64,131 @@
</tutorials>
<methods>
<method name="add_data">
- <return type="void">
- </return>
- <argument index="0" name="data" type="FontData">
- </argument>
+ <return type="void" />
+ <argument index="0" name="data" type="FontData" />
<description>
Add font data source to the set.
</description>
</method>
<method name="draw_char" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="canvas_item" type="RID">
- </argument>
- <argument index="1" name="pos" type="Vector2">
- </argument>
- <argument index="2" name="char" type="int">
- </argument>
- <argument index="3" name="next" type="int" default="0">
- </argument>
- <argument index="4" name="size" type="int" default="-1">
- </argument>
- <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)">
- </argument>
- <argument index="6" name="outline_size" type="int" default="0">
- </argument>
- <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)">
- </argument>
+ <return type="float" />
+ <argument index="0" name="canvas_item" type="RID" />
+ <argument index="1" name="pos" type="Vector2" />
+ <argument index="2" name="char" type="int" />
+ <argument index="3" name="next" type="int" default="0" />
+ <argument index="4" name="size" type="int" default="-1" />
+ <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
+ <argument index="6" name="outline_size" type="int" default="0" />
+ <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" />
<description>
Draw a single Unicode 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. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
[b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead.
</description>
</method>
<method name="draw_multiline_string" qualifiers="const">
- <return type="void">
- </return>
- <argument index="0" name="canvas_item" type="RID">
- </argument>
- <argument index="1" name="pos" type="Vector2">
- </argument>
- <argument index="2" name="text" type="String">
- </argument>
- <argument index="3" name="align" type="int" enum="HAlign" default="0">
- </argument>
- <argument index="4" name="width" type="float" default="-1">
- </argument>
- <argument index="5" name="max_lines" type="int" default="-1">
- </argument>
- <argument index="6" name="size" type="int" default="-1">
- </argument>
- <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)">
- </argument>
- <argument index="8" name="outline_size" type="int" default="0">
- </argument>
- <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)">
- </argument>
- <argument index="10" name="flags" type="int" default="51">
- </argument>
+ <return type="void" />
+ <argument index="0" name="canvas_item" type="RID" />
+ <argument index="1" name="pos" type="Vector2" />
+ <argument index="2" name="text" type="String" />
+ <argument index="3" name="align" type="int" enum="HAlign" default="0" />
+ <argument index="4" name="width" type="float" default="-1" />
+ <argument index="5" name="max_lines" type="int" default="-1" />
+ <argument index="6" name="size" type="int" default="-1" />
+ <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
+ <argument index="8" name="outline_size" type="int" default="0" />
+ <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" />
+ <argument index="10" name="flags" type="int" default="51" />
<description>
Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
See also [method CanvasItem.draw_multiline_string].
</description>
</method>
<method name="draw_string" qualifiers="const">
- <return type="void">
- </return>
- <argument index="0" name="canvas_item" type="RID">
- </argument>
- <argument index="1" name="pos" type="Vector2">
- </argument>
- <argument index="2" name="text" type="String">
- </argument>
- <argument index="3" name="align" type="int" enum="HAlign" default="0">
- </argument>
- <argument index="4" name="width" type="float" default="-1">
- </argument>
- <argument index="5" name="size" type="int" default="-1">
- </argument>
- <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)">
- </argument>
- <argument index="7" name="outline_size" type="int" default="0">
- </argument>
- <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)">
- </argument>
- <argument index="9" name="flags" type="int" default="3">
- </argument>
+ <return type="void" />
+ <argument index="0" name="canvas_item" type="RID" />
+ <argument index="1" name="pos" type="Vector2" />
+ <argument index="2" name="text" type="String" />
+ <argument index="3" name="align" type="int" enum="HAlign" default="0" />
+ <argument index="4" name="width" type="float" default="-1" />
+ <argument index="5" name="size" type="int" default="-1" />
+ <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
+ <argument index="7" name="outline_size" type="int" default="0" />
+ <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" />
+ <argument index="9" name="flags" type="int" default="3" />
<description>
Draw [code]text[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
See also [method CanvasItem.draw_string].
</description>
</method>
<method name="get_ascent" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="size" type="int" default="-1">
- </argument>
+ <return type="float" />
+ <argument index="0" name="size" type="int" default="-1" />
<description>
Returns the average font ascent (number of pixels above the baseline).
[b]Note:[/b] Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line).
</description>
</method>
<method name="get_char_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="char" type="int">
- </argument>
- <argument index="1" name="next" type="int" default="0">
- </argument>
- <argument index="2" name="size" type="int" default="-1">
- </argument>
+ <return type="Vector2" />
+ <argument index="0" name="char" type="int" />
+ <argument index="1" name="next" type="int" default="0" />
+ <argument index="2" name="size" type="int" default="-1" />
<description>
Returns the size of a character, optionally taking kerning into account if the next character is provided.
[b]Note:[/b] Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead. The height returned is the font height (see also [method get_height]) and has no relation to the glyph height.
</description>
</method>
<method name="get_data" qualifiers="const">
- <return type="FontData">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
+ <return type="FontData" />
+ <argument index="0" name="idx" type="int" />
<description>
Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code].
</description>
</method>
<method name="get_data_count" qualifiers="const">
- <return type="int">
- </return>
+ <return type="int" />
<description>
Returns the number of font data sources.
</description>
</method>
<method name="get_descent" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="size" type="int" default="-1">
- </argument>
+ <return type="float" />
+ <argument index="0" name="size" type="int" default="-1" />
<description>
Returns the average font descent (number of pixels below the baseline).
[b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line).
</description>
</method>
<method name="get_height" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="size" type="int" default="-1">
- </argument>
+ <return type="float" />
+ <argument index="0" name="size" type="int" default="-1" />
<description>
Returns the total average font height (ascent plus descent) in pixels.
[b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line).
</description>
</method>
<method name="get_multiline_string_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="text" type="String">
- </argument>
- <argument index="1" name="width" type="float" default="-1">
- </argument>
- <argument index="2" name="size" type="int" default="-1">
- </argument>
- <argument index="3" name="flags" type="int" default="48">
- </argument>
+ <return type="Vector2" />
+ <argument index="0" name="text" type="String" />
+ <argument index="1" name="width" type="float" default="-1" />
+ <argument index="2" name="size" type="int" default="-1" />
+ <argument index="3" name="flags" type="int" default="48" />
<description>
Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account.
See also [method draw_multiline_string].
</description>
</method>
<method name="get_spacing" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="type" type="int">
- </argument>
+ <return type="int" />
+ <argument index="0" name="type" type="int" />
<description>
Returns the spacing for the given [code]type[/code] (see [enum SpacingType]).
</description>
</method>
<method name="get_string_size" qualifiers="const">
- <return type="Vector2">
- </return>
- <argument index="0" name="text" type="String">
- </argument>
- <argument index="1" name="size" type="int" default="-1">
- </argument>
+ <return type="Vector2" />
+ <argument index="0" name="text" type="String" />
+ <argument index="1" name="size" type="int" default="-1" />
<description>
Returns the size of a bounding box of a string, taking kerning and advance into account.
[b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height].
@@ -253,76 +196,60 @@
</description>
</method>
<method name="get_supported_chars" qualifiers="const">
- <return type="String">
- </return>
+ <return type="String" />
<description>
Returns a string containing all the characters available in the font.
If a given character is included in more than one font data source, it appears only once in the returned string.
</description>
</method>
<method name="get_underline_position" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="size" type="int" default="-1">
- </argument>
+ <return type="float" />
+ <argument index="0" name="size" type="int" default="-1" />
<description>
Return average pixel offset of the underline below the baseline.
[b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate.
</description>
</method>
<method name="get_underline_thickness" qualifiers="const">
- <return type="float">
- </return>
- <argument index="0" name="size" type="int" default="-1">
- </argument>
+ <return type="float" />
+ <argument index="0" name="size" type="int" default="-1" />
<description>
Return average thickness of the underline.
[b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate.
</description>
</method>
<method name="has_char" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="char" type="int">
- </argument>
+ <return type="bool" />
+ <argument index="0" name="char" type="int" />
<description>
Return [code]true[/code] if a Unicode [code]char[/code] is available in the font.
</description>
</method>
<method name="remove_data">
- <return type="void">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
+ <return type="void" />
+ <argument index="0" name="idx" type="int" />
<description>
Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
</description>
</method>
<method name="set_data">
- <return type="void">
- </return>
- <argument index="0" name="idx" type="int">
- </argument>
- <argument index="1" name="data" type="FontData">
- </argument>
+ <return type="void" />
+ <argument index="0" name="idx" type="int" />
+ <argument index="1" name="data" type="FontData" />
<description>
Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens.
</description>
</method>
<method name="set_spacing">
- <return type="void">
- </return>
- <argument index="0" name="type" type="int">
- </argument>
- <argument index="1" name="value" type="int">
- </argument>
+ <return type="void" />
+ <argument index="0" name="type" type="int" />
+ <argument index="1" name="value" type="int" />
<description>
Sets the spacing for [code]type[/code] (see [enum SpacingType]) to [code]value[/code] in pixels (not relative to the font size).
</description>
</method>
<method name="update_changes">
- <return type="void">
- </return>
+ <return type="void" />
<description>
After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it.
</description>