diff options
Diffstat (limited to 'scene/resources/dynamic_font.cpp')
-rw-r--r-- | scene/resources/dynamic_font.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index fce697a0ea..8ee9879055 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -281,18 +281,6 @@ const Pair<const DynamicFontAtSize::Character *, DynamicFontAtSize *> DynamicFon return Pair<const Character *, DynamicFontAtSize *>(chr, const_cast<DynamicFontAtSize *>(this)); } -float DynamicFontAtSize::_get_kerning_advance(const DynamicFontAtSize *font, CharType p_char, CharType p_next) const { - float advance = 0.0; - - if (p_next) { - FT_Vector delta; - FT_Get_Kerning(font->face, p_char, p_next, FT_KERNING_DEFAULT, &delta); - advance = (delta.x / 64.0) / oversampling; - } - - return advance; -} - Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const { if (!valid) @@ -301,7 +289,6 @@ Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const V Pair<const Character *, DynamicFontAtSize *> char_pair_with_font = _find_char_with_font(p_char, p_fallbacks); const Character *ch = char_pair_with_font.first; - DynamicFontAtSize *font = char_pair_with_font.second; ERR_FAIL_COND_V(!ch, Size2()); Size2 ret(0, get_height()); @@ -309,7 +296,6 @@ Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const V if (ch->found) { ret.x = ch->advance; } - ret.x += _get_kerning_advance(font, p_char, p_next); return ret; } @@ -358,8 +344,6 @@ float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharT advance = ch->advance; } - advance += _get_kerning_advance(font, p_char, p_next); - return advance; } @@ -1024,8 +1008,8 @@ void DynamicFont::_bind_methods() { ClassDB::bind_method(D_METHOD("get_fallback_count"), &DynamicFont::get_fallback_count); ADD_GROUP("Settings", ""); - ADD_PROPERTY(PropertyInfo(Variant::INT, "size"), "set_size", "get_size"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size"), "set_outline_size", "get_outline_size"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "size", PROPERTY_HINT_RANGE, "1,255,1"), "set_size", "get_size"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,255,1"), "set_outline_size", "get_outline_size"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "outline_color"), "set_outline_color", "get_outline_color"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_mipmaps"), "set_use_mipmaps", "get_use_mipmaps"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_filter"), "set_use_filter", "get_use_filter"); |