Skip to content

Commit

Permalink
Update Bidi and Font Features demo for 4.0.rc1
Browse files Browse the repository at this point in the history
- Enable low processor mode and multiple resolution-friendly
  project settings for consistency with other demos.
  • Loading branch information
Calinou committed Feb 8, 2023
1 parent b89af52 commit 62fcf88
Show file tree
Hide file tree
Showing 14 changed files with 250 additions and 388 deletions.
442 changes: 139 additions & 303 deletions gui/bidi_and_font_features/bidi.tscn

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions gui/bidi_and_font_features/custom_st_parser.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ func _structured_text_parser(args, text):
var count = int(tags.size())
output.clear()
for i in range(count):
var range1 = Vector2i(prev, prev + tags[i].length())
var range2 = Vector2i(prev + tags[i].length(), prev + tags[i].length() + 1)
var range1 = Vector3i(prev, prev + tags[i].length(), TextServer.DIRECTION_AUTO)
var range2 = Vector3i(prev + tags[i].length(), prev + tags[i].length() + 1, TextServer.DIRECTION_AUTO)
output.push_front(range1)
output.push_front(range2)
prev = prev + tags[i].length() + 1
Expand Down
23 changes: 14 additions & 9 deletions gui/bidi_and_font_features/fonts/LinLibertine_R.otf.import
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[remap]

importer="font_data_dynamic"
type="FontData"
type="FontFile"
uid="uid://bic5b75wmaxwj"
path="res://.godot/imported/LinLibertine_R.otf-0d33583986cf94e9ad55cc89a5951934.fontdata"

