-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add variable fonts and system fonts to BiDi and Font Features demo #932
Add variable fonts and system fonts to BiDi and Font Features demo #932
Conversation
a1cde8e
to
179f945
Compare
I've tried replacing the workarounds with setting dictionary keys directly like this: diff --git a/gui/bidi_and_font_features/bidi.gd b/gui/bidi_and_font_features/bidi.gd
index ea2f64d4..6bba4a61 100644
--- a/gui/bidi_and_font_features/bidi.gd
+++ b/gui/bidi_and_font_features/bidi.gd
@@ -44,42 +44,27 @@ func _on_variable_size_value_changed(value: float) -> void:
func _on_variable_weight_value_changed(value: float) -> void:
$"TabContainer/Variable fonts/Variables/Weight/Value".text = str(value)
- # Workaround to make the variable font axis value effective. This requires duplicating the dictionary.
- var dict = variable_font_variation.variation_opentype.duplicate()
- dict["weight"] = value
- variable_font_variation.variation_opentype = dict
+ variable_font_variation.variation_opentype["weight"] = value
func _on_variable_slant_value_changed(value: float) -> void:
$"TabContainer/Variable fonts/Variables/Slant/Value".text = str(value)
- # Workaround to make the variable font axis value effective. This requires duplicating the dictionary.
- var dict = variable_font_variation.variation_opentype.duplicate()
- dict["slant"] = value
- variable_font_variation.variation_opentype = dict
+ variable_font_variation.variation_opentype["slant"] = value
func _on_variable_cursive_toggled(button_pressed: bool) -> void:
$"TabContainer/Variable fonts/Variables/Cursive".button_pressed = button_pressed
- # Workaround to make the variable font axis value effective. This requires duplicating the dictionary.
- var dict = variable_font_variation.variation_opentype.duplicate()
- dict["custom_CRSV"] = int(button_pressed)
- variable_font_variation.variation_opentype = dict
+ variable_font_variation.variation_opentype["custom_CRSV"] = int(button_pressed)
func _on_variable_casual_toggled(button_pressed: bool) -> void:
$"TabContainer/Variable fonts/Variables/Casual".button_pressed = button_pressed
- # Workaround to make the variable font axis value effective. This requires duplicating the dictionary.
- var dict = variable_font_variation.variation_opentype.duplicate()
- dict["custom_CASL"] = int(button_pressed)
- variable_font_variation.variation_opentype = dict
+ variable_font_variation.variation_opentype["custom_CASL"] = int(button_pressed)
func _on_variable_monospace_toggled(button_pressed: bool) -> void:
$"TabContainer/Variable fonts/Variables/Monospace".button_pressed = button_pressed
- # Workaround to make the variable font axis value effective. This requires duplicating the dictionary.
- var dict = variable_font_variation.variation_opentype.duplicate()
- dict["custom_MONO"] = int(button_pressed)
- variable_font_variation.variation_opentype = dict
+ variable_font_variation.variation_opentype["custom_MONO"] = int(button_pressed)
func _on_system_font_value_text_changed(new_text: String) -> void:
However, this has no effect in 4.2.beta1. @bruvzg Any ideas? |
That's not gonna work, and I do not think there's any way to make it work. The only thing that can be removed for the old version is |
I've tried removing |
Thanks! |
Note that some of the code could be simplified once godotengine/godot#79166 is merged, but I don't know if that PR will be cherry-picked for 4.1.x.
Preview