diff options
Diffstat (limited to 'scene/resources/font.cpp')
-rw-r--r-- | scene/resources/font.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index f6e224aca0..c4b5834ad5 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -980,6 +980,7 @@ void FontFile::_bind_methods() { ClassDB::bind_method(D_METHOD("get_opentype_feature_overrides"), &FontFile::get_opentype_feature_overrides); ClassDB::bind_method(D_METHOD("get_glyph_index", "size", "char", "variation_selector"), &FontFile::get_glyph_index); + ClassDB::bind_method(D_METHOD("get_char_from_glyph_index", "size", "glyph_index"), &FontFile::get_char_from_glyph_index); ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_data", "get_data"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "generate_mipmaps", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_generate_mipmaps", "get_generate_mipmaps"); @@ -2591,6 +2592,11 @@ int32_t FontFile::get_glyph_index(int p_size, char32_t p_char, char32_t p_variat return TS->font_get_glyph_index(cache[0], p_size, p_char, p_variation_selector); } +char32_t FontFile::get_char_from_glyph_index(int p_size, int32_t p_glyph_index) const { + _ensure_rid(0); + return TS->font_get_char_from_glyph_index(cache[0], p_size, p_glyph_index); +} + FontFile::FontFile() { } |