mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 13:30:07 +01:00
Merge pull request #932 from Calinou/bidi-font-features-add-variable-fonts-system-fonts
Add variable fonts and system fonts to BiDi and Font Features demo
This commit is contained in:
@@ -13,3 +13,7 @@ Renderer: Compatibility
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
@@ -1,33 +1,129 @@
|
||||
extends Control
|
||||
|
||||
func _ready():
|
||||
var tree = $"TabContainer/Text direction/Tree"
|
||||
var root = tree.create_item()
|
||||
@onready var variable_font_variation: FontVariation = $"TabContainer/Variable fonts/VariableFontPreview".get_theme_font("font")
|
||||
|
||||
func _ready() -> void:
|
||||
var tree: Tree = $"TabContainer/Text direction/Tree"
|
||||
var root := tree.create_item()
|
||||
tree.set_hide_root(true)
|
||||
var first = tree.create_item(root)
|
||||
var first := tree.create_item(root)
|
||||
first.set_text(0, "רֵאשִׁית")
|
||||
var second = tree.create_item(first)
|
||||
var second := tree.create_item(first)
|
||||
second.set_text(0, "שֵׁנִי")
|
||||
var third = tree.create_item(second)
|
||||
var third := tree.create_item(second)
|
||||
third.set_text(0, "שְׁלִישִׁי")
|
||||
var fourth = tree.create_item(third)
|
||||
var fourth := tree.create_item(third)
|
||||
fourth.set_text(0, "fourth")
|
||||
|
||||
func _on_Tree_item_selected():
|
||||
var tree = $"TabContainer/Text direction/Tree"
|
||||
var path = ""
|
||||
var item = tree.get_selected()
|
||||
func _on_Tree_item_selected() -> void:
|
||||
var tree: Tree = $"TabContainer/Text direction/Tree"
|
||||
var path := ""
|
||||
var item := tree.get_selected()
|
||||
while item != null:
|
||||
path = item.get_text(0) + "/" + path
|
||||
item = item.get_parent()
|
||||
$"TabContainer/Text direction/LineEditST".text = path
|
||||
$"TabContainer/Text direction/LineEditNoST".text = path
|
||||
|
||||
func _on_LineEditCustomSTDst_text_changed(new_text):
|
||||
func _on_LineEditCustomSTDst_text_changed(new_text: String) -> void:
|
||||
$"TabContainer/Text direction/LineEditCustomSTSource".text = new_text
|
||||
|
||||
func _on_LineEditCustomSTSource_text_changed(new_text):
|
||||
func _on_LineEditCustomSTSource_text_changed(new_text: String) -> void:
|
||||
$"TabContainer/Text direction/LineEditCustomSTDst".text = new_text
|
||||
|
||||
func _on_LineEditCustomSTDst_tree_entered():
|
||||
$"TabContainer/Text direction/LineEditCustomSTDst".text = $"TabContainer/Text direction/LineEditCustomSTSource".text # Refresh text to apply custom script once it's loaded.
|
||||
func _on_LineEditCustomSTDst_tree_entered() -> void:
|
||||
# Refresh text to apply custom script once it's loaded.
|
||||
$"TabContainer/Text direction/LineEditCustomSTDst".text = $"TabContainer/Text direction/LineEditCustomSTSource".text
|
||||
|
||||
|
||||
func _on_variable_size_value_changed(value: float) -> void:
|
||||
$"TabContainer/Variable fonts/Variables/Size/Value".text = str(value)
|
||||
# This is also available on non-variable fonts.
|
||||
$"TabContainer/Variable fonts/VariableFontPreview".add_theme_font_size_override("font_size", value)
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
func _on_system_font_value_text_changed(new_text: String) -> void:
|
||||
for label in [
|
||||
$"TabContainer/System fonts/VBoxContainer/SansSerif/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Serif/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Monospace/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Cursive/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Fantasy/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Custom/Value"
|
||||
]:
|
||||
label.text = new_text
|
||||
|
||||
|
||||
func _on_system_font_weight_value_changed(value: float) -> void:
|
||||
$"TabContainer/System fonts/Weight/Value".text = str(value)
|
||||
for label in [
|
||||
$"TabContainer/System fonts/VBoxContainer/SansSerif/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Serif/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Monospace/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Cursive/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Fantasy/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Custom/Value"
|
||||
]:
|
||||
var system_font: SystemFont = label.get_theme_font("font")
|
||||
system_font.font_weight = value
|
||||
|
||||
func _on_system_font_italic_toggled(button_pressed: bool) -> void:
|
||||
for label in [
|
||||
$"TabContainer/System fonts/VBoxContainer/SansSerif/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Serif/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Monospace/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Cursive/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Fantasy/Value",
|
||||
$"TabContainer/System fonts/VBoxContainer/Custom/Value"
|
||||
]:
|
||||
var system_font: SystemFont = label.get_theme_font("font")
|
||||
system_font.font_italic = button_pressed
|
||||
|
||||
|
||||
func _on_system_font_name_text_changed(new_text: String) -> void:
|
||||
var system_font: SystemFont = $"TabContainer/System fonts/VBoxContainer/Custom/FontName".get_theme_font("font")
|
||||
system_font.font_names[0] = new_text
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://doa7j7q1j4p4e"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://doa7j7q1j4p4e"]
|
||||
|
||||
[ext_resource type="Script" path="res://bidi.gd" id="2"]
|
||||
[ext_resource type="FontFile" uid="uid://dcyy0x2u3jocr" path="res://fonts/NotoSansThaiUI_Regular.ttf" id="2_plk2w"]
|
||||
[ext_resource type="Script" path="res://custom_st_parser.gd" id="3"]
|
||||
[ext_resource type="FontFile" uid="uid://bdex0ccrwre5y" path="res://fonts/NotoNaskhArabicUI_Regular.ttf" id="3_cf43x"]
|
||||
[ext_resource type="FontFile" uid="uid://bk3udiiuy60g4" path="res://fonts/NotoNaskhArabicUI_Regular.ttf" id="3_cf43x"]
|
||||
[ext_resource type="FontVariation" uid="uid://bymgwaapysw4i" path="res://lib_font.tres" id="4"]
|
||||
[ext_resource type="FontFile" uid="uid://cwer1pi5ka4io" path="res://fonts/NotoSansHebrew_Regular.ttf" id="4_03wxc"]
|
||||
[ext_resource type="FontFile" uid="uid://bic5b75wmaxwj" path="res://fonts/LinLibertine_R.otf" id="5_dd4o7"]
|
||||
[ext_resource type="FontFile" uid="uid://cctsp10uhaei8" path="res://fonts/Recursive_VF_subset-GF_latin_basic.woff2" id="8_8y1fh"]
|
||||
|
||||
[sub_resource type="FontVariation" id="FontVariation_pn5rb"]
|
||||
base_font = ExtResource("5_dd4o7")
|
||||
@@ -39,6 +40,33 @@ opentype_features = {
|
||||
1935764596: 1
|
||||
}
|
||||
|
||||
[sub_resource type="FontVariation" id="FontVariation_vb6m6"]
|
||||
base_font = ExtResource("8_8y1fh")
|
||||
variation_opentype = {
|
||||
1128354636: null,
|
||||
1129468758: null,
|
||||
1297043023: null,
|
||||
2003265652: 400
|
||||
}
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_2w5b3"]
|
||||
font_names = PackedStringArray("sans-serif")
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_h8xpn"]
|
||||
font_names = PackedStringArray("serif")
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_4rcq4"]
|
||||
font_names = PackedStringArray("monospace")
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_gnv0g"]
|
||||
font_names = PackedStringArray("cursive")
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_f282f"]
|
||||
font_names = PackedStringArray("fantasy")
|
||||
|
||||
[sub_resource type="SystemFont" id="SystemFont_oua6b"]
|
||||
font_names = PackedStringArray("")
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -49,9 +77,12 @@ grow_vertical = 2
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="."]
|
||||
layout_mode = 0
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_font_sizes/font_size = 14
|
||||
|
||||
[node name="Line breaking and justification" type="Panel" parent="TabContainer"]
|
||||
@@ -457,7 +488,327 @@ Que fin 1/3 0
|
||||
[opentype_features=liga=0]Que fin 1/3 0[/opentype_features] [color=#fffa](liga=0 - disables ligatures)[/color]
|
||||
[opentype_features=frac=1,zero]Que fin 1/3 0[/opentype_features] [color=#fffa](frac=1,zero - fractions and slashed zero)[/color][/font_size]"
|
||||
|
||||
[node name="Variable fonts" type="Panel" parent="TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LabelVarInfo" type="Label" parent="TabContainer/Variable fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 30.0
|
||||
offset_top = 30.0
|
||||
offset_right = 830.0
|
||||
offset_bottom = 53.0
|
||||
theme_override_colors/font_color = Color(0.419608, 0.831373, 0.505882, 1)
|
||||
theme_override_font_sizes/font_size = 14
|
||||
text = "Variable font example."
|
||||
|
||||
[node name="Variables" type="VBoxContainer" parent="TabContainer/Variable fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 40.0
|
||||
offset_top = 88.0
|
||||
offset_right = 351.0
|
||||
offset_bottom = 174.0
|
||||
|
||||
[node name="Size" type="HBoxContainer" parent="TabContainer/Variable fonts/Variables"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Variable fonts/Variables/Size"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
text = "Size"
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="TabContainer/Variable fonts/Variables/Size"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
min_value = 8.0
|
||||
max_value = 128.0
|
||||
value = 64.0
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/Variable fonts/Variables/Size"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "64"
|
||||
|
||||
[node name="Weight" type="HBoxContainer" parent="TabContainer/Variable fonts/Variables"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Variable fonts/Variables/Weight"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
text = "Weight"
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="TabContainer/Variable fonts/Variables/Weight"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
min_value = 300.0
|
||||
max_value = 1000.0
|
||||
step = 50.0
|
||||
value = 400.0
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/Variable fonts/Variables/Weight"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "400"
|
||||
|
||||
[node name="Slant" type="HBoxContainer" parent="TabContainer/Variable fonts/Variables"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/Variable fonts/Variables/Slant"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
text = "Slant"
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="TabContainer/Variable fonts/Variables/Slant"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
min_value = -15.0
|
||||
max_value = 0.0
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/Variable fonts/Variables/Slant"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "0"
|
||||
|
||||
[node name="Cursive" type="CheckButton" parent="TabContainer/Variable fonts/Variables"]
|
||||
custom_minimum_size = Vector2(140, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Cursive"
|
||||
|
||||
[node name="Casual" type="CheckButton" parent="TabContainer/Variable fonts/Variables"]
|
||||
custom_minimum_size = Vector2(140, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Casual"
|
||||
|
||||
[node name="Monospace" type="CheckButton" parent="TabContainer/Variable fonts/Variables"]
|
||||
custom_minimum_size = Vector2(140, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Monospace"
|
||||
|
||||
[node name="VariableFontPreview" type="LineEdit" parent="TabContainer/Variable fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 36.0
|
||||
offset_top = 347.0
|
||||
offset_right = 1115.0
|
||||
offset_bottom = 525.0
|
||||
theme_override_fonts/font = SubResource("FontVariation_vb6m6")
|
||||
theme_override_font_sizes/font_size = 64
|
||||
text = "Example text – 1234567890"
|
||||
|
||||
[node name="LinkButton" type="LinkButton" parent="TabContainer/Variable fonts/VariableFontPreview"]
|
||||
layout_mode = 0
|
||||
offset_left = 959.0
|
||||
offset_top = 193.0
|
||||
offset_right = 1077.0
|
||||
offset_bottom = 238.0
|
||||
text = "Font: Recursive"
|
||||
uri = "https://www.recursive.design/"
|
||||
|
||||
[node name="System fonts" type="Panel" parent="TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LabelVarInfo" type="Label" parent="TabContainer/System fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 30.0
|
||||
offset_top = 30.0
|
||||
offset_right = 830.0
|
||||
offset_bottom = 53.0
|
||||
theme_override_colors/font_color = Color(0.419608, 0.831373, 0.505882, 1)
|
||||
theme_override_font_sizes/font_size = 14
|
||||
text = "Loading and displaying system fonts."
|
||||
|
||||
[node name="ValueSetter" type="LineEdit" parent="TabContainer/System fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 36.0
|
||||
offset_top = 77.0
|
||||
offset_right = 695.0
|
||||
offset_bottom = 108.0
|
||||
text = "Example text – 1234567890"
|
||||
placeholder_text = "Enter text here"
|
||||
|
||||
[node name="Italic" type="CheckButton" parent="TabContainer/System fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 406.0
|
||||
offset_top = 116.0
|
||||
offset_right = 492.0
|
||||
offset_bottom = 147.0
|
||||
text = "Italic"
|
||||
|
||||
[node name="Weight" type="HBoxContainer" parent="TabContainer/System fonts"]
|
||||
offset_left = 40.0
|
||||
offset_top = 120.0
|
||||
offset_right = 383.0
|
||||
offset_bottom = 146.0
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="TabContainer/System fonts/Weight"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.3
|
||||
text = "Weight"
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="TabContainer/System fonts/Weight"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
min_value = 100.0
|
||||
max_value = 900.0
|
||||
step = 100.0
|
||||
value = 400.0
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/Weight"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.2
|
||||
text = "400"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer/System fonts"]
|
||||
layout_mode = 0
|
||||
offset_left = 37.0
|
||||
offset_top = 176.0
|
||||
offset_right = 1126.0
|
||||
offset_bottom = 489.0
|
||||
|
||||
[node name="SansSerif" type="HBoxContainer" parent="TabContainer/System fonts/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="FontName" type="Label" parent="TabContainer/System fonts/VBoxContainer/SansSerif"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_2w5b3")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "sans-serif"
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/VBoxContainer/SansSerif"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_fonts/font = SubResource("SystemFont_2w5b3")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Example text – 1234567890"
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="Serif" type="HBoxContainer" parent="TabContainer/System fonts/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="FontName" type="Label" parent="TabContainer/System fonts/VBoxContainer/Serif"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_h8xpn")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "serif"
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/VBoxContainer/Serif"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_fonts/font = SubResource("SystemFont_h8xpn")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Example text – 1234567890"
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="Monospace" type="HBoxContainer" parent="TabContainer/System fonts/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="FontName" type="Label" parent="TabContainer/System fonts/VBoxContainer/Monospace"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_4rcq4")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "monospace"
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/VBoxContainer/Monospace"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_fonts/font = SubResource("SystemFont_4rcq4")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Example text – 1234567890"
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="Cursive" type="HBoxContainer" parent="TabContainer/System fonts/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="FontName" type="Label" parent="TabContainer/System fonts/VBoxContainer/Cursive"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_gnv0g")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "cursive"
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/VBoxContainer/Cursive"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_fonts/font = SubResource("SystemFont_gnv0g")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Example text – 1234567890"
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="Fantasy" type="HBoxContainer" parent="TabContainer/System fonts/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="FontName" type="Label" parent="TabContainer/System fonts/VBoxContainer/Fantasy"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_f282f")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "fantasy"
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/VBoxContainer/Fantasy"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_fonts/font = SubResource("SystemFont_f282f")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Example text – 1234567890"
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="Custom" type="HBoxContainer" parent="TabContainer/System fonts/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="FontName" type="LineEdit" parent="TabContainer/System fonts/VBoxContainer/Custom"]
|
||||
custom_minimum_size = Vector2(330, 0)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = SubResource("SystemFont_oua6b")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
placeholder_text = "Custom Font Name"
|
||||
|
||||
[node name="Value" type="Label" parent="TabContainer/System fonts/VBoxContainer/Custom"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_fonts/font = SubResource("SystemFont_oua6b")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Example text – 1234567890"
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[connection signal="item_selected" from="TabContainer/Text direction/Tree" to="." method="_on_Tree_item_selected"]
|
||||
[connection signal="text_changed" from="TabContainer/Text direction/LineEditCustomSTSource" to="." method="_on_LineEditCustomSTSource_text_changed"]
|
||||
[connection signal="text_changed" from="TabContainer/Text direction/LineEditCustomSTDst" to="." method="_on_LineEditCustomSTDst_text_changed"]
|
||||
[connection signal="tree_entered" from="TabContainer/Text direction/LineEditCustomSTDst" to="." method="_on_LineEditCustomSTDst_tree_entered"]
|
||||
[connection signal="value_changed" from="TabContainer/Variable fonts/Variables/Size/HSlider" to="." method="_on_variable_size_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Variable fonts/Variables/Weight/HSlider" to="." method="_on_variable_weight_value_changed"]
|
||||
[connection signal="value_changed" from="TabContainer/Variable fonts/Variables/Slant/HSlider" to="." method="_on_variable_slant_value_changed"]
|
||||
[connection signal="toggled" from="TabContainer/Variable fonts/Variables/Cursive" to="." method="_on_variable_cursive_toggled"]
|
||||
[connection signal="toggled" from="TabContainer/Variable fonts/Variables/Casual" to="." method="_on_variable_casual_toggled"]
|
||||
[connection signal="toggled" from="TabContainer/Variable fonts/Variables/Monospace" to="." method="_on_variable_monospace_toggled"]
|
||||
[connection signal="text_changed" from="TabContainer/System fonts/ValueSetter" to="." method="_on_system_font_value_text_changed"]
|
||||
[connection signal="toggled" from="TabContainer/System fonts/Italic" to="." method="_on_system_font_italic_toggled"]
|
||||
[connection signal="value_changed" from="TabContainer/System fonts/Weight/HSlider" to="." method="_on_system_font_weight_value_changed"]
|
||||
[connection signal="text_changed" from="TabContainer/System fonts/VBoxContainer/Custom/FontName" to="." method="_on_system_font_name_text_changed"]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
extends LineEdit
|
||||
|
||||
func _structured_text_parser(args, text):
|
||||
func _structured_text_parser(args, p_text):
|
||||
var output = []
|
||||
var tags = text.split(":")
|
||||
var tags = p_text.split(":")
|
||||
var prev = 0
|
||||
var count = int(tags.size())
|
||||
output.clear()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://bdex0ccrwre5y"
|
||||
uid="uid://bk3udiiuy60g4"
|
||||
path="res://.godot/imported/NotoNaskhArabicUI_Regular.ttf-71ae3841953d426d66ee60d00f69e0e0.fontdata"
|
||||
|
||||
[deps]
|
||||
@@ -24,7 +24,7 @@ hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[Resource("res://fonts/NotoSansUI_Regular.ttf")]
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://cctsp10uhaei8"
|
||||
path="res://.godot/imported/Recursive_VF_subset-GF_latin_basic.woff2-88636a22c3c54139c5e5dc81b441b111.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/Recursive_VF_subset-GF_latin_basic.woff2"
|
||||
dest_files=["res://.godot/imported/Recursive_VF_subset-GF_latin_basic.woff2-88636a22c3c54139c5e5dc81b441b111.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=1
|
||||
generate_mipmaps=false
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=true
|
||||
force_autohinter=false
|
||||
hinting=1
|
||||
subpixel_positioning=1
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
||||
@@ -11,11 +11,11 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="BiDi and Font Features"
|
||||
config/tags=PackedStringArray("demo", "gui", "official")
|
||||
run/main_scene="res://bidi.tscn"
|
||||
config/features=PackedStringArray("4.0")
|
||||
run/low_processor_mode=true
|
||||
config/icon="res://icon.webp"
|
||||
config/tags=PackedStringArray("demo", "gui", "official")
|
||||
|
||||
[display]
|
||||
|
||||
|
||||
BIN
gui/bidi_and_font_features/screenshots/system_fonts.webp
Normal file
BIN
gui/bidi_and_font_features/screenshots/system_fonts.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
BIN
gui/bidi_and_font_features/screenshots/variable_fonts.webp
Normal file
BIN
gui/bidi_and_font_features/screenshots/variable_fonts.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user