|
@@ -50,6 +50,9 @@ void FontData::_bind_methods() {
|
|
|
ClassDB::bind_method(D_METHOD("get_underline_position", "size"), &FontData::get_underline_position);
|
|
|
ClassDB::bind_method(D_METHOD("get_underline_thickness", "size"), &FontData::get_underline_thickness);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("get_spacing", "type"), &FontData::get_spacing);
|
|
|
+ ClassDB::bind_method(D_METHOD("set_spacing", "type", "value"), &FontData::set_spacing);
|
|
|
+
|
|
|
ClassDB::bind_method(D_METHOD("set_antialiased", "antialiased"), &FontData::set_antialiased);
|
|
|
ClassDB::bind_method(D_METHOD("get_antialiased"), &FontData::get_antialiased);
|
|
|
|
|
@@ -100,6 +103,13 @@ void FontData::_bind_methods() {
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distance_field_hint"), "set_distance_field_hint", "get_distance_field_hint");
|
|
|
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal"), "set_hinting", "get_hinting");
|
|
|
+
|
|
|
+ ADD_GROUP("Extra Spacing", "extra_spacing");
|
|
|
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "extra_spacing_glyph"), "set_spacing", "get_spacing", SPACING_GLYPH);
|
|
|
+ ADD_PROPERTYI(PropertyInfo(Variant::INT, "extra_spacing_space"), "set_spacing", "get_spacing", SPACING_SPACE);
|
|
|
+
|
|
|
+ BIND_ENUM_CONSTANT(SPACING_GLYPH);
|
|
|
+ BIND_ENUM_CONSTANT(SPACING_SPACE);
|
|
|
}
|
|
|
|
|
|
bool FontData::_set(const StringName &p_name, const Variant &p_value) {
|
|
@@ -289,6 +299,27 @@ double FontData::get_variation(const String &p_name) const {
|
|
|
return TS->font_get_variation(rid, p_name);
|
|
|
}
|
|
|
|
|
|
+int FontData::get_spacing(int p_type) const {
|
|
|
+ if (rid == RID()) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ if (p_type == SPACING_GLYPH) {
|
|
|
+ return TS->font_get_spacing_glyph(rid);
|
|
|
+ } else {
|
|
|
+ return TS->font_get_spacing_space(rid);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void FontData::set_spacing(int p_type, int p_value) {
|
|
|
+ ERR_FAIL_COND(rid == RID());
|
|
|
+ if (p_type == SPACING_GLYPH) {
|
|
|
+ TS->font_set_spacing_glyph(rid, p_value);
|
|
|
+ } else {
|
|
|
+ TS->font_set_spacing_space(rid, p_value);
|
|
|
+ }
|
|
|
+ emit_changed();
|
|
|
+}
|
|
|
+
|
|
|
void FontData::set_antialiased(bool p_antialiased) {
|
|
|
ERR_FAIL_COND(rid == RID());
|
|
|
TS->font_set_antialiased(rid, p_antialiased);
|