text:
[gd_scene load_steps=16 format=2]

[sub_resource type="GDScript" id=1]

script/source = "extends Control

func _on_item_selected(ID):
	for c in range($demos.get_child_count()):
		if ID == c:
			$demos.get_child(c).show()
			$source_view.text = $demos.get_child(c).get_script().source_code
		else:
			$demos.get_child(c).hide()

func _ready():
	var data_loader = TLICUDataLoader.new()
	data_loader.load(\"res://fonts/icudt67l.dat\")

	for c in $demos.get_children():
		$demos_opt.add_item(\"Demo: \" + c.get_full_name())
		c.init()
	$source_view.text = $demos.get_child(0).get_script().source_code"

[sub_resource type="GDScript" id=2]

script/source = "extends ColorRect

var font1
var sstring1

func get_full_name():
	return \"libgdtl\"

func init():

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	sstring1 = TLShapedString.new()
	sstring1.set_base_font_size(72)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"libgdtl (built-in)\")

func _draw():
	var w = (700 - sstring1.get_width()) / 2
	var h = (500 - sstring1.get_height()) / 2
	sstring1.draw(get_canvas_item(), Vector2(w, h + sstring1.get_ascent()), Color(0, 0, 0))
"

[sub_resource type="GDScript" id=3]

script/source = "extends ColorRect

var font1
var sstring1

func get_full_name():
	return \"Font substitution: no substitution\"

func init():

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	sstring1 = TLShapedString.new()
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(20)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία.\")

func _draw():
	sstring1.draw(get_canvas_item(), Vector2(20, sstring1.get_ascent() + 20), Color(0, 0, 0))
"

[sub_resource type="GDScript" id=4]

script/source = "extends ColorRect

var font1
var sstring1

func get_full_name():
	return \"Font substitution: substitution using fallback font\"

func init():

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	var face2 = TLDynamicFontFace.new()
	face2.load(\"res://fonts/NotoSans-Regular.ttf\")
	font1.add_face(\"Default\", face2)

	sstring1 = TLShapedString.new()
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(20)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία.\")

func _draw():
	sstring1.draw(get_canvas_item(), Vector2(20, sstring1.get_ascent() + 20), Color(0, 0, 0))
"

[sub_resource type="GDScript" id=5]

script/source = "extends ColorRect

var font1
var sstring1

func get_full_name():
	return \"Font substitution: substitution using script linking\"

func init():

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	var face2 = TLDynamicFontFace.new()
	face2.load(\"res://fonts/NotoSans-Regular.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)
	font1.add_face_for_script(\"Default\", face2, \"grek\")

	sstring1 = TLShapedString.new()
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(20)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"Ξεσκεπάζω τὴν ψυχοφθόρα βδελυγμία.\")

func _draw():
	sstring1.draw(get_canvas_item(), Vector2(20, sstring1.get_ascent() + 20), Color(0, 0, 0))
"

[sub_resource type="GDScript" id=6]

script/source = "extends ColorRect

var font1

var sstring1
var sstring2

func get_full_name():
	return \"Drawing shaped string - Dynamic font\"

func init():
	var face1en = TLDynamicFontFace.new()
	face1en.load(\"res://fonts/NotoSans-Regular.ttf\")

	var face1ar = TLDynamicFontFace.new()
	face1ar.load(\"res://fonts/NotoNaskhArabic-Regular.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1en)
	font1.add_face_for_script(\"Default\", face1ar, \"arab\")

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_LTR)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(24)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"OpenType Test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

	sstring2 = TLShapedString.new()
	sstring2.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring2.set_base_font(font1)
	sstring2.set_base_font_size(24)
	sstring2.set_base_font_style(\"Default\")
	sstring2.set_text(\"OpenType Test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

func _draw():
	var ofs = sstring1.get_ascent() + 20
	sstring1.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring1.get_descent() + sstring2.get_ascent() + 20
	sstring2.draw(get_canvas_item(), Vector2(20, ofs), Color(1, 0, 0))"

[sub_resource type="GDScript" id=15]

script/source = "extends ColorRect

var font1

var sstring1
var sstring2

func get_full_name():
	return \"Drawing shaped string - Dynamic font (Graphite2)\"

func init():
	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/AwamiNastaliq-Regular.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_LTR)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(24)
	sstring1.set_base_font_style(\"Default\")
	if face1.has_graphite():
		sstring1.set_text(\"Graphite Test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	else:
		sstring1.set_text(\"[Graphite not supported] حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

	sstring2 = TLShapedString.new()
	sstring2.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring2.set_base_font(font1)
	sstring2.set_base_font_size(24)
	sstring2.set_base_font_style(\"Default\")
	if face1.has_graphite():
		sstring2.set_text(\"Graphite Test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	else:
		sstring2.set_text(\"[Graphite not supported] حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

func _draw():
	var ofs = sstring1.get_ascent() + 20
	sstring1.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring1.get_descent() + sstring2.get_ascent() + 20
	sstring2.draw(get_canvas_item(), Vector2(20, ofs), Color(1, 0, 0))"

[sub_resource type="GDScript" id=7]

script/source = "extends ColorRect

var font1

var sstring1
var sstring2

func get_full_name():
	return \"Drawing shaped string - Bitmap font\"

func init():
	var face1en = TLBitmapFontFace.new()
	face1en.load(\"res://fonts/NotoSansRegular.fnt\")
	face1en.set_texture_flags(Texture.FLAG_MIPMAPS | Texture.FLAG_FILTER | Texture.FLAG_ANISOTROPIC_FILTER)

	var face1ar = TLBitmapFontFace.new()
	face1ar.load(\"res://fonts/NotoNaskhArabicUI.fnt\")
	face1ar.set_texture_flags(Texture.FLAG_MIPMAPS | Texture.FLAG_FILTER | Texture.FLAG_ANISOTROPIC_FILTER)

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1en)
	font1.add_face_for_script(\"Default\", face1ar, \"arab\")

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_LTR)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(32)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"OpenType Test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

	sstring2 = TLShapedString.new()
	sstring2.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring2.set_base_font(font1)
	sstring2.set_base_font_size(32)
	sstring2.set_base_font_style(\"Default\")
	sstring2.set_text(\"OpenType Test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

func _draw():
	var ofs = sstring1.get_ascent() + 20
	sstring1.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring1.get_descent() + sstring2.get_ascent() + 20
	sstring2.draw(get_canvas_item(), Vector2(20, ofs), Color(1, 0, 0))"

[sub_resource type="GDScript" id=8]

script/source = "extends ColorRect

var font1

var sstring1
var spara1 = []

func get_full_name():
	return \"Line breaking and justification\"

func init():
	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/NotoSerifThai-Regular.ttf\")
	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	sstring1 = TLShapedString.new()
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(16)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"สอนของพระพุทธเจ้าเป็นภาษาอันศักดิ์สิทธิ์และเป็นมงคล เมื่อคนไทยต้องการตั้งชื่อประเทศว่า\")
	var bounds = sstring1.break_lines(200, TLShapedString.TEXT_BREAK_MANDATORY_AND_WORD_BOUND)

	var prev = 0
	for b in bounds:
		var line = sstring1.substr(prev, b, TLShapedString.TEXT_TRIM_BREAK_AND_WHITESPACE)
		line.extend_to_width(200, TLShapedString.TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE)
		spara1.push_back(line)
		prev = b

func _draw():
	draw_line(Vector2(20, 40), Vector2(20, 500), Color(1, 0, 1))
	draw_line(Vector2(220, 40), Vector2(220, 500), Color(1, 0, 1))
	var line_spacing = 2
	var ofs = sstring1.get_ascent() + 20
	sstring1.draw(get_canvas_item(), Vector2(20, 20), Color(0, 0, 1))
	ofs += sstring1.get_descent() + line_spacing
	for line in spara1:
		ofs += line.get_ascent()
		line.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 0))
		ofs += line.get_descent() + line_spacing"

[sub_resource type="GDScript" id=9]

script/source = "extends ColorRect

var font1

var sstring1
var spara1 = []
var sstring2
var spara2 = []
var sstring3
var spara3 = []

func get_full_name():
	return \"Line breaking modes\"

func init():
	var face1en = TLDynamicFontFace.new()
	face1en.load(\"res://fonts/NotoSans-Regular.ttf\")

	var face1ar = TLDynamicFontFace.new()
	face1ar.load(\"res://fonts/NotoNaskhArabic-Regular.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1en)
	font1.add_face_for_script(\"Default\", face1ar, \"arab\")

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(24)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"Looooooooongword test\\n test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	var bounds = sstring1.break_lines(200, TLShapedString.TEXT_BREAK_MANDATORY_AND_WORD_BOUND)

	var prev = 0
	for b in bounds:
		var line = sstring1.substr(prev, b, TLShapedString.TEXT_TRIM_BREAK_AND_WHITESPACE)
		spara1.push_back(line)
		prev = b

	sstring2 = TLShapedString.new()
	sstring2.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring2.set_base_font(font1)
	sstring2.set_base_font_size(24)
	sstring2.set_base_font_style(\"Default\")
	sstring2.set_text(\"Looooooooongword test\\n test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	bounds = sstring2.break_lines(200, TLShapedString.TEXT_BREAK_MANDATORY_AND_ANYWHERE)

	prev = 0
	for b in bounds:
		var line = sstring2.substr(prev, b, TLShapedString.TEXT_TRIM_BREAK_AND_WHITESPACE)
		spara2.push_back(line)
		prev = b

	sstring3 = TLShapedString.new()
	sstring3.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring3.set_base_font(font1)
	sstring3.set_base_font_size(24)
	sstring3.set_base_font_style(\"Default\")
	sstring3.set_text(\"Looooooooongword test\\n test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	bounds = sstring3.break_lines(200, TLShapedString.TEXT_BREAK_MANDATORY)

	prev = 0
	for b in bounds:
		var line = sstring3.substr(prev, b, TLShapedString.TEXT_TRIM_BREAK_AND_WHITESPACE)
		spara3.push_back(line)
		prev = b

func _draw():
	draw_line(Vector2(20, 20), Vector2(20, 500), Color(1, 0, 1))
	draw_line(Vector2(220, 20), Vector2(220, 500), Color(1, 0, 1))
	var line_spacing = 2
	var ofs = 20
	for line in spara1:
		ofs += line.get_ascent()
		line.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 1, 0))
		ofs += line.get_descent() + line_spacing
	ofs += 20
	for line in spara2:
		ofs += line.get_ascent()
		line.draw(get_canvas_item(), Vector2(20, ofs), Color(1, 0, 0))
		ofs += line.get_descent() + line_spacing
	ofs += 20
	for line in spara3:
		ofs += line.get_ascent()
		line.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
		ofs += line.get_descent() + line_spacing"

[sub_resource type="GDScript" id=10]

script/source = "extends ColorRect

var font1
var font2

var sstring1
var sstring2
var sstring3
var sstring4
var sstring5
var sstring6

func get_full_name():
	return \"Justification modes\"

func init():
	var face1en = TLDynamicFontFace.new()
	face1en.load(\"res://fonts/NotoSans-Regular.ttf\")

	var face1ar = TLDynamicFontFace.new()
	face1ar.load(\"res://fonts/NotoNaskhArabic-Regular.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1en)
	font1.add_face_for_script(\"Default\", face1ar, \"arab\")

	var face2ar = TLDynamicFontFace.new()
	face2ar.load(\"res://fonts/NotoNastaliqUrdu-Regular.ttf\")

	font2 = TLFontFamily.new()
	font2.add_face(\"Default\", face1en)
	font2.add_face_for_script(\"Default\", face2ar, \"arab\")

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(24)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"KS & WS حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	sstring1.extend_to_width(600, TLShapedString.TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE)

	sstring2 = TLShapedString.new()
	sstring2.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring2.set_base_font(font2)
	sstring2.set_base_font_size(24)
	sstring2.set_base_font_style(\"Default\")
	sstring2.set_text(\"KS & WS حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	sstring2.extend_to_width(600, TLShapedString.TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE)

	sstring3 = TLShapedString.new()
	sstring3.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring3.set_base_font(font1)
	sstring3.set_base_font_size(24)
	sstring3.set_base_font_style(\"Default\")
	sstring3.set_text(\"KS حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	sstring3.extend_to_width(600, TLShapedString.TEXT_JUSTIFICATION_KASHIDA_ONLY)

	sstring4 = TLShapedString.new()
	sstring4.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring4.set_base_font(font2)
	sstring4.set_base_font_size(24)
	sstring4.set_base_font_style(\"Default\")
	sstring4.set_text(\"KS حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	sstring4.extend_to_width(600, TLShapedString.TEXT_JUSTIFICATION_KASHIDA_ONLY)

	sstring5 = TLShapedString.new()
	sstring5.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring5.set_base_font(font1)
	sstring5.set_base_font_size(24)
	sstring5.set_base_font_style(\"Default\")
	sstring5.set_text(\"WS حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	sstring5.extend_to_width(600, TLShapedString.TEXT_JUSTIFICATION_WHITESPACE_ONLY)

	sstring6 = TLShapedString.new()
	sstring6.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring6.set_base_font(font2)
	sstring6.set_base_font_size(24)
	sstring6.set_base_font_style(\"Default\")
	sstring6.set_text(\"WS حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")
	sstring6.extend_to_width(600, TLShapedString.TEXT_JUSTIFICATION_WHITESPACE_ONLY)

func _draw():
	draw_line(Vector2(20, 20), Vector2(20, 500), Color(1, 0, 1))
	draw_line(Vector2(620, 20), Vector2(620, 500), Color(1, 0, 1))
	var ofs = sstring1.get_ascent() + 20
	sstring1.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring1.get_descent() + sstring2.get_ascent() + 20
	sstring2.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring2.get_descent() + sstring3.get_ascent() + 20
	sstring3.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring3.get_descent() + sstring4.get_ascent() + 20
	sstring4.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring4.get_descent() + sstring5.get_ascent() + 20
	sstring5.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
	ofs +=sstring5.get_descent() + sstring6.get_ascent() + 20
	sstring6.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))
"

[sub_resource type="GDScript" id=11]

script/source = "extends ColorRect

var font1

var sstring1

func get_full_name():
	return \"OpenType features\"

func init():

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_RTL)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(24)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"Small caps, Small caps, 1234567890, 1234567890\")
	sstring1.set_features(\"+smcp[0:10]=1,+onum[24:35]=1\")

func _draw():
	var ofs = sstring1.get_ascent() + 20
	sstring1.draw(get_canvas_item(), Vector2(20, ofs), Color(0, 0, 1))"

[sub_resource type="GDScript" id=12]

script/source = "extends ColorRect

var font1
var font2
var font3

var image1 = preload(\"res://icon.png\")

var sastring1

func get_full_name():
	return \"Drawing attributed shaped string\"

func init():

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")
	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	var face2 = TLDynamicFontFace.new()
	face2.load(\"res://fonts/NotoSans-Regular.ttf\")
	font2 = TLFontFamily.new()
	font2.add_face(\"Default\", face2)

	var face3 = TLDynamicFontFace.new()
	face3.load(\"res://fonts/NotoColorEmoji-subset.ttf\")
	font3 = TLFontFamily.new()
	font3.add_face(\"Default\", face3)

	#note: On Windows Godot sting unable to handle characters outside BMP, using raw UTF-16 string instead.
	#text: Attrib Test - 123 - Test [emote] Test

	var bytes = PoolByteArray([0x41, 0x00, 0x74, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, 0x00, 0x62, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, 0x2D, 0x00, 0x20, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x20, 0x00, 0x2D, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x3D, 0xD8, 0x04, 0xDE, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00])

	sastring1 = TLShapedAttributedString.new()
	sastring1.set_base_font(font1)
	sastring1.set_base_font_size(20)
	sastring1.set_base_font_style(\"Default\")
	sastring1.set_utf16(bytes)

	#set custom font and colors
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT, font2, 7, 11)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_COLOR, Color(0, 1, 0), 0, 4)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_OUTLINE_COLOR, Color(0, 0, 1), 2, 6)

	#lines
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_UNDERLINE_COLOR, Color(0, 0, 1), 1, 6)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_UNDERLINE_WIDTH, 2, 2, 4)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_STRIKETHROUGH_COLOR, Color(1, 0, 0), 0, 1)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_STRIKETHROUGH_WIDTH, 3, 0, 1)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_OVERLINE_COLOR, Color(0, 1, 0), 4, 9)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_OVERLINE_WIDTH, 2, 4, 7)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_HIGHLIGHT_COLOR, Color(1, 1, 0), 10, 14)

	#embed images
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_IMAGE, image1, 14, 15)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_VALIGN, TLShapedAttributedString.TEXT_VALIGN_TOP, 14, 15)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_IMAGE, image1, 15, 16)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_VALIGN, TLShapedAttributedString.TEXT_VALIGN_CENTER, 15, 16)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_IMAGE, image1, 16, 17)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_VALIGN, TLShapedAttributedString.TEXT_VALIGN_BOTTOM, 16, 17)

	#set emoji font
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT, font3, 24, 26)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT_SIZE, 64, 24, 26)
	#note: this emoji occupies two codepoints, it's character code is U+1F604, in UTF-16 it is encoded as 0xD83D 0xDE04 surrogate pair

func _draw():
	sastring1.draw(get_canvas_item(), Vector2(20, sastring1.get_ascent() + 20), Color(0, 0, 0))"

[sub_resource type="GDScript" id=13]

script/source = "extends ColorRect

var font1

var sstring1

var x = -1;
var x_end = -1;
var crect = Rect2()
var crect_lead
var cursors = []
var cursors_end = []
var selection_rects = []

func get_full_name():
	return \"Hit test, cursors, selection and cluster info (plain string)\"

func init():
	set_focus_mode(FOCUS_ALL);

	var face1en = TLDynamicFontFace.new()
	face1en.load(\"res://fonts/NotoSans-Regular.ttf\")

	var face1ar = TLDynamicFontFace.new()
	face1ar.load(\"res://fonts/NotoNaskhArabic-Regular.ttf\")

	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1en)
	font1.add_face_for_script(\"Default\", face1ar, \"arab\")

	sstring1 = TLShapedString.new()
	sstring1.set_base_direction(TLShapedString.TEXT_DIRECTION_LTR)
	sstring1.set_base_font(font1)
	sstring1.set_base_font_size(24)
	sstring1.set_base_font_style(\"Default\")
	sstring1.set_text(\"maintained in their own test حسنِ مہ گرچہ بہ ہنگامِ کمال اچّھا ہے\")

func _draw():
	#draw selection
	for r in selection_rects:
		draw_rect(Rect2(r.position + Vector2(20, 20), r.size), Color(1, 1, 0), true)

	#draw string
	sstring1.draw(get_canvas_item(), Vector2(20, sstring1.get_ascent() + 20), Color(0, 0, 0.4))

	#draw cursors
	for c in cursors:
		draw_line(Vector2(20 + c, 20), Vector2(20 + c, sstring1.get_height() + 20), Color(1, 0, 0, 0.4), 2)
	for c in cursors_end:
		draw_line(Vector2(20 + c, 20), Vector2(20 + c, sstring1.get_height() + 20), Color(1, 0, 1, 0.4), 2)

	#draw cluster bounding rect
	if crect != Rect2() :
		draw_rect(Rect2(crect.position + Vector2(20, sstring1.get_ascent() + 20), crect.size), Color(0, 1, 0, 0.5), false)
		draw_circle(Vector2(20 + crect_lead, crect.position.y + sstring1.get_ascent() + 20 + crect.size.y), 3, Color(1, 0, 1))

func _on_hit_test_gui_input(event):
	if event is InputEventMouseMotion:
		#cluster bounding rect
		crect = Rect2()
		if (event.position.y >= 20) and (event.position.y < 20 + sstring1.get_height()):
			var y = sstring1.hit_test_cluster(event.position.x - 20)
			crect = sstring1.get_cluster_rect(y)
			crect_lead = sstring1.get_cluster_leading_edge(y)
			$info.text = \"Cluster: %d of %d, Codepoint positions: %d...%d of %d, Ascent: %f, Descent: %f\" % [y, sstring1.clusters(), sstring1.get_cluster_start(y), sstring1.get_cluster_end(y), sstring1.length(), sstring1.get_cluster_ascent(y), sstring1.get_cluster_descent(y)]

	if event is InputEventMouseButton:
		if event.get_shift():
			#selection end
			cursors_end.clear()
			x_end = - 1
			if (event.position.y >= 20) and (event.position.y < 20 + sstring1.get_height()):
				x_end = sstring1.hit_test(event.position.x - 20)
				cursors_end = sstring1.get_cursor_positions(x_end, TLShapedString.TEXT_DIRECTION_LTR)
		else:
			#selection start / cursor
			cursors.clear()
			cursors_end.clear()
			x = - 1
			x_end = - 1
			if (event.position.y >= 20) and (event.position.y < 20 + sstring1.get_height()):
				x = sstring1.hit_test(event.position.x - 20)
				cursors = sstring1.get_cursor_positions(x, TLShapedString.TEXT_DIRECTION_LTR)
		selection_rects.clear()

	if event is InputEventKey:
		if event.is_pressed():
			if event.get_shift():
				cursors_end.clear()
				if event.scancode == KEY_LEFT:
					if x_end == -1:
						x_end = x
					if x_end > 0:
						x_end -= 1
				if event.scancode == KEY_RIGHT:
					if x_end == -1:
						x_end = x
					if x_end < sstring1.length():
						x_end += 1
				cursors_end = sstring1.get_cursor_positions(x_end, TLShapedString.TEXT_DIRECTION_LTR)
			else:
				cursors.clear()
				cursors_end.clear()
				x_end = - 1
				if event.scancode == KEY_LEFT:
					if x > 0:
						x -= 1
				if event.scancode == KEY_RIGHT:
					if x < sstring1.length():
						x += 1
				cursors = sstring1.get_cursor_positions(x, TLShapedString.TEXT_DIRECTION_LTR)

	if (x != -1) and (x_end != -1):
		#capture selection rects
		selection_rects = sstring1.get_highlight_shapes(min(x, x_end), max(x, x_end))
	else:
		selection_rects = []

	accept_event()
	update()
"

[sub_resource type="GDScript" id=14]

script/source = "extends ColorRect

var font1
var font2
var font3

var image1 = preload(\"res://icon.png\")

var sastring1

var x = -1;
var x_end = -1;
var crect = Rect2()
var crect_lead
var cursors = []
var cursors_end = []
var selection_rects = []

func get_full_name():
	return \"Hit test, cursors, selection and cluster info (attributed string)\"

func init():
	set_focus_mode(FOCUS_ALL);

	var face1 = TLDynamicFontFace.new()
	face1.load(\"res://fonts/Montserrat-Black.ttf\")
	font1 = TLFontFamily.new()
	font1.add_face(\"Default\", face1)

	var face2 = TLDynamicFontFace.new()
	face2.load(\"res://fonts/NotoSans-Regular.ttf\")
	font2 = TLFontFamily.new()
	font2.add_face(\"Default\", face2)

	var face3 = TLDynamicFontFace.new()
	face3.load(\"res://fonts/NotoColorEmoji-subset.ttf\")
	font3 = TLFontFamily.new()
	font3.add_face(\"Default\", face3)

	#note: On Windows Godot sting unable to handle characters outside BMP, using raw UTF-16 string instead.
	#text: Attrib Test - 123 - Test [emote] Test

	var bytes = PoolByteArray([0x41, 0x00, 0x74, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, 0x00, 0x62, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, 0x2D, 0x00, 0x20, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x20, 0x00, 0x2D, 0x00, 0x20, 0x00, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x3D, 0xD8, 0x04, 0xDE, 0x54, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00])

	sastring1 = TLShapedAttributedString.new()
	sastring1.set_base_font(font1)
	sastring1.set_base_font_size(20)
	sastring1.set_base_font_style(\"Default\")
	sastring1.set_utf16(bytes)

	#set custom font and colors
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT, font2, 7, 11)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_COLOR, Color(0, 1, 0), 0, 4)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_OUTLINE_COLOR, Color(0, 0, 1), 2, 6)

	#lines
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_UNDERLINE_COLOR, Color(0, 0, 1), 1, 6)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_UNDERLINE_WIDTH, 2, 2, 4)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_STRIKETHROUGH_COLOR, Color(1, 0, 0), 0, 1)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_STRIKETHROUGH_WIDTH, 3, 0, 1)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_OVERLINE_COLOR, Color(0, 1, 0), 4, 9)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_OVERLINE_WIDTH, 2, 4, 7)

	#embed images
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_IMAGE, image1, 14, 15)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_VALIGN, TLShapedAttributedString.TEXT_VALIGN_TOP, 14, 15)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_IMAGE, image1, 15, 16)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_VALIGN, TLShapedAttributedString.TEXT_VALIGN_CENTER, 15, 16)

	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_IMAGE, image1, 16, 17)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_REPLACEMENT_VALIGN, TLShapedAttributedString.TEXT_VALIGN_BOTTOM, 16, 17)

	#set emoji font
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT, font3, 24, 26)
	sastring1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT_SIZE, 26, 24, 26)
	#note: this emoji occupies two codepoints, it's character code is U+1F604, in UTF-16 it is encoded as 0xD83D 0xDE04 surrogate pair

func _draw():
	#draw selection
	for r in selection_rects:
		draw_rect(Rect2(r.position + Vector2(20, 20), r.size), Color(1, 1, 0), true)

	#draw string
	sastring1.draw(get_canvas_item(), Vector2(20, sastring1.get_ascent() + 20), Color(0, 0, 0))

	#draw cursors
	for c in cursors:
		draw_line(Vector2(20 + c, 20), Vector2(20 + c, sastring1.get_height() + 20), Color(1, 0, 0, 0.4), 2)
	for c in cursors_end:
		draw_line(Vector2(20 + c, 20), Vector2(20 + c, sastring1.get_height() + 20), Color(1, 0, 1, 0.4), 2)

	#draw cluster bounding rect
	if crect != Rect2() :
		draw_rect(Rect2(crect.position + Vector2(20, sastring1.get_ascent() + 20), crect.size), Color(0, 1, 0, 0.5), false)
		draw_circle(Vector2(20 + crect_lead, crect.position.y + sastring1.get_ascent() + 20 + crect.size.y), 3, Color(1, 0, 1))

func _on_hit_test_gui_input(event):
	if event is InputEventMouseMotion:
		#cluster bounding rect
		crect = Rect2()
		if (event.position.y >= 20) and (event.position.y < 20 + sastring1.get_height()):
			var y = sastring1.hit_test_cluster(event.position.x - 20)
			crect = sastring1.get_cluster_rect(y)
			crect_lead = sastring1.get_cluster_leading_edge(y)
			$info.text = \"Cluster: %d of %d, Codepoint positions: %d...%d of %d, Ascent: %f, Descent: %f\" % [y, sastring1.clusters(), sastring1.get_cluster_start(y), sastring1.get_cluster_end(y), sastring1.length(), sastring1.get_cluster_ascent(y), sastring1.get_cluster_descent(y)]

	if event is InputEventMouseButton:
		if event.get_shift():
			#selection end
			cursors_end.clear()
			x_end = - 1
			if (event.position.y >= 20) and (event.position.y < 20 + sastring1.get_height()):
				x_end = sastring1.hit_test(event.position.x - 20)
				cursors_end = sastring1.get_cursor_positions(x_end, TLShapedString.TEXT_DIRECTION_LTR)
		else:
			#selection start / cursor
			cursors.clear()
			cursors_end.clear()
			x = - 1
			x_end = - 1
			if (event.position.y >= 20) and (event.position.y < 20 + sastring1.get_height()):
				x = sastring1.hit_test(event.position.x - 20)
				cursors = sastring1.get_cursor_positions(x, TLShapedString.TEXT_DIRECTION_LTR)
		selection_rects.clear()

	if event is InputEventKey:
		if event.is_pressed():
			if event.get_shift():
				cursors_end.clear()
				if event.scancode == KEY_LEFT:
					if x_end == -1:
						x_end = x
					if x_end > 0:
						x_end -= 1
				if event.scancode == KEY_RIGHT:
					if x_end == -1:
						x_end = x
					if x_end < sastring1.length():
						x_end += 1
				cursors_end = sastring1.get_cursor_positions(x_end, TLShapedString.TEXT_DIRECTION_LTR)
			else:
				cursors.clear()
				cursors_end.clear()
				x_end = - 1
				if event.scancode == KEY_LEFT:
					if x > 0:
						x -= 1
				if event.scancode == KEY_RIGHT:
					if x < sastring1.length():
						x += 1
				cursors = sastring1.get_cursor_positions(x, TLShapedString.TEXT_DIRECTION_LTR)

	if (x != -1) and (x_end != -1):
		#capture selection rects
		selection_rects = sastring1.get_highlight_shapes(min(x, x_end), max(x, x_end))
	else:
		selection_rects = []

	accept_event()
	update()"

[node name="root" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = SubResource( 1 )

[node name="demos_opt" type="OptionButton" parent="."]
margin_left = 80.0
margin_top = 20.0
margin_right = 710.0
margin_bottom = 50.0

[node name="label" type="Label" parent="."]
margin_left = 10.0
margin_top = 20.0
margin_right = 70.0
margin_bottom = 50.0
text = "Demo:"
valign = 1

[node name="demos" type="Control" parent="."]
margin_left = 10.0
margin_top = 70.0
margin_right = 710.0
margin_bottom = 600.0

[node name="intro" type="ColorRect" parent="demos"]
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 2 )

[node name="no_sub" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 3 )

[node name="fb_sub" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 4 )

[node name="lnk_sub" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 5 )

[node name="shaped_str_dyn" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 6 )

[node name="shaped_str_dyn_graphite" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 15 )

[node name="shaped_str_bmp" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 7 )

[node name="line_brk" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 8 )

[node name="line_brk_modes" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 9 )

[node name="line_just" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 10 )

[node name="ot_feat" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 11 )

[node name="attrib" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 12 )

[node name="hit_test" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 13 )

[node name="info" type="Label" parent="demos/hit_test"]
margin_left = 10.0
margin_top = 480.0
margin_right = 690.0
margin_bottom = 494.0
custom_colors/font_color = Color( 0, 0, 0, 1 )

[node name="controls" type="Label" parent="demos/hit_test"]
margin_left = 10.0
margin_top = 350.0
margin_right = 690.0
margin_bottom = 432.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Instructions:

 - Click / Shift+Click or use arrow keys to move cursor and make selection.
 - Move mouse cursor over text to view cluster info and boundig box."

[node name="hit_test_att" type="ColorRect" parent="demos"]
visible = false
margin_right = 700.0
margin_bottom = 500.0
script = SubResource( 14 )

[node name="info" type="Label" parent="demos/hit_test_att"]
margin_left = 10.0
margin_top = 480.0
margin_right = 690.0
margin_bottom = 494.0
custom_colors/font_color = Color( 0, 0, 0, 1 )

[node name="controls" type="Label" parent="demos/hit_test_att"]
margin_left = 10.0
margin_top = 350.0
margin_right = 690.0
margin_bottom = 432.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Instructions:

 - Click / Shift+Click or use arrow keys to move cursor and make selection.
 - Move mouse cursor over text to view cluster info and boundig box."

[node name="source_view" type="TextEdit" parent="."]
margin_left = 720.0
margin_top = 20.0
margin_right = 1390.0
margin_bottom = 570.0
readonly = true
syntax_highlighting = true

[connection signal="item_selected" from="demos_opt" to="." method="_on_item_selected"]
[connection signal="gui_input" from="demos/hit_test" to="demos/hit_test" method="_on_hit_test_gui_input"]
[connection signal="gui_input" from="demos/hit_test_att" to="demos/hit_test_att" method="_on_hit_test_gui_input"]


text:
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
;   [section] ; section goes between []
;   param=value ; assign values to parameters

config_version=4

_global_script_classes=[  ]
_global_script_class_icons={

}

[application]

config/name="libgdtl fuzzer (builtin)"
run/main_scene="res://main.tscn"
config/icon="res://icon.png"

[display]

window/size/width=1400
window/size/resizable=false

[rendering]

environment/default_environment="res://default_env.tres"

repo_language: C

mime_type: text/x-c


text:
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index 9175f6a..ec01cf9 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -50,7 +50,7 @@
 #endif

 bool Logger::should_log(bool p_err) {
-	return (!p_err || _print_error_enabled) && (p_err || _print_line_enabled);
+	return false;//(!p_err || _print_error_enabled) && (p_err || _print_line_enabled);
 }

 void Logger::log_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type) {
diff --git a/core/ustring.cpp b/core/ustring.cpp
index f029ae4..0567acc 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -1375,7 +1375,7 @@ String String::utf8(const char *p_utf8, int p_len) {

 bool String::parse_utf8(const char *p_utf8, int p_len) {

-#define _UNICERROR(m_err) print_line("Unicode error: " + String(m_err));
+//#define _UNICERROR(m_err) print_line("Unicode error: " + String(m_err));

 	if (!p_utf8)
 		return true;
@@ -1422,13 +1422,13 @@ bool String::parse_utf8(const char *p_utf8, int p_len) {
 				else if ((c & 0xFE) == 0xFC)
 					skip = 5;
 				else {
-					_UNICERROR("invalid skip");
+					//_UNICERROR("invalid skip");
 					return true; //invalid utf8
 				}

 				if (skip == 1 && (c & 0x1E) == 0) {
 					//printf("overlong rejected\n");
-					_UNICERROR("overlong rejected");
+					//_UNICERROR("overlong rejected");
 					return true; //reject overlong
 				}

@@ -1444,7 +1444,7 @@ bool String::parse_utf8(const char *p_utf8, int p_len) {
 		}

 		if (skip) {
-			_UNICERROR("no space left");
+			//_UNICERROR("no space left");
 			return true; //not enough spac
 		}
 	}
@@ -1476,19 +1476,19 @@ bool String::parse_utf8(const char *p_utf8, int p_len) {
 		else if ((*p_utf8 & 0xFE) == 0xFC)
 			len = 6;
 		else {
-			_UNICERROR("invalid len");
+			//_UNICERROR("invalid len");

 			return true; //invalid UTF8
 		}

 		if (len > cstr_size) {
-			_UNICERROR("no space left");
+			//_UNICERROR("no space left");
 			return true; //not enough space
 		}

 		if (len == 2 && (*p_utf8 & 0x1E) == 0) {
 			//printf("overlong rejected\n");
-			_UNICERROR("no space left");
+			//_UNICERROR("no space left");
 			return true; //reject overlong
 		}

@@ -1505,11 +1505,11 @@ bool String::parse_utf8(const char *p_utf8, int p_len) {
 			for (int i = 1; i < len; i++) {

 				if ((p_utf8[i] & 0xC0) != 0x80) {
-					_UNICERROR("invalid utf8");
+					//_UNICERROR("invalid utf8");
 					return true; //invalid utf8
 				}
 				if (unichar == 0 && i == 2 && ((p_utf8[i] & 0x7F) >> (7 - len)) == 0) {
-					_UNICERROR("invalid utf8 overlong");
+					//_UNICERROR("invalid utf8 overlong");
 					return true; //no overlong
 				}
 				unichar = (unichar << 6) | (p_utf8[i] & 0x3F);


text:
[gd_resource type="Environment" load_steps=2 format=2]

[sub_resource type="ProceduralSky" id=1]
sky_top_color = Color( 0.647059, 0.839216, 0.945098, 1 )
sky_horizon_color = Color( 0.839216, 0.917647, 0.980392, 1 )
ground_bottom_color = Color( 0.156863, 0.184314, 0.211765, 1 )
ground_horizon_color = Color( 0.423529, 0.396078, 0.372549, 1 )

[resource]
background_mode = 2
background_sky = SubResource( 1 )


text:
[gd_scene load_steps=2 format=2]

[sub_resource type="GDScript" id=1]
script/source = "extends Control

const FileList = [\"\", \"gqergerth45y245hygn\", \"AwamiNastaliq-Regular.ttf\", \"Montserrat-BlackItalic.ttf\", \"NotoNaskhArabicUI.fnt\", \"NotoSans-Regular.ttf\", \"ComicNeue-Bold.otf\", \"Montserrat-Italic.ttf\", \"NotoNaskhArabicUI_0.png\", \"NotoSansRegular.fnt\", \"ComicNeue-BoldOblique.otf\", \"Montserrat-Regular.ttf\", \"NotoNaskhArabicUI_0.png.import\", \"NotoSansRegular_0.png\", \"ComicNeue-Oblique.otf\", \"NotoColorEmoji-subset.ttf\", \"NotoNastaliqUrdu-Regular.ttf\", \"NotoSansRegular_0.png.import\", \"ComicNeue-Regular.otf\", \"NotoFull\", \"NotoSans-Bold.ttf\", \"NotoSansThai-Bold.ttf\", \"LICENSE_OFL.txt\", \"NotoNaskhArabic-Bold.ttf\", \"NotoSans-BoldItalic.ttf\", \"NotoSerifThai-Regular.ttf\", \"Montserrat-Black.ttf\", \"NotoNaskhArabic-Regular.ttf\", \"NotoSans-Italic.ttf\"]

var nt_fam_full
var content = []

var RANGE : int = 650001
var tooo = -2

func _ready():
	randomize()
	var data_loader = TLICUDataLoader.new()
	data_loader.load(\"res://fonts/icudt67l.dat\")

	nt_fam_full = TLFontFamily.new()

	var ms_rg_base = TLDynamicFontFace.new()
	ms_rg_base.load(\"res://fonts/NotoFull/NotoSans-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_base)

	var ms_rg_aghm = TLDynamicFontFace.new()
	ms_rg_aghm.load(\"res://fonts/NotoFull/NotoSansCaucasianAlbanian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_aghm, \"aghm\")

	var ms_rg_ahom = TLDynamicFontFace.new()
	ms_rg_ahom.load(\"res://fonts/NotoFull/NotoSerifAhom-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_ahom, \"ahom\")

	var ms_rg_bhks = TLDynamicFontFace.new()
	ms_rg_bhks.load(\"res://fonts/NotoFull/NotoSansBhaiksuki-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_bhks, \"bhks\")

	var ms_rg_dupl = TLDynamicFontFace.new()
	ms_rg_dupl.load(\"res://fonts/NotoFull/NotoSansDuployan-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_dupl, \"dupl\")

	var ms_rg_elba = TLDynamicFontFace.new()
	ms_rg_elba.load(\"res://fonts/NotoFull/NotoSansElbasan-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_elba, \"elba\")

	var ms_rg_gran = TLDynamicFontFace.new()
	ms_rg_gran.load(\"res://fonts/NotoFull/NotoSansGrantha-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_gran, \"gran\")

	var ms_rg_hatr = TLDynamicFontFace.new()
	ms_rg_hatr.load(\"res://fonts/NotoFull/NotoSansHatran-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_hatr, \"hatr\")

	var ms_rg_hmng = TLDynamicFontFace.new()
	ms_rg_hmng.load(\"res://fonts/NotoFull/NotoSansPahawhHmong-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_hmng, \"hmng\")

	var ms_rg_hung = TLDynamicFontFace.new()
	ms_rg_hung.load(\"res://fonts/NotoFull/NotoSansOldHungarian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_hung, \"hung\")

	var ms_rg_khoj = TLDynamicFontFace.new()
	ms_rg_khoj.load(\"res://fonts/NotoFull/NotoSansKhojki-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_khoj, \"khoj\")

	var ms_rg_mahj = TLDynamicFontFace.new()
	ms_rg_mahj.load(\"res://fonts/NotoFull/NotoSansMahajani-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mahj, \"mahj\")

	var ms_rg_mani = TLDynamicFontFace.new()
	ms_rg_mani.load(\"res://fonts/NotoFull/NotoSansManichaean-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mani, \"mani\")

	var ms_rg_marc = TLDynamicFontFace.new()
	ms_rg_marc.load(\"res://fonts/NotoFull/NotoSansMarchen-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_marc, \"marc\")

	var ms_rg_mend = TLDynamicFontFace.new()
	ms_rg_mend.load(\"res://fonts/NotoFull/NotoSansMendeKikakui-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mend, \"mend\")

	var ms_rg_modi = TLDynamicFontFace.new()
	ms_rg_modi.load(\"res://fonts/NotoFull/NotoSansModi-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_modi, \"modi\")

	var ms_rg_mero = TLDynamicFontFace.new()
	ms_rg_mero.load(\"res://fonts/NotoFull/NotoSansMeroitic-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mero, \"mero\")

	var ms_rg_mroo = TLDynamicFontFace.new()
	ms_rg_mroo.load(\"res://fonts/NotoFull/NotoSansMro-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mroo, \"mroo\")

	var ms_rg_mult = TLDynamicFontFace.new()
	ms_rg_mult.load(\"res://fonts/NotoFull/NotoSansMultani-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mult, \"mult\")

	var ms_rg_narb = TLDynamicFontFace.new()
	ms_rg_narb.load(\"res://fonts/NotoFull/NotoSansOldNorthArabian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_narb, \"narb\")

	var ms_rg_nbat = TLDynamicFontFace.new()
	ms_rg_nbat.load(\"res://fonts/NotoFull/NotoSansNabataean-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_nbat, \"nbat\")

	var ms_rg_newa = TLDynamicFontFace.new()
	ms_rg_newa.load(\"res://fonts/NotoFull/NotoSansNewa-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_newa, \"newa\")

	var ms_rg_palm = TLDynamicFontFace.new()
	ms_rg_palm.load(\"res://fonts/NotoFull/NotoSansPalmyrene-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_palm, \"palm\")

	var ms_rg_pauc = TLDynamicFontFace.new()
	ms_rg_pauc.load(\"res://fonts/NotoFull/NotoSansPauCinHau-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_pauc, \"pauc\")

	var ms_rg_perm = TLDynamicFontFace.new()
	ms_rg_perm.load(\"res://fonts/NotoFull/NotoSansOldPermic-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_perm, \"perm\")

	var ms_rg_phlp = TLDynamicFontFace.new()
	ms_rg_phlp.load(\"res://fonts/NotoFull/NotoSansPsalterPahlavi-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_phlp, \"phlp\")

	var ms_rg_plrd = TLDynamicFontFace.new()
	ms_rg_plrd.load(\"res://fonts/NotoFull/NotoSansMiao-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_plrd, \"plrd\")

	var ms_rg_shrd = TLDynamicFontFace.new()
	ms_rg_shrd.load(\"res://fonts/NotoFull/NotoSansSharada-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_shrd, \"shrd\")

	var ms_rg_sind = TLDynamicFontFace.new()
	ms_rg_sind.load(\"res://fonts/NotoFull/NotoSansKhudawadi-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_sind, \"sind\")

	var ms_rg_sora = TLDynamicFontFace.new()
	ms_rg_sora.load(\"res://fonts/NotoFull/NotoSansSoraSompeng-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_sora, \"sora\")

	var ms_rg_takr = TLDynamicFontFace.new()
	ms_rg_takr.load(\"res://fonts/NotoFull/NotoSansTakri-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_takr, \"takr\")

	var ms_rg_tirh = TLDynamicFontFace.new()
	ms_rg_tirh.load(\"res://fonts/NotoFull/NotoSansTirhuta-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_tirh, \"tirh\")

	var ms_rg_wara = TLDynamicFontFace.new()
	ms_rg_wara.load(\"res://fonts/NotoFull/NotoSansWarangCiti-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_wara, \"wara\")

	var ms_rg_hluw = TLDynamicFontFace.new()
	ms_rg_hluw.load(\"res://fonts/NotoFull/NotoSansAnatolianHieroglyphs-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_hluw, \"hluw\")

	var ms_rg_mymr = TLDynamicFontFace.new()
	ms_rg_mymr.load(\"res://fonts/NotoFull/NotoSansMyanmar-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_mymr)

	var ms_rg_telu = TLDynamicFontFace.new()
	ms_rg_telu.load(\"res://fonts/NotoFull/NotoSansTelugu-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_telu)

	var ms_rg_guru = TLDynamicFontFace.new()
	ms_rg_guru.load(\"res://fonts/NotoFull/NotoSansGurmukhi-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_guru)

	var ms_rg_orya = TLDynamicFontFace.new()
	ms_rg_orya.load(\"res://fonts/NotoFull/NotoSansOriya-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_orya)

	var ms_rg_thai = TLDynamicFontFace.new()
	ms_rg_thai.load(\"res://fonts/NotoFull/NotoSansThai-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_thai)

	var ms_rg_knda = TLDynamicFontFace.new()
	ms_rg_knda.load(\"res://fonts/NotoFull/NotoSansKannada-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_knda)

	var ms_rg_osge = TLDynamicFontFace.new()
	ms_rg_osge.load(\"res://fonts/NotoFull/NotoSansOsage-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_osge, \"osge\")

	var ms_rg_tibt = TLDynamicFontFace.new()
	ms_rg_tibt.load(\"res://fonts/NotoFull/NotoSansTibetan-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_tibt)

	var ms_rg_mlym = TLDynamicFontFace.new()
	ms_rg_mlym.load(\"res://fonts/NotoFull/NotoSansMalayalam-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_mlym)

	var ms_rg_sinh = TLDynamicFontFace.new()
	ms_rg_sinh.load(\"res://fonts/NotoFull/NotoSansSinhala-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_sinh)

	var ms_rg_taml = TLDynamicFontFace.new()
	ms_rg_taml.load(\"res://fonts/NotoFull/NotoSansTamil-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_taml)

	var ms_rg_adlm = TLDynamicFontFace.new()
	ms_rg_adlm.load(\"res://fonts/NotoFull/NotoSansAdlam-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_adlm, \"adlm\")

	var ms_rg_hani = TLDynamicFontFace.new()
	ms_rg_hani.load(\"res://fonts/NotoFull/NotoSansCJKjp-Regular.otf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_hani)

	var ms_rg_deva = TLDynamicFontFace.new()
	ms_rg_deva.load(\"res://fonts/NotoFull/NotoSansDevanagari-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_deva)

	var ms_rg_khar = TLDynamicFontFace.new()
	ms_rg_khar.load(\"res://fonts/NotoFull/NotoSansKharoshthi-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_khar)

	var ms_rg_arab = TLDynamicFontFace.new()
	ms_rg_arab.load(\"res://fonts/NotoFull/NotoSansArabic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_arab)

	var ms_rg_cans = TLDynamicFontFace.new()
	ms_rg_cans.load(\"res://fonts/NotoFull/NotoSansCanadianAboriginal-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_cans)

	var ms_rg_ethi = TLDynamicFontFace.new()
	ms_rg_ethi.load(\"res://fonts/NotoFull/NotoSansEthiopic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_ethi)

	var ms_rg_khmr = TLDynamicFontFace.new()
	ms_rg_khmr.load(\"res://fonts/NotoFull/NotoSansKhmer-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_khmr)

	var ms_rg_armn = TLDynamicFontFace.new()
	ms_rg_armn.load(\"res://fonts/NotoFull/NotoSansArmenian-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_armn)

	var ms_rg_cakm = TLDynamicFontFace.new()
	ms_rg_cakm.load(\"res://fonts/NotoFull/NotoSansChakma-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_cakm, \"cakm\")

	var ms_rg_geor = TLDynamicFontFace.new()
	ms_rg_geor.load(\"res://fonts/NotoFull/NotoSansGeorgian-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_geor)

	var ms_rg_laoo = TLDynamicFontFace.new()
	ms_rg_laoo.load(\"res://fonts/NotoFull/NotoSansLao-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_laoo)

	var ms_rg_beng = TLDynamicFontFace.new()
	ms_rg_beng.load(\"res://fonts/NotoFull/NotoSansBengali-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_beng)

	var ms_rg_cher = TLDynamicFontFace.new()
	ms_rg_cher.load(\"res://fonts/NotoFull/NotoSansCherokee-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_cher)

	var ms_rg_gujr = TLDynamicFontFace.new()
	ms_rg_gujr.load(\"res://fonts/NotoFull/NotoSansGujarati-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_gujr)

	var ms_rg_buhd = TLDynamicFontFace.new()
	ms_rg_buhd.load(\"res://fonts/NotoFull/NotoSansBuhid-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_buhd)

	var ms_rg_dsrt = TLDynamicFontFace.new()
	ms_rg_dsrt.load(\"res://fonts/NotoFull/NotoSansDeseret-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_dsrt)

	var ms_rg_hebr = TLDynamicFontFace.new()
	ms_rg_hebr.load(\"res://fonts/NotoFull/NotoSansHebrew-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_hebr)

	var ms_rg_avst = TLDynamicFontFace.new()
	ms_rg_avst.load(\"res://fonts/NotoFull/NotoSansAvestan-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_avst, \"avst\")

	var ms_rg_bali = TLDynamicFontFace.new()
	ms_rg_bali.load(\"res://fonts/NotoFull/NotoSansBalinese-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_bali)

	var ms_rg_bamu = TLDynamicFontFace.new()
	ms_rg_bamu.load(\"res://fonts/NotoFull/NotoSansBamum-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_bamu, \"bamu\")

	var ms_rg_batk = TLDynamicFontFace.new()
	ms_rg_batk.load(\"res://fonts/NotoFull/NotoSansBatak-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_batk, \"batk\")

	var ms_rg_brah = TLDynamicFontFace.new()
	ms_rg_brah.load(\"res://fonts/NotoFull/NotoSansBrahmi-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_brah, \"brah\")

	var ms_rg_bugi = TLDynamicFontFace.new()
	ms_rg_bugi.load(\"res://fonts/NotoFull/NotoSansBuginese-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_bugi)

	var ms_rg_cari = TLDynamicFontFace.new()
	ms_rg_cari.load(\"res://fonts/NotoFull/NotoSansCarian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_cari, \"cari\")

	var ms_rg_copt = TLDynamicFontFace.new()
	ms_rg_copt.load(\"res://fonts/NotoFull/NotoSansCoptic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_copt)

	var ms_rg_xsux = TLDynamicFontFace.new()
	ms_rg_xsux.load(\"res://fonts/NotoFull/NotoSansCuneiform-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_xsux)

	var ms_rg_cprt = TLDynamicFontFace.new()
	ms_rg_cprt.load(\"res://fonts/NotoFull/NotoSansCypriot-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_cprt)

	var ms_rg_egyp = TLDynamicFontFace.new()
	ms_rg_egyp.load(\"res://fonts/NotoFull/NotoSansEgyptianHieroglyphs-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_egyp, \"egyp\")

	var ms_rg_glag = TLDynamicFontFace.new()
	ms_rg_glag.load(\"res://fonts/NotoFull/NotoSansGlagolitic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_glag)

	var ms_rg_goth = TLDynamicFontFace.new()
	ms_rg_goth.load(\"res://fonts/NotoFull/NotoSansGothic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_goth)

	var ms_rg_hano = TLDynamicFontFace.new()
	ms_rg_hano.load(\"res://fonts/NotoFull/NotoSansHanunoo-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_hano)

	var ms_rg_armi = TLDynamicFontFace.new()
	ms_rg_armi.load(\"res://fonts/NotoFull/NotoSansImperialAramaic-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_armi, \"armi\")

	var ms_rg_phli = TLDynamicFontFace.new()
	ms_rg_phli.load(\"res://fonts/NotoFull/NotoSansInscriptionalPahlavi-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_phli, \"phli\")

	var ms_rg_prti = TLDynamicFontFace.new()
	ms_rg_prti.load(\"res://fonts/NotoFull/NotoSansInscriptionalParthian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_prti, \"prti\")

	var ms_rg_java = TLDynamicFontFace.new()
	ms_rg_java.load(\"res://fonts/NotoFull/NotoSansJavanese-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_java, \"java\")

	var ms_rg_kthi = TLDynamicFontFace.new()
	ms_rg_kthi.load(\"res://fonts/NotoFull/NotoSansKaithi-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_kthi, \"kthi\")

	var ms_rg_kali = TLDynamicFontFace.new()
	ms_rg_kali.load(\"res://fonts/NotoFull/NotoSansKayahLi-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_kali)

	var ms_rg_lepc = TLDynamicFontFace.new()
	ms_rg_lepc.load(\"res://fonts/NotoFull/NotoSansLepcha-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_lepc)

	var ms_rg_limb = TLDynamicFontFace.new()
	ms_rg_limb.load(\"res://fonts/NotoFull/NotoSansLimbu-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_limb)

	var ms_rg_lina = TLDynamicFontFace.new()
	ms_rg_lina.load(\"res://fonts/NotoFull/NotoSansLinearA-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_lina, \"lina\")

	var ms_rg_linb = TLDynamicFontFace.new()
	ms_rg_linb.load(\"res://fonts/NotoFull/NotoSansLinearB-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_linb)

	var ms_rg_lisu = TLDynamicFontFace.new()
	ms_rg_lisu.load(\"res://fonts/NotoFull/NotoSansLisu-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_lisu, \"lisu\")

	var ms_rg_lyci = TLDynamicFontFace.new()
	ms_rg_lyci.load(\"res://fonts/NotoFull/NotoSansLycian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_lyci, \"lyci\")

	var ms_rg_lydi = TLDynamicFontFace.new()
	ms_rg_lydi.load(\"res://fonts/NotoFull/NotoSansLydian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_lydi, \"lydi\")

	var ms_rg_mand = TLDynamicFontFace.new()
	ms_rg_mand.load(\"res://fonts/NotoFull/NotoSansMandaic-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mand, \"mand\")

	var ms_rg_mtei = TLDynamicFontFace.new()
	ms_rg_mtei.load(\"res://fonts/NotoFull/NotoSansMeeteiMayek-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_mtei, \"mtei\")

	var ms_rg_mong = TLDynamicFontFace.new()
	ms_rg_mong.load(\"res://fonts/NotoFull/NotoSansMongolian-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_mong)

	var ms_rg_nkoo = TLDynamicFontFace.new()
	ms_rg_nkoo.load(\"res://fonts/NotoFull/NotoSansNKo-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_nkoo)

	var ms_rg_talu = TLDynamicFontFace.new()
	ms_rg_talu.load(\"res://fonts/NotoFull/NotoSansNewTaiLue-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_talu)

	var ms_rg_ogam = TLDynamicFontFace.new()
	ms_rg_ogam.load(\"res://fonts/NotoFull/NotoSansOgham-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_ogam)

	var ms_rg_olck = TLDynamicFontFace.new()
	ms_rg_olck.load(\"res://fonts/NotoFull/NotoSansOlChiki-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_olck)

	var ms_rg_ital = TLDynamicFontFace.new()
	ms_rg_ital.load(\"res://fonts/NotoFull/NotoSansOldItalic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_ital)

	var ms_rg_xpeo = TLDynamicFontFace.new()
	ms_rg_xpeo.load(\"res://fonts/NotoFull/NotoSansOldPersian-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_xpeo)

	var ms_rg_sarb = TLDynamicFontFace.new()
	ms_rg_sarb.load(\"res://fonts/NotoFull/NotoSansOldSouthArabian-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_sarb, \"sarb\")

	var ms_rg_orkh = TLDynamicFontFace.new()
	ms_rg_orkh.load(\"res://fonts/NotoFull/NotoSansOldTurkic-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_orkh, \"orkh\")

	var ms_rg_osma = TLDynamicFontFace.new()
	ms_rg_osma.load(\"res://fonts/NotoFull/NotoSansOsmanya-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_osma)

	var ms_rg_phag = TLDynamicFontFace.new()
	ms_rg_phag.load(\"res://fonts/NotoFull/NotoSansPhagsPa-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_phag, \"phag\")

	var ms_rg_phnx = TLDynamicFontFace.new()
	ms_rg_phnx.load(\"res://fonts/NotoFull/NotoSansPhoenician-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_phnx, \"phnx\")

	var ms_rg_rjng = TLDynamicFontFace.new()
	ms_rg_rjng.load(\"res://fonts/NotoFull/NotoSansRejang-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_rjng)

	var ms_rg_runr = TLDynamicFontFace.new()
	ms_rg_runr.load(\"res://fonts/NotoFull/NotoSansRunic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_runr)

	var ms_rg_samr = TLDynamicFontFace.new()
	ms_rg_samr.load(\"res://fonts/NotoFull/NotoSansSamaritan-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_samr, \"samr\")

	var ms_rg_saur = TLDynamicFontFace.new()
	ms_rg_saur.load(\"res://fonts/NotoFull/NotoSansSaurashtra-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_saur)

	var ms_rg_shaw = TLDynamicFontFace.new()
	ms_rg_shaw.load(\"res://fonts/NotoFull/NotoSansShavian-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_shaw)

	var ms_rg_sund = TLDynamicFontFace.new()
	ms_rg_sund.load(\"res://fonts/NotoFull/NotoSansSundanese-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_sund)

	var ms_rg_sylo = TLDynamicFontFace.new()
	ms_rg_sylo.load(\"res://fonts/NotoFull/NotoSansSylotiNagri-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_sylo)

	var ms_rg_syrc = TLDynamicFontFace.new()
	ms_rg_syrc.load(\"res://fonts/NotoFull/NotoSansSyriacEastern-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_syrc)

	var ms_rg_tglg = TLDynamicFontFace.new()
	ms_rg_tglg.load(\"res://fonts/NotoFull/NotoSansTagalog-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_tglg)

	var ms_rg_tagb = TLDynamicFontFace.new()
	ms_rg_tagb.load(\"res://fonts/NotoFull/NotoSansTagbanwa-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_tagb)

	var ms_rg_tale = TLDynamicFontFace.new()
	ms_rg_tale.load(\"res://fonts/NotoFull/NotoSansTaiLe-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_tale)

	var ms_rg_lana = TLDynamicFontFace.new()
	ms_rg_lana.load(\"res://fonts/NotoFull/NotoSansTaiTham-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_lana, \"lana\")

	var ms_rg_tavt = TLDynamicFontFace.new()
	ms_rg_tavt.load(\"res://fonts/NotoFull/NotoSansTaiViet-Regular.ttf\")
	nt_fam_full.add_face_for_script(\"Regular\", ms_rg_tavt, \"tavt\")

	var ms_rg_thaa = TLDynamicFontFace.new()
	ms_rg_thaa.load(\"res://fonts/NotoFull/NotoSansThaana-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_thaa)

	var ms_rg_tfng = TLDynamicFontFace.new()
	ms_rg_tfng.load(\"res://fonts/NotoFull/NotoSansTifinagh-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_tfng)

	var ms_rg_ugar = TLDynamicFontFace.new()
	ms_rg_ugar.load(\"res://fonts/NotoFull/NotoSansUgaritic-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_ugar)

	var ms_rg_vaii = TLDynamicFontFace.new()
	ms_rg_vaii.load(\"res://fonts/NotoFull/NotoSansVai-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_vaii)

	var ms_rg_yiii = TLDynamicFontFace.new()
	ms_rg_yiii.load(\"res://fonts/NotoFull/NotoSansYi-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_yiii)

	var ms_rg_cham = TLDynamicFontFace.new()
	ms_rg_cham.load(\"res://fonts/NotoFull/NotoSansCham-Regular.ttf\")
	nt_fam_full.add_face(\"Regular\", ms_rg_cham)

	var dir = Directory.new()
	if dir.open(\"res://text_source\") == OK:
		dir.list_dir_begin()
		var file_name = dir.get_next()
		while (file_name != \"\"):
			if file_name.get_extension() == \"txt\" and file_name != \"attributions.txt\":
				if !dir.current_is_dir():
					var file = File.new()
					file.open(\"res://text_source\".plus_file(file_name), File.READ)
					content.push_back(file.get_as_text().replace(\"\\n\", \"\"))
			file_name = dir.get_next()

var xxx = PoolByteArray([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0])
func _randintarray():
	for i in range(xxx.size() - 1):
		xxx[i] = randi() % 255 + 1
	return xxx

func _randstr():
	return _randintarray().get_string_from_utf8()

func _process(delta):
	OS.set_window_title(\"Run: \" + str(tooo))
	tooo = tooo + 1
	if (tooo <= 0):
		#skip some frames
		update()
	else:
		_fuzz_tlshapedparagraph()

func _fuzz_tlshapedparagraph():
	var para1 = TLShapedParagraph.new()
	var para2 = TLShapedParagraph.new()

	for i in range(2):
		if randi() % 6 == 0:
			para1.copy_properties(para2)

		para1.get_lines()
		para1.get_line(randi() % RANGE - RANGE / 2)

		if randi() % 3 == 0:
			para1.set_width(randf() * 1000)
		para1.get_width()

		if randi() % 3 == 0:
			para1.set_indent(randf() * 10)
		para1.get_indent()

		if randi() % 3 == 0:
			para1.set_back_color(Color(randf(),randf(),randf(),randf()))
		para1.get_back_color()

		if randi() % 3 == 0:
			para1.set_line_spacing(randf() * 10)
		para1.get_line_spacing()

		if randi() % 3 == 0:
			para1.set_string(_fuzz_tlattributedshapedstring())
		if randi() % 3 == 0:
			para1.set_string(_fuzz_tlshapedstring())
		para1.get_string()

		if randi() % 3 == 0:
			para1.set_brk_flags(randi() % RANGE - RANGE / 2)
		para1.get_brk_flags()

		if randi() % 3 == 0:
			para1.set_jst_flags(randi() % RANGE - RANGE / 2)
		para1.get_jst_flags()

		if randi() % 3 == 0:
			para1.set_halign(randi() % RANGE - RANGE / 2)
		para1.get_halign()

		para1.get_size()
		para1.get_word_bounds()
		para1.get_line_bounds()

		if randi() % 3 == 0:
			para2 = para1
	return para1

func _fuzz_tlattributedshapedstring():
	var str1 = TLShapedAttributedString.new()
	var str2 = TLShapedAttributedString.new()

	for i in range(2):
		if randi() % 6 == 0:
			str1.add_attribute(randi() % RANGE - RANGE / 2, _randintarray(), randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		if randi() % 2 == 0:
			str1.add_attribute(TLShapedAttributedString.TEXT_ATTRIBUTE_FONT, _fuzz_tlfontfamily(), randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		if randi() % 3 == 0:
			str1.remove_attribute(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.has_attribute(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_attribute(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_attribute_start(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_attribute_end(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		if randi() % 10 == 0:
			str1.remove_attributes(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		if randi() % 10 == 0:
			str1.clear_attributes()

		str1.get_embedded_rects()

		if randi() % 6 == 0:
			str1.load_attributes_dict(_randintarray())
		str1.save_attributes_dict()

		if randi() % 3 == 0:
			str2 = _fuzz_tlshapedstring()
		if randi() % 3 == 0:
			str1.copy_properties(str2)
		if randi() % 3 == 0:
			str1.add_sstring(str2)
		if randi() % 3 == 0:
			str1.replace_sstring(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, str2)

		if randi() % 3 == 0:
			str1.set_base_direction(randi() % RANGE - RANGE / 2)
		str1.get_base_direction()
		str1.get_para_direction()

		if randi() % 3 == 0:
			str1.set_text(_randstr())
			str1.get_text()
			str1.add_text(_randstr())
			str1.replace_text(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randstr())
		elif randi() % 3 == 0:
			str1.get_utf8()
			str1.set_utf8(_randintarray())
			str1.add_utf8(_randintarray())
			str1.replace_utf8(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randintarray())
		elif randi() % 3 == 0:
			str1.get_utf16()
			str1.set_utf16(_randintarray())
			str1.add_utf16(_randintarray())
			str1.replace_utf16(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randintarray())
		elif randi() % 3 == 0:
			str1.set_text(content[randi() % (content.size() - 1)])
		else:
			str1.get_utf32()
			str1.set_utf32(_randintarray())
			str1.add_utf32(_randintarray())
			str1.replace_utf32(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randintarray())

		if randi() % 3 == 0:
			str1.set_base_font(_fuzz_tlfontfamily())
		else:
			str1.set_base_font(nt_fam_full)
		str1.get_base_font();

		if randi() % 3 == 0:
			str1.set_base_font_style(_randstr())
		str1.get_base_font_style();

		if randi() % 3 == 0:
			str1.set_base_font_size(randf() * 255)
		str1.get_base_font_size()

		if randi() % 3 == 0:
			str1.set_features(_randstr())
		str1.get_features()

		if randi() % 3 == 0:
			str1.set_language(_randstr())
		str1.get_language();

		if randi() % 3 == 0:
			str1.set_preserve_control(bool(randi()%2))
		str1.get_preserve_control()

		if randi() % 3 == 0:
			str1.shape()
		str1.is_valid()
		str1.empty()
		str1.length()
		str1.char_count()

		str1.get_ascent()
		str1.get_descent()
		str1.get_width()
		str1.get_height()

		str1.break_words()
		str1.break_jst()
		if randi() % 3 == 0:
			str1.break_lines(randf() * 1000, randi() % RANGE - RANGE / 2)
		if randi() % 3 == 0:
			str2 = str1.substr(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, bool(randi()%2))
		if randi() % 3 == 0:
			str1.extend_to_width(randf() * 1000, randi() % RANGE - RANGE / 2);

		str1.clusters();
		str1.get_cluster_index(randi() % RANGE - RANGE / 2)
		str1.get_cluster_face(randi() % RANGE - RANGE / 2)
		str1.get_cluster_face_size(randi() % RANGE - RANGE / 2)
		str1.get_cluster_trailing_edge(randi() % RANGE - RANGE / 2)
		str1.get_cluster_leading_edge(randi() % RANGE - RANGE / 2)
		str1.get_cluster_start(randi() % RANGE - RANGE / 2)
		str1.get_cluster_end(randi() % RANGE - RANGE / 2)
		str1.get_cluster_ascent(randi() % RANGE - RANGE / 2)
		str1.get_cluster_descent(randi() % RANGE - RANGE / 2)
		str1.get_cluster_width(randi() % RANGE - RANGE / 2)
		str1.get_cluster_height(randi() % RANGE - RANGE / 2)
		str1.get_cluster_rect(randi() % RANGE - RANGE / 2)
		str1.get_cluster_debug_info(randi() % RANGE - RANGE / 2)

		str1.get_cluster_glyphs(randi() % RANGE - RANGE / 2)
		str1.get_cluster_glyph(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_cluster_glyph_offset(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_cluster_glyph_advance(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)

		str1.get_highlight_shapes(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_cursor_positions(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_char_direction(randi() % RANGE - RANGE / 2)
		str1.hit_test(randf())
		str1.hit_test_cluster(randf())

		str1.draw_cluster(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()))
		str1.draw(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()))

		str1.draw_dbg(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()), bool(randi()%2), bool(randi()%2))
		str1.draw_as_hex(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()), bool(randi()%2), bool(randi()%2))
		str1.draw_logical_as_hex(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()), bool(randi()%2), bool(randi()%2))

		str1.pos_u16_to_wcs(randi() % RANGE - RANGE / 2)
		str1.pos_wcs_to_u16(randi() % RANGE - RANGE / 2)

		str1.next_safe_bound(randi() % RANGE - RANGE / 2)
		str1.prev_safe_bound(randi() % RANGE - RANGE / 2)
	return str1

func _fuzz_tlshapedstring():
	var str1 = TLShapedString.new()
	var str2 = TLShapedString.new()

	for i in range(2):
		if randi() % 3 == 0:
			str1.copy_properties(str2)
		if randi() % 3 == 0:
			str1.add_sstring(str2)
		if randi() % 3 == 0:
			str1.replace_sstring(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, str2)

		if randi() % 3 == 0:
			str1.set_base_direction(randi() % RANGE - RANGE / 2)
		str1.get_base_direction()
		str1.get_para_direction()

		if randi() % 3 == 0:
			str1.set_text(_randstr())
			str1.get_text()
			str1.add_text(_randstr())
			str1.replace_text(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randstr())
		elif randi() % 3 == 0:
			str1.get_utf8()
			str1.set_utf8(_randintarray())
			str1.add_utf8(_randintarray())
			str1.replace_utf8(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randintarray())
		elif randi() % 3 == 0:
			str1.get_utf16()
			str1.set_utf16(_randintarray())
			str1.add_utf16(_randintarray())
			str1.replace_utf16(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randintarray())
		elif randi() % 3 == 0:
			str1.set_text(content[randi() % (content.size() - 1)])
		else:
			str1.get_utf32()
			str1.set_utf32(_randintarray())
			str1.add_utf32(_randintarray())
			str1.replace_utf32(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, _randintarray())

		if randi() % 3 == 0:
			str1.set_base_font(_fuzz_tlfontfamily())
		else:
			str1.set_base_font(nt_fam_full)
		str1.get_base_font();

		if randi() % 3 == 0:
			str1.set_base_font_style(_randstr())
		str1.get_base_font_style();

		if randi() % 3 == 0:
			str1.set_base_font_size(randf() * 255)
		str1.get_base_font_size()

		if randi() % 3 == 0:
			str1.set_features(_randstr())
		str1.get_features()

		if randi() % 3 == 0:
			str1.set_language(_randstr())
		str1.get_language();

		if randi() % 3 == 0:
			str1.set_preserve_control(bool(randi()%2))
		str1.get_preserve_control()

		if randi() % 3 == 0:
			str1.shape()
		str1.is_valid()
		str1.empty()
		str1.length()
		str1.char_count()

		str1.get_ascent()
		str1.get_descent()
		str1.get_width()
		str1.get_height()

		str1.break_words()
		str1.break_jst()
		if randi() % 3 == 0:
			str1.break_lines(randf() * 1000, randi() % RANGE - RANGE / 2)
		if randi() % 3 == 0:
			str2 = str1.substr(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2, bool(randi()%2))
		if randi() % 3 == 0:
			str1.extend_to_width(randf() * 1000, randi() % RANGE - RANGE / 2);

		str1.clusters();
		str1.get_cluster_index(randi() % RANGE - RANGE / 2)
		str1.get_cluster_face(randi() % RANGE - RANGE / 2)
		str1.get_cluster_face_size(randi() % RANGE - RANGE / 2)
		str1.get_cluster_trailing_edge(randi() % RANGE - RANGE / 2)
		str1.get_cluster_leading_edge(randi() % RANGE - RANGE / 2)
		str1.get_cluster_start(randi() % RANGE - RANGE / 2)
		str1.get_cluster_end(randi() % RANGE - RANGE / 2)
		str1.get_cluster_ascent(randi() % RANGE - RANGE / 2)
		str1.get_cluster_descent(randi() % RANGE - RANGE / 2)
		str1.get_cluster_width(randi() % RANGE - RANGE / 2)
		str1.get_cluster_height(randi() % RANGE - RANGE / 2)
		str1.get_cluster_rect(randi() % RANGE - RANGE / 2)
		str1.get_cluster_debug_info(randi() % RANGE - RANGE / 2)

		str1.get_cluster_glyphs(randi() % RANGE - RANGE / 2)
		str1.get_cluster_glyph(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_cluster_glyph_offset(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_cluster_glyph_advance(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)

		str1.get_highlight_shapes(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_cursor_positions(randi() % RANGE - RANGE / 2, randi() % RANGE - RANGE / 2)
		str1.get_char_direction(randi() % RANGE - RANGE / 2)
		str1.hit_test(randf())
		str1.hit_test_cluster(randf())

		str1.draw_cluster(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()))
		str1.draw(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()))

		str1.draw_dbg(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()), bool(randi()%2), bool(randi()%2))
		str1.draw_as_hex(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()), bool(randi()%2), bool(randi()%2))
		str1.draw_logical_as_hex(get_canvas_item(), Vector2(randf(),randf()), Color(randf(),randf(),randf(),randf()), bool(randi()%2), bool(randi()%2))

		str1.pos_u16_to_wcs(randi() % RANGE - RANGE / 2)
		str1.pos_wcs_to_u16(randi() % RANGE - RANGE / 2)

		str1.next_safe_bound(randi() % RANGE - RANGE / 2)
		str1.prev_safe_bound(randi() % RANGE - RANGE / 2)
	return str1

func _fuzz_tlfontfamily():
	var fam = TLFontFamily.new()
	for i in range(2):
		var s = _randstr()
		if randi() % 3 == 0:
			s = \"Regular\"

		if randi() % 3 == 0:
			fam.remove_style(s)
		if randi() % 3 == 0:
			fam.has_style(s)

		if randi() % 3 == 0:
			fam.add_face(s, _fuzz_tlfontface())
		if randi() % 3 == 0:
			fam.add_face_unlinked(s, _fuzz_tlfontface())
		if randi() % 3 == 0:
			fam.add_face_for_script(s, _fuzz_tlfontface(), _randstr())
		if randi() % 3 == 0:
			fam.add_face_for_language(s, _fuzz_tlfontface(), _randstr())

		if randi() % 3 == 0:
			fam.add_face(s, _fuzz_tldynamicfontface())
		if randi() % 3 == 0:
			fam.add_face_unlinked(s, _fuzz_tldynamicfontface())
		if randi() % 3 == 0:
			fam.add_face_for_script(s, _fuzz_tldynamicfontface(), _randstr())
		if randi() % 3 == 0:
			fam.add_face_for_language(s, _fuzz_tldynamicfontface(), _randstr())

		if randi() % 3 == 0:
			fam.add_face(s, _fuzz_tlbitmapfontface())
		if randi() % 3 == 0:
			fam.add_face_unlinked(s, _fuzz_tlbitmapfontface())
		if randi() % 3 == 0:
			fam.add_face_for_script(s, _fuzz_tlbitmapfontface(), _randstr())
		if randi() % 3 == 0:
			fam.add_face_for_language(s, _fuzz_tlbitmapfontface(), _randstr())

		fam.get_face(s)
		fam.get_face_for_script(s, _randstr())
		fam.get_face_for_language(s, _randstr())
	return fam

func _fuzz_tlfontface():
	var face1 = TLFontFace.new()
	var f = randi() % (FileList.size() + 1)
	if f != FileList.size():
		face1.load(\"res://fonts/\" + FileList[f])

	for i in range(2):
		face1.draw_glyph(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()), randf() * 256)
		face1.draw_glyph_outline(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()), randf() * 256)
		face1.get_glyph_outline(Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, randf() * 256)

		face1.get_ascent(randi() % RANGE - RANGE / 2)
		face1.get_descent(randi() % RANGE - RANGE / 2)
		face1.get_height(randi() % RANGE - RANGE / 2)

		face1.get_base_size()

		face1.get_font_path();

		if randi() % 3 == 0:
			face1.set_texture_flags(randi() % RANGE - RANGE / 2)
		face1.get_texture_flags()

		face1.unicode_scripts_supported()
	return face1

func _fuzz_tlbitmapfontface():
	var face1 = TLBitmapFontFace.new()
	var f = randi() % (FileList.size() + 1)
	if f != FileList.size():
		face1.load(\"res://fonts/\" + FileList[f])

	for i in range(2):
		face1.draw_glyph(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()), randf() * 256)
		face1.draw_glyph_outline(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()), randf() * 256)
		face1.get_glyph_outline(Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, randf() * 256)

		face1.get_ascent(randi() % RANGE - RANGE / 2)
		face1.get_descent(randi() % RANGE - RANGE / 2)
		face1.get_height(randi() % RANGE - RANGE / 2)

		face1.get_base_size()

		face1.get_font_path();

		if randi() % 3 == 0:
			face1.set_texture_flags(randi() % RANGE - RANGE / 2)
		face1.get_texture_flags()

		face1.unicode_scripts_supported()
	return face1

func _fuzz_tldynamicfontface():
	var face1 = TLDynamicFontFace.new()
	var f = randi() % (FileList.size() + 1)
	if f != FileList.size():
		face1.load(\"res://fonts/\" + FileList[f])

	for i in range(2):
		if randi() % 3 == 0:
			face1.set_force_autohinter(bool(randi()%2))
		face1.get_force_autohinter()
		if randi() % 3 == 0:
			face1.set_hinting(bool(randi()%2))
		face1.get_hinting()
		if randi() % 3 == 0:
			face1.set_oversampling(bool(randi()%2))
		face1.get_oversampling()
		face1.has_graphite()

		face1.draw_glyph(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()), randf() * 256)
		face1.draw_glyph_outline(get_canvas_item(), Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, Color(randf(),randf(),randf(),randf()), randf() * 256)
		face1.get_glyph_outline(Vector2(randf(),randf()), randi() % RANGE - RANGE / 2, randf() * 256)

		face1.get_ascent(randi() % RANGE - RANGE / 2)
		face1.get_descent(randi() % RANGE - RANGE / 2)
		face1.get_height(randi() % RANGE - RANGE / 2)

		face1.get_base_size()

		face1.get_font_path();

		if randi() % 3 == 0:
			face1.set_texture_flags(randi() % RANGE - RANGE / 2)
		face1.get_texture_flags()

		face1.unicode_scripts_supported()
	return face1

"

[node name="root" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = SubResource( 1 )


text:
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
;   [section] ; section goes between []
;   param=value ; assign values to parameters

config_version=4

_global_script_classes=[  ]
_global_script_class_icons={

}

[application]

config/name="libgdtl rich text input control demo (builtin)"
run/main_scene="res://main.tscn"
boot_splash/image="res://splash.png"
boot_splash/fullsize=false
config/icon="res://icon.png"

[display]

window/size/width=1600
window/size/height=800

[rendering]

environment/default_environment="res://default_env.tres"


text:
extends ColorRect

export var gldata = []
var scale = 3

func _draw():
	var x = Vector2(10, rect_size.y / 2)
	if gldata.size() > 0:
		var s = 1.0 / (gldata.size() / 7)
		var n = 75
		for i in range(gldata.size() / 7):
			var face = gldata[i*7 + 0]
			var fsize = gldata[i*7 + 1]
			var asc = gldata[i*7 + 2] * scale
			var dsc = gldata[i*7 + 3] * scale
			var off = gldata[i*7 + 5] * scale

			if (face):
				face.draw_glyph(get_canvas_item(), x + off - Vector2(0, asc), gldata[i*7 + 4], Color(1 - (s*i), 1 - (s*i), 1 - (s*i), 0.5), fsize * scale)

			draw_circle(x + off, 3, Color(1, 0, 0, 0.45))
			draw_line(x + off, x, Color(1, 0, 0))
			draw_line(Vector2(0, rect_size.y / 2 - asc), Vector2(rect_size.x, rect_size.y / 2 - asc), Color(0, 1, 0, 0.2))
			draw_line(Vector2(0, rect_size.y / 2), Vector2(rect_size.x, rect_size.y / 2), Color(0, 1, 0, 0.2))
			draw_line(Vector2(0, rect_size.y / 2 + dsc), Vector2(rect_size.x, rect_size.y / 2 + dsc), Color(0, 1, 0, 0.2))
			draw_circle(x, 3, Color(0, 0, 1, 0.45))
			draw_line(x + gldata[i*7 + 6] * scale, x, Color(0, 0, 1))
			x = x + gldata[i*7 + 6] * scale
			draw_string(get_font("font"), Vector2(10 + n * i, rect_size.y - 34), "%d" % [gldata[i*7 + 4]], Color(1, 1, 1))
			draw_string(get_font("font"), Vector2(10 + n * i, rect_size.y - 22), "%2.1f; %2.1f" % [gldata[i*7 + 6].x, gldata[i*7 + 6].y], Color(0, 0, 1))
			draw_string(get_font("font"), Vector2(10 + n * i, rect_size.y - 10), "%2.1f; %2.1f" % [gldata[i*7 + 5].x, gldata[i*7 + 5].y], Color(1, 0, 0))
			if (face):
				face.draw_glyph(get_canvas_item(), Vector2(10 + n * i, rect_size.y - 80 - dsc / scale), gldata[i*7 + 4], Color(1 - (s*i), 1 - (s*i), 1 - (s*i), 0.5), fsize)

func _on_HSlider_value_changed(value):
	scale = value
	update()


text:
[gd_resource type="Environment" load_steps=2 format=2]

[sub_resource type="ProceduralSky" id=1]

[resource]
background_mode = 2
background_sky = SubResource( 1 )


text:
extends ColorRect

export var point = Vector2()
export var brk = false
export var jst = false

func _draw():
	var tpc = get_parent().get_parent().get_node("TLRichTextEdit")
	tpc.debug_draw(get_canvas_item(), Vector2(70, 35), point, brk, jst)
	tpc.debug_draw_as_hex(get_canvas_item(), Vector2(70, 105), point, brk, jst)
	tpc.debug_draw_logical_as_hex(get_canvas_item(), Vector2(70, 140), point, brk, jst)