From a4413710f9418bd5a5ab83ac3ed70b1329cb2492 Mon Sep 17 00:00:00 2001 From: Maganty Rushyendra Date: Wed, 27 May 2020 17:21:35 +0800 Subject: Expose `get_char_size()` from Font instead of BitmapFont `get_char_size()` is a public virtual function defined in the `Font` class. Implementations exist for both `BitmapFont` and `Dynamic Font`. However, it was only exposed to the GDScript API through the Bitmap Font, and not for Dynamic Font. This commit exposes the function through `Font` instead. Fixes #23967 --- scene/resources/font.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scene') 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); -- cgit v1.2.3