Expand All @@ -12,17 +12,22 @@ dest_files=["res://.godot/imported/LinLibertine_R.otf-0d33583986cf94e9ad55cc89a5

[params]

antialiased=true
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8.0
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/char_ranges=PackedStringArray()
preload/glyph_ranges=PackedStringArray()
preload/configurations=PackedStringArray()
support_overrides/language_enabled=PackedStringArray()
support_overrides/language_disabled=PackedStringArray()
support_overrides/script_enabled=PackedStringArray()
support_overrides/script_disabled=PackedStringArray()
preload=[]
language_support={}
script_support={}
opentype_features={}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[remap]

importer="font_data_dynamic"
type="FontData"
type="FontFile"
uid="uid://61ui1kmi5tt7"
path="res://.godot/imported/NotoNaskhArabicUI_Regular.ttf-71ae3841953d426d66ee60d00f69e0e0.fontdata"

Expand All @@ -12,17 +12,22 @@ dest_files=["res://.godot/imported/NotoNaskhArabicUI_Regular.ttf-71ae3841953d426

[params]

antialiased=true
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8.0
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[Resource("res://fonts/NotoSansUI_Regular.ttf")]
Compress=null
compress=true
preload/char_ranges=PackedStringArray()
preload/glyph_ranges=PackedStringArray()
preload/configurations=PackedStringArray()
support_overrides/language_enabled=PackedStringArray()
support_overrides/language_disabled=PackedStringArray()
support_overrides/script_enabled=PackedStringArray()
support_overrides/script_disabled=PackedStringArray()
preload=[]
language_support={}
script_support={}
opentype_features={}
23 changes: 14 additions & 9 deletions gui/bidi_and_font_features/fonts/NotoSansHebrew_Regular.ttf.import
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[remap]

importer="font_data_dynamic"
type="FontData"
type="FontFile"
uid="uid://cwer1pi5ka4io"
path="res://.godot/imported/NotoSansHebrew_Regular.ttf-9d09161984e30bb05b9445728c29a2a8.fontdata"

Expand All @@ -12,17 +12,22 @@ dest_files=["res://.godot/imported/NotoSansHebrew_Regular.ttf-9d09161984e30bb05b

[params]

antialiased=true
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8.0
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/char_ranges=PackedStringArray()
preload/glyph_ranges=PackedStringArray()
preload/configurations=PackedStringArray()
support_overrides/language_enabled=PackedStringArray()
support_overrides/language_disabled=PackedStringArray()
support_overrides/script_enabled=PackedStringArray()
support_overrides/script_disabled=PackedStringArray()
preload=[]
language_support={}
script_support={}
opentype_features={}
23 changes: 14 additions & 9 deletions gui/bidi_and_font_features/fonts/NotoSansThaiUI_Regular.ttf.import
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[remap]

importer="font_data_dynamic"
type="FontData"
type="FontFile"
uid="uid://dcyy0x2u3jocr"
path="res://.godot/imported/NotoSansThaiUI_Regular.ttf-a2b65614687aa5ce07b4d39f23198f14.fontdata"

Expand All @@ -12,17 +12,22 @@ dest_files=["res://.godot/imported/NotoSansThaiUI_Regular.ttf-a2b65614687aa5ce07

[params]

antialiased=true
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8.0
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/char_ranges=PackedStringArray()
preload/glyph_ranges=PackedStringArray()
preload/configurations=PackedStringArray()
support_overrides/language_enabled=PackedStringArray()
support_overrides/language_disabled=PackedStringArray()
support_overrides/script_enabled=PackedStringArray()
support_overrides/script_disabled=PackedStringArray()
preload=[]
language_support={}
script_support={}
opentype_features={}
23 changes: 14 additions & 9 deletions gui/bidi_and_font_features/fonts/NotoSansUI_Regular.ttf.import
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[remap]

importer="font_data_dynamic"
type="FontData"
type="FontFile"
uid="uid://ba53h385o6ips"
path="res://.godot/imported/NotoSansUI_Regular.ttf-e126ff40055cb76ad9714327677638b8.fontdata"

Expand All @@ -12,17 +12,22 @@ dest_files=["res://.godot/imported/NotoSansUI_Regular.ttf-e126ff40055cb76ad97143

[params]

antialiased=true
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8.0
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/char_ranges=PackedStringArray()
preload/glyph_ranges=PackedStringArray()
preload/configurations=PackedStringArray()
support_overrides/language_enabled=PackedStringArray()
support_overrides/language_disabled=PackedStringArray()
support_overrides/script_enabled=PackedStringArray()
support_overrides/script_disabled=PackedStringArray()
preload=[]
language_support={}
script_support={}
opentype_features={}
11 changes: 5 additions & 6 deletions gui/bidi_and_font_features/icon.png.import
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[remap]

importer="texture"
type="StreamTexture2D"
type="CompressedTexture2D"
uid="uid://g6u3g3bv5nva"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]

[params]

Expand All @@ -21,15 +21,14 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/HDR_as_SRGB=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
6 changes: 3 additions & 3 deletions gui/bidi_and_font_features/lib_font.tres
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_resource type="Font" load_steps=2 format=2]
[gd_resource type="FontVariation" load_steps=2 format=3 uid="uid://bymgwaapysw4i"]

[ext_resource path="res://fonts/LinLibertine_R.otf" type="FontData" id=1]
[ext_resource type="FontFile" uid="uid://bic5b75wmaxwj" path="res://fonts/LinLibertine_R.otf" id="1"]

[resource]
data/0 = ExtResource( 1 )
base_font = ExtResource("1")
12 changes: 3 additions & 9 deletions gui/bidi_and_font_features/noto_font.tres
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
[gd_resource type="Font" load_steps=5 format=2]
[gd_resource type="FontVariation" load_steps=2 format=3 uid="uid://dewurnqemtrs"]

[ext_resource path="res://fonts/NotoSansThaiUI_Regular.ttf" type="FontData" id=1]
[ext_resource path="res://fonts/NotoNaskhArabicUI_Regular.ttf" type="FontData" id=2]
[ext_resource path="res://fonts/NotoSansHebrew_Regular.ttf" type="FontData" id=3]
[ext_resource path="res://fonts/NotoSansUI_Regular.ttf" type="FontData" id=4]
[ext_resource type="FontFile" uid="uid://cwer1pi5ka4io" path="res://fonts/NotoSansHebrew_Regular.ttf" id="1_yyyil"]

[resource]
data/0 = ExtResource( 1 )
data/1 = ExtResource( 2 )
data/2 = ExtResource( 3 )
data/3 = ExtResource( 4 )
fallbacks = Array[Font]([ExtResource("1_yyyil")])
15 changes: 13 additions & 2 deletions gui/bidi_and_font_features/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=4
config_version=5

[application]

config/name="BiDi and font features demo."
config/name="BiDi and Font Features"
run/main_scene="res://bidi.tscn"
config/features=PackedStringArray("4.0")
run/low_processor_mode=true
config/icon="res://icon.png"

[display]

window/stretch/mode="canvas_items"
window/stretch/aspect="expand"

[rendering]

environment/defaults/default_clear_color=Color(0.2, 0.2, 0.2, 1)
11 changes: 5 additions & 6 deletions gui/bidi_and_font_features/screenshots/bidi.png.import
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[remap]

importer="texture"
type="StreamTexture2D"
type="CompressedTexture2D"
uid="uid://e0kr85p63y1e"
path="res://.godot/imported/bidi.png-b063a53994859c3e43f1022e88c1162c.stex"
path="res://.godot/imported/bidi.png-b063a53994859c3e43f1022e88c1162c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://screenshots/bidi.png"
dest_files=["res://.godot/imported/bidi.png-b063a53994859c3e43f1022e88c1162c.stex"]
dest_files=["res://.godot/imported/bidi.png-b063a53994859c3e43f1022e88c1162c.ctex"]

[params]

Expand All @@ -21,15 +21,14 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/HDR_as_SRGB=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
11 changes: 5 additions & 6 deletions gui/bidi_and_font_features/screenshots/font_features.png.import
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[remap]

importer="texture"
type="StreamTexture2D"
type="CompressedTexture2D"
uid="uid://c1acx0yclosw3"
path="res://.godot/imported/font_features.png-0a9509f2c2c735752a635f0a4ca36458.stex"
path="res://.godot/imported/font_features.png-0a9509f2c2c735752a635f0a4ca36458.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://screenshots/font_features.png"
dest_files=["res://.godot/imported/font_features.png-0a9509f2c2c735752a635f0a4ca36458.stex"]
dest_files=["res://.godot/imported/font_features.png-0a9509f2c2c735752a635f0a4ca36458.ctex"]

[params]

Expand All @@ -21,15 +21,14 @@ compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
compress/streamed=false
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/HDR_as_SRGB=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
Loading

0 comments on commit 62fcf88

Please sign in to comment.