1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Merge pull request #46045 from bruvzg/text_server_bmp_create

[TextServer] Restores bitmap font dynamic construction functions.
This commit is contained in:
Rémi Verschelde
2021-02-24 12:55:36 +01:00
committed by GitHub
20 changed files with 415 additions and 142 deletions

View File

@@ -11,6 +11,45 @@
<tutorials>
</tutorials>
<methods>
<method name="bitmap_add_char">
<return type="void">
</return>
<argument index="0" name="char" type="int">
</argument>
<argument index="1" name="texture_idx" type="int">
</argument>
<argument index="2" name="rect" type="Rect2">
</argument>
<argument index="3" name="align" type="Vector2">
</argument>
<argument index="4" name="advance" type="float">
</argument>
<description>
Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
</description>
</method>
<method name="bitmap_add_kerning_pair">
<return type="void">
</return>
<argument index="0" name="A" type="int">
</argument>
<argument index="1" name="B" type="int">
</argument>
<argument index="2" name="kerning" type="int">
</argument>
<description>
Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
</description>
</method>
<method name="bitmap_add_texture">
<return type="void">
</return>
<argument index="0" name="texture" type="Texture">
</argument>
<description>
Adds a texture to the bitmap font.
</description>
</method>
<method name="draw_glyph" qualifiers="const">
<return type="Vector2">
</return>
@@ -265,6 +304,19 @@
Note: For non-scalable fonts [code]base_size[/code] is ignored, use [method get_base_size] to check actual font size.
</description>
</method>
<method name="new_bitmap">
<return type="void">
</return>
<argument index="0" name="height" type="float">
</argument>
<argument index="1" name="ascent" type="float">
</argument>
<argument index="2" name="base_size" type="int">
</argument>
<description>
Creates new, empty bitmap font.
</description>
</method>
<method name="remove_language_support_override">
<return type="void">
</return>

View File

@@ -9,6 +9,19 @@
<tutorials>
</tutorials>
<methods>
<method name="create_font_bitmap">
<return type="RID">
</return>
<argument index="0" name="height" type="float">
</argument>
<argument index="1" name="ascent" type="float">
</argument>
<argument index="2" name="base_size" type="int">
</argument>
<description>
Creates new, empty bitmap font. To free the resulting font, use [method free_rid] method.
</description>
</method>
<method name="create_font_memory">
<return type="RID">
</return>
@@ -78,6 +91,51 @@
Draws box displaying character hexadecimal code. Used for replacing missing characters.
</description>
</method>
<method name="font_bitmap_add_char">
<return type="void">
</return>
<argument index="0" name="font" type="RID">
</argument>
<argument index="1" name="char" type="int">
</argument>
<argument index="2" name="texture_idx" type="int">
</argument>
<argument index="3" name="rect" type="Rect2">
</argument>
<argument index="4" name="align" type="Vector2">
</argument>
<argument index="5" name="advance" type="float">
</argument>
<description>
Adds a character to the font, where [code]character[/code] is the Unicode value, [code]texture[/code] is the texture index, [code]rect[/code] is the region in the texture (in pixels!), [code]align[/code] is the (optional) alignment for the character and [code]advance[/code] is the (optional) advance.
</description>
</method>
<method name="font_bitmap_add_kerning_pair">
<return type="void">
</return>
<argument index="0" name="font" type="RID">
</argument>
<argument index="1" name="A" type="int">
</argument>
<argument index="2" name="B" type="int">
</argument>
<argument index="3" name="kerning" type="int">
</argument>
<description>
Adds a kerning pair to the bitmap font as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character.
</description>
</method>
<method name="font_bitmap_add_texture">
<return type="void">
</return>
<argument index="0" name="font" type="RID">
</argument>
<argument index="1" name="texture" type="Texture">
</argument>
<description>
Adds a texture to the bitmap font.
</description>
</method>
<method name="font_draw_glyph" qualifiers="const">
<return type="Vector2">
</return>