|
@@ -398,6 +398,17 @@ int Font::get_kerning_pair(CharType p_A,CharType p_B) const {
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void Font::set_distance_field_hint(bool p_distance_field) {
|
|
|
|
+
|
|
|
|
+ distance_field_hint=p_distance_field;
|
|
|
|
+ emit_changed();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool Font::is_distance_field_hint() const{
|
|
|
|
+
|
|
|
|
+ return distance_field_hint;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
void Font::clear() {
|
|
void Font::clear() {
|
|
|
|
|
|
@@ -406,6 +417,7 @@ void Font::clear() {
|
|
char_map.clear();
|
|
char_map.clear();
|
|
textures.clear();
|
|
textures.clear();
|
|
kerning_map.clear();
|
|
kerning_map.clear();
|
|
|
|
+ distance_field_hint=false;
|
|
}
|
|
}
|
|
|
|
|
|
Size2 Font::get_string_size(const String& p_string) const {
|
|
Size2 Font::get_string_size(const String& p_string) const {
|
|
@@ -514,6 +526,9 @@ void Font::_bind_methods() {
|
|
ObjectTypeDB::bind_method(_MD("get_char_size","char","next"),&Font::get_char_size,DEFVAL(0));
|
|
ObjectTypeDB::bind_method(_MD("get_char_size","char","next"),&Font::get_char_size,DEFVAL(0));
|
|
ObjectTypeDB::bind_method(_MD("get_string_size","string"),&Font::get_string_size);
|
|
ObjectTypeDB::bind_method(_MD("get_string_size","string"),&Font::get_string_size);
|
|
|
|
|
|
|
|
+ ObjectTypeDB::bind_method(_MD("set_distance_field_hint","enable"),&Font::set_distance_field_hint);
|
|
|
|
+ ObjectTypeDB::bind_method(_MD("is_distance_field_hint"),&Font::is_distance_field_hint);
|
|
|
|
+
|
|
ObjectTypeDB::bind_method(_MD("clear"),&Font::clear);
|
|
ObjectTypeDB::bind_method(_MD("clear"),&Font::clear);
|
|
|
|
|
|
ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1));
|
|
ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1));
|
|
@@ -535,12 +550,14 @@ void Font::_bind_methods() {
|
|
|
|
|
|
ADD_PROPERTY( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_height"), _SCS("get_height") );
|
|
ADD_PROPERTY( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_height"), _SCS("get_height") );
|
|
ADD_PROPERTY( PropertyInfo( Variant::REAL, "ascent", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_ascent"), _SCS("get_ascent") );
|
|
ADD_PROPERTY( PropertyInfo( Variant::REAL, "ascent", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_ascent"), _SCS("get_ascent") );
|
|
|
|
+ ADD_PROPERTY( PropertyInfo( Variant::BOOL, "distance_field" ), _SCS("set_distance_field_hint"), _SCS("is_distance_field_hint") );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
Font::Font() {
|
|
Font::Font() {
|
|
|
|
|
|
clear();
|
|
clear();
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|