diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-27 12:53:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 12:53:24 +0200 |
commit | c10dab134afe1e4540fbb01d78fc0cf6a4dbbe26 (patch) | |
tree | 88bac5f5c91190d48e5f51f31fedd0afe21697fc | |
parent | a5a7f5f73e803d444303e7e077354abd3bdf41f7 (diff) | |
parent | a4413710f9418bd5a5ab83ac3ed70b1329cb2492 (diff) |
Merge pull request #39079 from mrushyendra/exposeGetCharSize
Expose `get_char_size()` from Font instead of BitmapFont
-rw-r--r-- | doc/classes/BitmapFont.xml | 11 | ||||
-rw-r--r-- | doc/classes/Font.xml | 11 | ||||
-rw-r--r-- | scene/resources/font.cpp | 3 |
3 files changed, 12 insertions, 13 deletions
diff --git a/doc/classes/BitmapFont.xml b/doc/classes/BitmapFont.xml index 421b405808..87cffdaca0 100644 --- a/doc/classes/BitmapFont.xml +++ b/doc/classes/BitmapFont.xml @@ -65,17 +65,6 @@ Creates a BitmapFont from the [code]*.fnt[/code] file at [code]path[/code]. </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> - <description> - Returns the size of a character, optionally taking kerning into account if the next character is provided. - </description> - </method> <method name="get_kerning_pair" qualifiers="const"> <return type="int"> </return> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index 882f819e37..30b8c1fe76 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -54,6 +54,17 @@ Returns the font ascent (number of pixels above the baseline). </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> + <description> + Returns the size of a character, optionally taking kerning into account if the next character is provided. + </description> + </method> <method name="get_descent" qualifiers="const"> <return type="float"> </return> diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 1878b174e8..ccab88a153 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -93,6 +93,7 @@ void Font::_bind_methods() { ClassDB::bind_method(D_METHOD("get_descent"), &Font::get_descent); ClassDB::bind_method(D_METHOD("get_height"), &Font::get_height); ClassDB::bind_method(D_METHOD("is_distance_field_hint"), &Font::is_distance_field_hint); + ClassDB::bind_method(D_METHOD("get_char_size", "char", "next"), &Font::get_char_size, DEFVAL(0)); ClassDB::bind_method(D_METHOD("get_string_size", "string"), &Font::get_string_size); ClassDB::bind_method(D_METHOD("get_wordwrap_string_size", "string", "width"), &Font::get_wordwrap_string_size); ClassDB::bind_method(D_METHOD("has_outline"), &Font::has_outline); @@ -596,8 +597,6 @@ void BitmapFont::_bind_methods() { ClassDB::bind_method(D_METHOD("get_texture_count"), &BitmapFont::get_texture_count); ClassDB::bind_method(D_METHOD("get_texture", "idx"), &BitmapFont::get_texture); - ClassDB::bind_method(D_METHOD("get_char_size", "char", "next"), &BitmapFont::get_char_size, DEFVAL(0)); - ClassDB::bind_method(D_METHOD("set_distance_field_hint", "enable"), &BitmapFont::set_distance_field_hint); ClassDB::bind_method(D_METHOD("clear"), &BitmapFont::clear); |