text:
diff --git a/scene/resources/default_theme/SCsub b/scene/resources/default_theme/SCsub
index b01e2fd54d..3b9c1cdaea 100644
--- a/scene/resources/default_theme/SCsub
+++ b/scene/resources/default_theme/SCsub
@@ -2,4 +2,23 @@

 Import("env")

+import os
+import os.path
+from platform_methods import run_in_subprocess
+from compat import open_utf8
+import font_builders
+import glob
+
+path = env.Dir('.').abspath
+
+# Fonts
+flist = glob.glob(path + "/../../../thirdparty/fonts/*.ttf")
+flist.extend(glob.glob(path + "/../../../thirdparty/fonts/*.otf"))
+flist.sort()
+env.Depends('builtin_noto_fonts.gen.h', flist)
+env.CommandNoCache('builtin_noto_fonts.gen.h', flist, run_in_subprocess(font_builders.make_fonts_header))
+
+env.Append(CXXFLAGS=['-DGODOT_MODULE'])
+env.Append(CPPPATH=['#modules/godot_tl/src/resources', '#modules/godot_tl/src', '#modules/godot_tl/subprojects/graphite2/include', '#modules/godot_tl/subprojects/harfbuzz/src', '#modules/godot_tl/subprojects/icu4c/source/common'])
+
 env.add_source_files(env.scene_sources, "*.cpp")
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 00c56e5eb2..e144f586a5 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -35,8 +35,11 @@
 #include "core/os/os.h"
 #include "theme_data.h"

-#include "font_hidpi.inc"
-#include "font_lodpi.inc"
+#include "builtin_noto_fonts.gen.h"
+
+#include "modules/godot_tl/src/resources/tl_font_family.hpp"
+#include "modules/godot_tl/src/resources/tl_dynamic_font.hpp"
+#include "modules/godot_tl/src/resources/tl_gd_font_wrapper.hpp"

 typedef Map<const void *, Ref<ImageTexture>> TexCacheMap;

@@ -921,10 +921,80 @@ void make_default_theme(bool p_hidpi, Ref<Font> p_font) {
 	Ref<Font> default_font;
 	if (p_font.is_valid()) {
 		default_font = p_font;
-	} else if (p_hidpi) {
-		default_font = make_font(_hidpi_font_height, _hidpi_font_ascent, _hidpi_font_charcount, &_hidpi_font_charrects[0][0], _hidpi_font_kerning_pair_count, &_hidpi_font_kerning_pairs[0][0], _hidpi_font_img_width, _hidpi_font_img_height, _hidpi_font_img_data);
 	} else {
-		default_font = make_font(_lodpi_font_height, _lodpi_font_ascent, _lodpi_font_charcount, &_lodpi_font_charrects[0][0], _lodpi_font_kerning_pair_count, &_lodpi_font_kerning_pairs[0][0], _lodpi_font_img_width, _lodpi_font_img_height, _lodpi_font_img_data);
+#ifdef OSX_ENABLED
+		DynamicFaceHinting font_hinting = DF_HINTING_NONE;
+#else
+		DynamicFaceHinting font_hinting = DF_HINTING_LIGHT;
+#endif
+		Ref<TLDynamicFontFace> DefaultFont;
+		DefaultFont.instance();
+		DefaultFont->set_hinting(font_hinting);
+		DefaultFont->set_font_ptr(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size);
+		DefaultFont->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> DefaultFontBold;
+		DefaultFontBold.instance();
+		DefaultFontBold->set_hinting(font_hinting);
+		DefaultFontBold->set_font_ptr(_font_NotoSansUI_Bold, _font_NotoSansUI_Bold_size);
+		DefaultFontBold->set_force_autohinter(true); // just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontFallback;
+		FontFallback.instance();
+		FontFallback->set_hinting(font_hinting);
+		FontFallback->set_font_ptr(_font_DroidSansFallback, _font_DroidSansFallback_size);
+		FontFallback->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontJapanese;
+		FontJapanese.instance();
+		FontJapanese->set_hinting(font_hinting);
+		FontJapanese->set_font_ptr(_font_DroidSansJapanese, _font_DroidSansJapanese_size);
+		FontJapanese->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontArabic;
+		FontArabic.instance();
+		FontArabic->set_hinting(font_hinting);
+		FontArabic->set_font_ptr(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size);
+		FontArabic->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontHebrew;
+		FontHebrew.instance();
+		FontHebrew->set_hinting(font_hinting);
+		FontHebrew->set_font_ptr(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size);
+		FontHebrew->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontThai;
+		FontThai.instance();
+		FontThai->set_hinting(font_hinting);
+		FontThai->set_font_ptr(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size);
+		FontThai->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontHindi;
+		FontHindi.instance();
+		FontHindi->set_hinting(font_hinting);
+		FontHindi->set_font_ptr(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size);
+		FontHindi->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLFontFamily> dff;
+		dff.instance();
+		dff->add_style("Default");
+		dff->add_style("Bold");
+		dff->add_style("Source");
+		dff->add_face("Default", DefaultFont);
+		dff->add_face("Default", FontArabic);
+		dff->add_face("Default", FontHebrew);
+		dff->add_face("Default", FontThai);
+		dff->add_face("Default", FontHindi);
+		dff->add_face("Default", FontJapanese);
+		dff->add_face("Default", FontFallback);
+
+		Ref<TLGDFontWrapper> df;
+		df.instance();
+		df->set_base_font(dff);
+		df->set_base_font_style("Default");
+		df->set_base_font_size(16);
+
+		default_font = df;
 	}
 	Ref<Font> large_font = default_font;
 	fill_default_theme(t, default_font, large_font, default_icon, default_style, p_hidpi ? 2.0 : 1.0);
diff --git a/scene/resources/default_theme/font_builders.py b/scene/resources/default_theme/font_builders.py
new file mode 100644
index 0000000000..dd78006e53
--- /dev/null
+++ b/scene/resources/default_theme/font_builders.py
@@ -0,0 +1,41 @@
+"""Functions used to generate source files during build time
+
+All such functions are invoked in a subprocess on Windows to prevent build flakiness.
+
+"""
+import os
+import os.path
+from platform_methods import subprocess_main
+from compat import encode_utf8, byte_to_str, open_utf8
+
+def make_fonts_header(target, source, env):
+
+    dst = target[0]
+
+    g = open_utf8(dst, "w")
+
+    g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+    g.write("#ifndef _EDITOR_FONTS_H\n")
+    g.write("#define _EDITOR_FONTS_H\n")
+
+    # saving uncompressed, since freetype will reference from memory pointer
+    xl_names = []
+    for i in range(len(source)):
+        with open(source[i], "rb")as f:
+            buf = f.read()
+
+        name = os.path.splitext(os.path.basename(source[i]))[0]
+
+        g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n")
+        g.write("static const unsigned char _font_" + name + "[] = {\n")
+        for j in range(len(buf)):
+            g.write("\t" + byte_to_str(buf[j]) + ",\n")
+
+        g.write("};\n")
+
+    g.write("#endif")
+
+    g.close()
+
+if __name__ == '__main__':
+    subprocess_main(globals())


text:
diff --git a/scene/resources/default_theme/SCsub b/scene/resources/default_theme/SCsub
index b01e2fd54d..3b9c1cdaea 100644
--- a/scene/resources/default_theme/SCsub
+++ b/scene/resources/default_theme/SCsub
@@ -2,4 +2,23 @@

 Import("env")

+import os
+import os.path
+from platform_methods import run_in_subprocess
+from compat import open_utf8
+import font_builders
+import glob
+
+path = env.Dir('.').abspath
+
+# Fonts
+flist = glob.glob(path + "/../../../thirdparty/fonts/*.ttf")
+flist.extend(glob.glob(path + "/../../../thirdparty/fonts/*.otf"))
+flist.sort()
+env.Depends('builtin_noto_fonts.gen.h', flist)
+env.CommandNoCache('builtin_noto_fonts.gen.h', flist, run_in_subprocess(font_builders.make_fonts_header))
+
+env.Append(CXXFLAGS=['-DGODOT_MODULE'])
+env.Append(CPPPATH=['#modules/godot_tl/src/resources', '#modules/godot_tl/src', '#modules/godot_tl/subprojects/graphite2/include', '#modules/godot_tl/subprojects/harfbuzz/src', '#modules/godot_tl/subprojects/icu4c/source/common'])
+
 env.add_source_files(env.scene_sources, "*.cpp")
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 00c56e5eb2..e144f586a5 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -35,8 +35,11 @@
 #include "core/os/os.h"
 #include "theme_data.h"

-#include "font_hidpi.inc"
-#include "font_lodpi.inc"
+#include "builtin_noto_fonts.gen.h"
+
+#include "modules/godot_tl/src/resources/tl_font_family.hpp"
+#include "modules/godot_tl/src/resources/tl_dynamic_font.hpp"
+#include "modules/godot_tl/src/resources/tl_gd_font_wrapper.hpp"

 typedef Map<const void *, Ref<ImageTexture> > TexCacheMap;

@@ -877,10 +880,80 @@ void make_default_theme(bool p_hidpi, Ref<Font> p_font) {
 	Ref<Font> default_font;
 	if (p_font.is_valid()) {
 		default_font = p_font;
-	} else if (p_hidpi) {
-		default_font = make_font(_hidpi_font_height, _hidpi_font_ascent, _hidpi_font_charcount, &_hidpi_font_charrects[0][0], _hidpi_font_kerning_pair_count, &_hidpi_font_kerning_pairs[0][0], _hidpi_font_img_width, _hidpi_font_img_height, _hidpi_font_img_data);
 	} else {
-		default_font = make_font(_lodpi_font_height, _lodpi_font_ascent, _lodpi_font_charcount, &_lodpi_font_charrects[0][0], _lodpi_font_kerning_pair_count, &_lodpi_font_kerning_pairs[0][0], _lodpi_font_img_width, _lodpi_font_img_height, _lodpi_font_img_data);
+#ifdef OSX_ENABLED
+		DynamicFaceHinting font_hinting = DF_HINTING_NONE;
+#else
+		DynamicFaceHinting font_hinting = DF_HINTING_LIGHT;
+#endif
+		Ref<TLDynamicFontFace> DefaultFont;
+		DefaultFont.instance();
+		DefaultFont->set_hinting(font_hinting);
+		DefaultFont->set_font_ptr(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size);
+		DefaultFont->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> DefaultFontBold;
+		DefaultFontBold.instance();
+		DefaultFontBold->set_hinting(font_hinting);
+		DefaultFontBold->set_font_ptr(_font_NotoSansUI_Bold, _font_NotoSansUI_Bold_size);
+		DefaultFontBold->set_force_autohinter(true); // just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontFallback;
+		FontFallback.instance();
+		FontFallback->set_hinting(font_hinting);
+		FontFallback->set_font_ptr(_font_DroidSansFallback, _font_DroidSansFallback_size);
+		FontFallback->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontJapanese;
+		FontJapanese.instance();
+		FontJapanese->set_hinting(font_hinting);
+		FontJapanese->set_font_ptr(_font_DroidSansJapanese, _font_DroidSansJapanese_size);
+		FontJapanese->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontArabic;
+		FontArabic.instance();
+		FontArabic->set_hinting(font_hinting);
+		FontArabic->set_font_ptr(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size);
+		FontArabic->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontHebrew;
+		FontHebrew.instance();
+		FontHebrew->set_hinting(font_hinting);
+		FontHebrew->set_font_ptr(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size);
+		FontHebrew->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontThai;
+		FontThai.instance();
+		FontThai->set_hinting(font_hinting);
+		FontThai->set_font_ptr(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size);
+		FontThai->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLDynamicFontFace> FontHindi;
+		FontHindi.instance();
+		FontHindi->set_hinting(font_hinting);
+		FontHindi->set_font_ptr(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size);
+		FontHindi->set_force_autohinter(true); //just looks better..i think?
+
+		Ref<TLFontFamily> dff;
+		dff.instance();
+		dff->add_style("Default");
+		dff->add_style("Bold");
+		dff->add_style("Source");
+		dff->add_face("Default", DefaultFont);
+		dff->add_face("Default", FontArabic);
+		dff->add_face("Default", FontHebrew);
+		dff->add_face("Default", FontThai);
+		dff->add_face("Default", FontHindi);
+		dff->add_face("Default", FontJapanese);
+		dff->add_face("Default", FontFallback);
+
+		Ref<TLGDFontWrapper> df;
+		df.instance();
+		df->set_base_font(dff);
+		df->set_base_font_style("Default");
+		df->set_base_font_size(16);
+
+		default_font = df;
 	}
 	Ref<Font> large_font = default_font;
 	fill_default_theme(t, default_font, large_font, default_icon, default_style, p_hidpi ? 2.0 : 1.0);
diff --git a/scene/resources/default_theme/font_builders.py b/scene/resources/default_theme/font_builders.py
new file mode 100644
index 0000000000..dd78006e53
--- /dev/null
+++ b/scene/resources/default_theme/font_builders.py
@@ -0,0 +1,41 @@
+"""Functions used to generate source files during build time
+
+All such functions are invoked in a subprocess on Windows to prevent build flakiness.
+
+"""
+import os
+import os.path
+from platform_methods import subprocess_main
+from compat import encode_utf8, byte_to_str, open_utf8
+
+def make_fonts_header(target, source, env):
+
+    dst = target[0]
+
+    g = open_utf8(dst, "w")
+
+    g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+    g.write("#ifndef _EDITOR_FONTS_H\n")
+    g.write("#define _EDITOR_FONTS_H\n")
+
+    # saving uncompressed, since freetype will reference from memory pointer
+    xl_names = []
+    for i in range(len(source)):
+        with open(source[i], "rb")as f:
+            buf = f.read()
+
+        name = os.path.splitext(os.path.basename(source[i]))[0]
+
+        g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n")
+        g.write("static const unsigned char _font_" + name + "[] = {\n")
+        for j in range(len(buf)):
+            g.write("\t" + byte_to_str(buf[j]) + ",\n")
+
+        g.write("};\n")
+
+    g.write("#endif")
+
+    g.close()
+
+if __name__ == '__main__':
+    subprocess_main(globals())

repo_language: C

mime_type: text/x-c


text:
![libgdtl logo](logo.png)

# libgdtl

BiDi, shaping and basic text layout for Godot Engine.

## Dependencies

- Godot 3.x (3.1+)
- C++14 compiler
- Meson build system (for gdnative module build only)
- SCons build system

## Compiling (as builtin module)

### Build options

Name | Description | Default value
--- | --- | ---
`builtin_runtime` | Use the built-in libraries | `true`
`use_graphite2` | Enable SIL Graphite 2 complementary shaper | `true`
`use_font_wrapper` | Enable Godot font wrapper for default controls | `false`

If `use_font_wrapper` is enabled, apply `patch_font.diff` from the root of this repository to the Godot engine source first. Additionally apply `patch_editor_fonts.diff` to use `libgdtl` to render editor fonts and `patch_lbl.diff`/`patch_le.diff` to override default `Label` and `LineEdit` with TL counterparts.

### Building `libgdtl` module

Clone this repository (without `--recursive` flag) into Godot's `modules` subfolder as `godot_tl`.
Rebuild Godot engine as usual.

## Compiling (as gdnative module)

### Build options

Name | Description | Default value
--- | --- | ---
`godot-cpp-lib-name` | godot-cpp static library name (without `.a` or `.lib` extension) | `libgodot-cpp`
`static-lib` | Build static library | `false`
`static-runtime` | Link libraries statically for better portability | `false`
`builtin-runtime` | Use the built-in libraries | `false`
`use-graphite2` | Enable SIL Graphite 2 complementary shaper | `true`

### Building `godot-cpp` static library

See [Compiling the cpp bindings library](https://github.com/GodotNativeTools/godot-cpp/blob/master/README.md#compiling-the-cpp-bindings-library)

### Building `libgdtl` module

See [Compiling GDNative module for Windows, macOS and Linux](https://bruvzg.github.io/godot_tl/docs/html/development/compiling_desktop.html#doc-compile-desktop), [Compiling GDNative module for Android](https://bruvzg.github.io/godot_tl/docs/html/development/compiling_android.html#doc-compile-android) and [Compiling GDNative module for iOS](https://bruvzg.github.io/godot_tl/docs/html/development/compiling_ios.html#doc-compile-ios) for build instructions.

## Documentation

[Documentation](https://bruvzg.github.io/godot_tl/docs/html/index.html)

[Class reference](https://bruvzg.github.io/godot_tl/docs/html/classes/index.html)

<details>
<summary>Screenshots</summary>

![libgdtl scripts screenshot](scripts_scr.png)

![libgdtl debug view screenshot](debug_view.png)

![iOS simulator screenshot](ios_src.png)

![Android screenshot](andr_scr.jpg)

</details>

## License
- The source code of the **libgdtl** module is released under unlicense.
For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

- **Godot** and **GodotNativeTools** are licensed under MIT license.
For more information, see https://github.com/godotengine/godot/blob/master/LICENSE.txt.

- **HarfBuzz** is licensed under MIT-like License.
For more information, see https://github.com/harfbuzz/harfbuzz/blob/master/COPYING

- **ICU4C** is licensed under Unicode, Inc. License.
For more information, see http://www.unicode.org/copyright.html#License

- **FreeType** is licensed under FreeType License (BSD-like) or GNU General Public License (GPL), version 2.
For more information, see https://www.freetype.org/license.html

- **SIL Graphite engine** is licensed under GNU Lesser General Public License (LGPL), version 2.1+ or GNU General Public License (GPL), version 2 or Mozilla Public License.
For more information, see https://github.com/silnrsi/graphite/blob/master/COPYING

## Demo data

[Montserrat](https://github.com/JulietaUla/Montserrat/), [Awami Nastaliq](https://software.sil.org/awami/download/), [Comic Neue](http://comicneue.com/) and [Noto](https://www.google.com/get/noto/) fonts are published under the [SIL Open Font License, Version 1.1](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)

[Material Design icons by Google](https://github.com/google/material-design-icons) are published under the [Apache License Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt)

Noto Color Emoji font is cut down to single glyph (U+1F604) using [glyphhanger](https://github.com/filamentgroup/glyphhanger).

[![Travis Build Status](https://travis-ci.org/bruvzg/godot_tl.svg?branch=master)](https://travis-ci.org/bruvzg/godot_tl)


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>libgdtl documentation — libgdtl latest documentation</title>

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="libgdtl introduction" href="about/index.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl documentation

libgdtl documentation¶

General¶

libgdtl introduction

Getting started¶

Installation

Font substitution

Rich text typesetting

Development¶

Compiling GDNative module for Windows, macOS and Linux

Compiling GDNative module for Android

Compiling GDNative module for iOS

Class reference¶

libgdtl API

        Next

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Index — libgdtl latest documentation</title>

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="#" />
    <link rel="search" title="Search" href="search.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

Index

Index

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Search — libgdtl latest documentation</title>

  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="#" />

                latest

  <form id="rtd-search-form" class="wy-form" action="#" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

Search

      Please activate JavaScript to enable the search
      functionality.

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLDynamicFontFace — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLFontFace" href="class_tlfontface.html" />
    <link rel="prev" title="TLBitmapFontFace" href="class_tlbitmapfontface.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLDynamicFontFace

TLDynamicFontFace¶

Inherits: TLFontFace

Category: Core

Brief Description¶

A TrueType, OpenType or Graphite font for drawing text.

Properties¶

<colgroup>
<col style="width: 7%" />
<col style="width: 79%" />
<col style="width: 14%" />
</colgroup>

bool

force_autohinter

false

int

hinting

2

float

oversampling

1.0

int

texture_flags

O: 2048

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

bool

has_graphite ( ) const

Enumerations¶

enum DynamicFaceHinting:

DF_HINTING_NONE = 0 — Disable font hinting (smoother but less crisp)

DF_HINTING_LIGHT = 1 — Use the light font hinting mode

DF_HINTING_NORMAL = 2 — Use the default font hinting mode (crisper but less smooth)

Property Descriptions¶

bool force_autohinter

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

false

Setter

set_force_autohinter(value)

Getter

get_force_autohinter()

If true, prefers FreeType auto-hinter over the font’s native hinter.

int hinting

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

2

Setter

set_hinting(value)

Getter

get_hinting()

The font hinting mode used by FreeType auto-hinter.

float oversampling

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

1.0

Setter

set_oversampling(value)

Getter

get_oversampling()

Font oversampling factor.

Method Descriptions¶

bool has_graphite ( ) const

Returns true if module is built with SIL Graphite 2 shaper support.

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLShapedString — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="prev" title="TLShapedParagraph" href="class_tlshapedparagraph.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLShapedString

TLShapedString¶

Inherits:

Inherited By: TLShapedAttributedString

Category: Core

Brief Description¶

Holds shaped line of plain text.

Properties¶

<colgroup>
<col style="width: 33%" />
<col style="width: 58%" />
<col style="width: 9%" />
</colgroup>

int

base_direction

3

TLFontFamily

base_font

int

base_font_size

12

String

base_font_style

“Regular”

String

features

“”

String

language

“en”

bool

preserve_control

false

String

text

“”

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

void

add_sstring ( TLShapedString text )

void

add_text ( String text )

void

add_utf16 ( PoolByteArray text )

void

add_utf32 ( PoolByteArray text )

void

add_utf8 ( PoolByteArray text )

Array

break_jst ( ) const

Array

break_lines ( float width, int flags ) const

Array

break_words ( ) const

int

char_count ( ) const

int

clusters ( ) const

void

copy_properties ( TLShapedString source )

void

draw ( RID canvas_item, Vector2 position, Color modulate )

void

draw_as_hex ( RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops )

Vector2

draw_cluster ( RID canvas_item, Vector2 position, int index, Color modulate )

void

draw_dbg ( RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops )

void

draw_logical_as_hex ( RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops )

bool

empty ( ) const

float

extend_to_width ( float width, int flags )

float

get_ascent ( ) const

TextDirection

get_char_direction ( int position ) const

float

get_cluster_ascent ( int index ) const

String

get_cluster_debug_info ( int index ) const

float

get_cluster_descent ( int index ) const

int

get_cluster_end ( int index ) const

TLFontFace

get_cluster_face ( int position ) const

float

get_cluster_face_size ( int position ) const

int

get_cluster_glyph ( int index, int glyph ) const

Vector2

get_cluster_glyph_advance ( int index, int glyph ) const

Vector2

get_cluster_glyph_offset ( int index, int glyph ) const

int

get_cluster_glyphs ( int index ) const

float

get_cluster_height ( int index ) const

int

get_cluster_index ( int position ) const

float

get_cluster_leading_edge ( int index ) const

Rect2

get_cluster_rect ( int index ) const

int

get_cluster_start ( int index ) const

float

get_cluster_trailing_edge ( int index ) const

float

get_cluster_width ( int index ) const

Array

get_cursor_positions ( int position, int primary_dir ) const

float

get_descent ( ) const

float

get_height ( ) const

Array

get_highlight_shapes ( int start, int end ) const

int

get_para_direction ( ) const

PoolByteArray

get_utf16 ( ) const

PoolByteArray

get_utf32 ( ) const

PoolByteArray

get_utf8 ( ) const

float

get_width ( ) const

int

hit_test ( float position ) const

int

hit_test_cluster ( float position ) const

bool

is_valid ( ) const

int

length ( ) const

int

next_safe_bound ( int position ) const

int

pos_u16_to_wcs ( int position ) const

int

pos_wcs_to_u16 ( int position ) const

int

prev_safe_bound ( int position ) const

void

replace_sstring ( int start, int end, TLShapedString text )

void

replace_text ( int start, int end, String text )

void

replace_utf16 ( int start, int end, PoolByteArray text )

void

replace_utf32 ( int start, int end, PoolByteArray text )

void

replace_utf8 ( int start, int end, PoolByteArray text )

void

set_utf16 ( PoolByteArray data )

void

set_utf32 ( PoolByteArray data )

void

set_utf8 ( PoolByteArray data )

bool

shape ( )

TLShapedString

substr ( int start, int end, int trim ) const

Signals¶

string_changed ( )

Emitted when the text or/and other property of the string changes.

string_shaped ( )

Emitted when the text shaping process is completed.

Enumerations¶

enum TextDirection:

TEXT_DIRECTION_LTR = 0 — Left-to-right text writing direction.

TEXT_DIRECTION_RTL = 1 — Right-to-left text writing direction.

TEXT_DIRECTION_LOCALE = 2 — Text writing direction is derived from the locale’s script according to the CLDR metadata.

TEXT_DIRECTION_AUTO = 3 — Text writing direction is derived from the first character in the string with BiDi class L, R, or AL or locale’s script if text is not strongly directional.

TEXT_DIRECTION_INVALID = 4 — Invalid text direction (Used as return value only).

enum TextJustification:

TEXT_JUSTIFICATION_NONE = 0 — No text justification.

TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE = 1 — Use kashida and white space elongation to justify text.

TEXT_JUSTIFICATION_KASHIDA_ONLY = 2 — Use kashida elongation to justify text.

TEXT_JUSTIFICATION_WHITESPACE_ONLY = 3 — Use white space elongation to justify text.

TEXT_JUSTIFICATION_KASHIDA_AND_WHITESPACE_AND_INTERCHAR = 4 — Use kashida, white space and inter character elongation to justify text.

TEXT_JUSTIFICATION_KASHIDA_AND_INTERCHAR = 5 — Use kashida and inter character elongation to justify text.

TEXT_JUSTIFICATION_WHITESPACE_AND_INTERCHAR = 6 — Use white space and inter character elongation to justify text.

TEXT_JUSTIFICATION_INTERCHAR_ONLY = 7 — Use inter character elongation to justify text.

enum TextBreak:

TEXT_BREAK_NONE = 0 — No line breaking.

TEXT_BREAK_MANDATORY = 1 — Break lines only at mandatory break points.

TEXT_BREAK_MANDATORY_AND_WORD_BOUND = 2 — Break lines at mandatory break points and word boundaries.

TEXT_BREAK_MANDATORY_AND_ANYWHERE = 3 — Break lines at mandatory break points and grapheme cluster boundaries.

enum TextTrimMode:

TEXT_TRIM_NONE = 0 — No substring trimming.

TEXT_TRIM_BREAK = 1 — Trim line break characters for substring ends.

TEXT_TRIM_BREAK_AND_WHITESPACE = 2 — Trim line break and white space characters for substring ends.

Description¶

Note 1: Code points, Characters, Clusters and Glyphs

A code point is a single encoding UTF-16 unit (Unicode character or half of the surrogate pair).

A character is a full Unicode character.

A grapheme cluster is the abstract unit of a writing system (a letter, a digit, or punctuation).

A glyph is a shape used to render a character or a sequence of characters.

In general, code point, characters, clusters and glyphs do not have one-to-one correspondence.

Note 2: Encoding

TLShapedString uses UTF-16 encoding, all positions accepted and returned by TLShapedString function are measured in UTF-16 code points.

Property Descriptions¶

int base_direction

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

3

Setter

set_base_direction(value)

Getter

get_base_direction()

Base text writing direction.

TLFontFamily base_font

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Setter

set_base_font(value)

Getter

get_base_font()

Base font family reference.

int base_font_size

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

12

Setter

set_base_font_size(value)

Getter

get_base_font_size()

Font size.

String base_font_style

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

“Regular”

Setter

set_base_font_style(value)

Getter

get_base_font_style()

Style name (Regular, Bold, Italic, Oblique etc.).

String features

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

“”

Setter

set_features(value)

Getter

get_features()

Comma separated list of OpenType feature tags. More info: https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags.

String language

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

“en”

Setter

set_language(value)

Getter

get_language()

Language code for line-breaking and text shaping algorithms.

bool preserve_control

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

false

Setter

set_preserve_control(value)

Getter

get_preserve_control()

If true, displays control character.

String text

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

“”

Setter

set_text(value)

Getter

get_text()

Text string.

Method Descriptions¶

void add_sstring ( TLShapedString text )

Appends shaped string.

void add_text ( String text )

Appends plain text string.

void add_utf16 ( PoolByteArray text )

void add_utf32 ( PoolByteArray text )

void add_utf8 ( PoolByteArray text )

Array break_jst ( ) const

Array break_lines ( float width, int flags ) const

Breaks text into lines that fit within a specified width.

Returns Array of line boundaries.

Array break_words ( ) const

Breaks text into words.

Returns Array of word boundaries.

int char_count ( ) const

Returns number of characters in the string.

int clusters ( ) const

Returns number of grapheme clusters, clusters are indexed in visual order.

void copy_properties ( TLShapedString source )

void draw ( RID canvas_item, Vector2 position, Color modulate )

Draws a string.

void draw_as_hex ( RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops )

DEBUG: Draws a string using “hexbox” fallback font.

Vector2 draw_cluster ( RID canvas_item, Vector2 position, int index, Color modulate )

Draws single grapheme cluster. Returns advance.

void draw_dbg ( RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops )

DEBUG: Draws a string with additional debug information.

void draw_logical_as_hex ( RID canvas_item, Vector2 position, Color modulate, bool draw_brk_ops, bool draw_jst_ops )

DEBUG: Draws logical character codes of the string with additional debug information.

bool empty ( ) const

Returns true if the string is empty.

float extend_to_width ( float width, int flags )

Increase text width to the specified. Returns new line width.

float get_ascent ( ) const

Returns ascent of the line.

TextDirection get_char_direction ( int position ) const

Return writing direction of a character writing direction.

float get_cluster_ascent ( int index ) const

Returns cluster ascent.

String get_cluster_debug_info ( int index ) const

float get_cluster_descent ( int index ) const

Returns cluster descent.

int get_cluster_end ( int index ) const

Returns last character position corresponding cluster.

TLFontFace get_cluster_face ( int position ) const

Returns font face of the cluster.

float get_cluster_face_size ( int position ) const

Returns font size of the cluster. For non-attributed string it’s always equal to base size.

int get_cluster_glyph ( int index, int glyph ) const

Returns glyph ID.

Vector2 get_cluster_glyph_advance ( int index, int glyph ) const

Returns glyph advance.

Vector2 get_cluster_glyph_offset ( int index, int glyph ) const

Returns glyph offset.

int get_cluster_glyphs ( int index ) const

Returns number of glyphs in cluster.

float get_cluster_height ( int index ) const

Returns cluster height.

int get_cluster_index ( int position ) const

Returns cluster index corresponding to a specific character position in string.

float get_cluster_leading_edge ( int index ) const

Returns cluster leading edge offset in pixels.

Rect2 get_cluster_rect ( int index ) const

Returns cluster bounding rectangle.

int get_cluster_start ( int index ) const

Returns first character position corresponding cluster.

float get_cluster_trailing_edge ( int index ) const

Returns cluster trailing edge offset in pixels.

float get_cluster_width ( int index ) const

Returns cluster width.

Array get_cursor_positions ( int position, int primary_dir ) const

Returns an Array of float (up to two elements) offsets corresponding to the strong and weak cursor, at the specified character position.

float get_descent ( ) const

Returns descent of the line.

float get_height ( ) const

Returns height of the line.

Array get_highlight_shapes ( int start, int end ) const

Returns an Array of Rect2 enclosing the selection/highlight in the specified range.

int get_para_direction ( ) const

Returns shaped string paragraph direction.

PoolByteArray get_utf16 ( ) const

Returns raw text string in UTF-16 encoding.

PoolByteArray get_utf32 ( ) const

Returns raw text string in UTF-32 encoding.

PoolByteArray get_utf8 ( ) const

Returns raw text string in UTF-8 encoding.

float get_width ( ) const

Returns width of the line.

int hit_test ( float position ) const

Returns a cursor position corresponding to the specified pixel offset.

int hit_test_cluster ( float position ) const

Returns a cluster index corresponding to the specified pixel offset.

bool is_valid ( ) const

Returns true if the string is shaped successfully.

int length ( ) const

Returns number of UTF-16 codepoints in the string.

int next_safe_bound ( int position ) const

Returns next whole character position in the string.

int pos_u16_to_wcs ( int position ) const

Returns character position (Characters)

int pos_wcs_to_u16 ( int position ) const

Retruns character position (UTF-16 codepoints)

int prev_safe_bound ( int position ) const

Returns previous whole character position in the string.

void replace_sstring ( int start, int end, TLShapedString text )

Replaces substring with contents of another shaped string.

void replace_text ( int start, int end, String text )

Replaces substring with text.

void replace_utf16 ( int start, int end, PoolByteArray text )

Replaces substring with contents of the raw UTF-16 encoded string.

void replace_utf32 ( int start, int end, PoolByteArray text )

Replaces substring with contents of the raw UTF-32 encoded string.

void replace_utf8 ( int start, int end, PoolByteArray text )

Replaces substring with contents of the raw UTF-8 encoded string.

void set_utf16 ( PoolByteArray data )

Sets text to the contents of the raw UTF-16 encoded string.

void set_utf32 ( PoolByteArray data )

Sets text to the contents of the raw UTF-32 encoded string.

void set_utf8 ( PoolByteArray data )

Sets text to the contents of the raw UTF-8 encoded string.

bool shape ( )

Shapes string and returns true if the string is shaped successfully.

TLShapedString substr ( int start, int end, int trim ) const

Returns part of the shaped string from the position start to end, trims it according to trim parameter.

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLRichTextEdit — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLRichTextEditSelection" href="class_tlrichtexteditselection.html" />
    <link rel="prev" title="TLLineEdit" href="class_tllineedit.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLRichTextEdit

TLRichTextEdit¶

Inherits:

Category: Core

Brief Description¶

Rich text display and input control.

Rich text can contain custom text, fonts, images and formatting.

Properties¶

<colgroup>
<col style="width: 34%" />
<col style="width: 52%" />
<col style="width: 14%" />
</colgroup>

Color

back_color

Color( 1, 1, 1, 0 )

Control.FocusMode

focus_mode

O: 2

float

paragraph_spacing

3.0

bool

readonly

false

bool

selectable

true

TLShapedParagraph

paragraphs/{index}

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

void

add_attribute ( TLRichTextEditSelection selection, int attribute, Variant value )

void

clear ( )

void

debug_draw ( RID rid, Vector2 position, Vector2 hit_position, bool draw_brk_ops, bool draw_jst_ops )

void

debug_draw_as_hex ( RID rid, Vector2 position, Vector2 hit_position, bool draw_brk_ops, bool draw_jst_ops )

void

debug_draw_logical_as_hex ( RID rid, Vector2 position, Vector2 hit_position, bool draw_brk_ops, bool draw_jst_ops )

Vector2

get_caret_position ( )

String

get_cluster_debug_info_hit_test ( Vector2 position )

Array

get_cluster_glyphs_hit_test ( Vector2 position )

Rect2

get_cluster_rect_hit_test ( Vector2 position )

TLShapedParagraph

get_paragraph ( int index ) const

int

get_paragraphs ( )

TLRichTextEditSelection

get_selection ( ) const

int

insert_paragraph ( TLShapedParagraph para, int index )

void

remove_attribute ( TLRichTextEditSelection selection, int attribute )

void

remove_attributes ( TLRichTextEditSelection selection )

void

remove_paragraph ( int index )

void

replace_sstring ( TLRichTextEditSelection selection, TLShapedString text )

void

replace_text ( TLRichTextEditSelection selection, String text )

void

replace_utf16 ( TLRichTextEditSelection selection, PoolByteArray text )

void

replace_utf32 ( TLRichTextEditSelection selection, PoolByteArray text )

void

replace_utf8 ( TLRichTextEditSelection selection, PoolByteArray text )

void

set_paragraph ( TLShapedParagraph para, int index )

void

set_paragraph_back_color ( TLRichTextEditSelection selection, Color bcolor )

void

set_paragraph_brk_flags ( TLRichTextEditSelection selection, int flags )

void

set_paragraph_halign ( TLRichTextEditSelection selection, int halign )

void

set_paragraph_indent ( TLRichTextEditSelection selection, float indent )

void

set_paragraph_jst_flags ( TLRichTextEditSelection selection, int flags )

void

set_paragraph_line_spacing ( TLRichTextEditSelection selection, float line_spacing )

void

set_paragraph_width ( TLRichTextEditSelection selection, float width )

void

set_selection ( TLRichTextEditSelection selection )

Signals¶

cursor_changed ( )

Emitted when caret moves or selection changes.

paragraph_changed ( )

Emitted when paragraph text or attributes changes.

Property Descriptions¶

Color back_color

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

Color( 1, 1, 1, 0 )

Setter

set_back_color(value)

Getter

get_back_color()

Background color of the control.

float paragraph_spacing

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

3.0

Setter

set_paragraph_spacing(value)

Getter

get_paragraph_spacing()

Spacing between the paragraphs in pixels.

bool readonly

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

false

Setter

set_readonly(value)

Getter

get_readonly()

If true, existing text cannot be modified and new text cannot be added.

bool selectable

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

true

Setter

set_selectable(value)

Getter

get_selectable()

If true, the control allows text selection.

TLShapedParagraph paragraphs/{index}

Paragraphs of the text.

Method Descriptions¶

void add_attribute ( TLRichTextEditSelection selection, int attribute, Variant value )

Sets attribute attribute to value for the selection.

void clear ( )

Clears the attributes and sets text to an empty string.

void debug_draw ( RID rid, Vector2 position, Vector2 hit_position, bool draw_brk_ops, bool draw_jst_ops )

DEBUG: Draws text with additional debug information.

void debug_draw_as_hex ( RID rid, Vector2 position, Vector2 hit_position, bool draw_brk_ops, bool draw_jst_ops )

DEBUG: Draws text using “hexbox” fallback font.

void debug_draw_logical_as_hex ( RID rid, Vector2 position, Vector2 hit_position, bool draw_brk_ops, bool draw_jst_ops )

DEBUG: Draws logical character codes of the text with additional debug information.

Vector2 get_caret_position ( )

Returns position of the caret, in (paragraph, offset) format.

String get_cluster_debug_info_hit_test ( Vector2 position )

DEBUG: Returns cluster hit test info.

Array get_cluster_glyphs_hit_test ( Vector2 position )

Returns glyph hit test info.

Rect2 get_cluster_rect_hit_test ( Vector2 position )

Returns replacement object hit test info.

TLShapedParagraph get_paragraph ( int index ) const

Returns paragraph of text.

int get_paragraphs ( )

Returns number of paragraph in the text.

TLRichTextEditSelection get_selection ( ) const

Returns current selection and caret position.

int insert_paragraph ( TLShapedParagraph para, int index )

Inserts paragraph of text at the index position.

void remove_attribute ( TLRichTextEditSelection selection, int attribute )

Returns attribute attribute value in the selection.

void remove_attributes ( TLRichTextEditSelection selection )

Removes all attributes in the selection.

void remove_paragraph ( int index )

Removes paragraph of the text.

void replace_sstring ( TLRichTextEditSelection selection, TLShapedString text )

Replaces selection with the shaped string.

void replace_text ( TLRichTextEditSelection selection, String text )

Replaces selection with the plain string.

void replace_utf16 ( TLRichTextEditSelection selection, PoolByteArray text )

Replaces selection with the contents of the raw UTF-16 encoded string.

void replace_utf32 ( TLRichTextEditSelection selection, PoolByteArray text )

Replaces selection with the contents of the raw UTF-32 encoded string.

void replace_utf8 ( TLRichTextEditSelection selection, PoolByteArray text )

Replaces selection with the contents of the raw UTF-8 encoded string.

void set_paragraph ( TLShapedParagraph para, int index )

Sets content of the specific paragraph.

void set_paragraph_back_color ( TLRichTextEditSelection selection, Color bcolor )

Sets background color of the paragraph.

void set_paragraph_brk_flags ( TLRichTextEditSelection selection, int flags )

Sets line breaking flags of the paragraph.

void set_paragraph_halign ( TLRichTextEditSelection selection, int halign )

Sets horizontal alignment of the paragraph.

void set_paragraph_indent ( TLRichTextEditSelection selection, float indent )

Sets indentation of the paragraph.

void set_paragraph_jst_flags ( TLRichTextEditSelection selection, int flags )

Sets justification flags of the paragraph.

void set_paragraph_line_spacing ( TLRichTextEditSelection selection, float line_spacing )

Sets line spacing of the paragraph.

void set_paragraph_width ( TLRichTextEditSelection selection, float width )

Sets max width of the paragraph.

void set_selection ( TLRichTextEditSelection selection )

Sets current selection.

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLFontIterator — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLGDFontWrapper" href="class_tlgdfontwrapper.html" />
    <link rel="prev" title="TLFontFamily" href="class_tlfontfamily.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLFontIterator

TLFontIterator¶

Inherits:

Category: Core

Brief Description¶

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

bool

is_linked ( ) const

bool

is_valid ( ) const

bool

next ( )

TLFontFace

value ( ) const

Method Descriptions¶

bool is_linked ( ) const

Return true if current iterator value is part of language/script specific fallback list.

bool is_valid ( ) const

Return true if current iterator value is valid.

bool next ( )

Advances iterator. Return true if current iterator value is valid.

TLFontFace value ( ) const

Return current font face.

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLShapedAttributedString — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLShapedParagraph" href="class_tlshapedparagraph.html" />
    <link rel="prev" title="TLRichTextEditSelection" href="class_tlrichtexteditselection.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLShapedAttributedString

TLShapedAttributedString¶

Inherits: TLShapedString

Category: Core

Brief Description¶

Golds shaped line of text with associated attributes.

Properties¶

<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>

Array

attributes_dict

int

attribute/type

Variant

attribute/value

int

attribute/start

int

attribute/end

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

void

add_attribute ( int attribute, Variant value, int start, int end )

void

clear_attributes ( )

void

commit_attribute ( )

Variant

get_attribute ( int attribute, int index ) const

int

get_attribute_end ( int attribute, int index ) const

int

get_attribute_start ( int attribute, int index ) const

Array

get_embedded_rects ( )

bool

has_attribute ( int attribute, int index ) const

void

load_attributes_dict ( Array array )

void

remove_attribute ( int attribute, int start, int end )

void

remove_attributes ( int start, int end )

Array

save_attributes_dict ( ) const

Enumerations¶

enum TextAttribute:

TEXT_ATTRIBUTE_FONT = 1 — Font family. Attribute type: TLFontFamily

TEXT_ATTRIBUTE_FONT_STYLE = 2 — Font style (Regular, Bold, Italic, Oblique etc.). Attribute type: String

TEXT_ATTRIBUTE_FONT_SIZE = 3 — Font size. Attribute type: int

TEXT_ATTRIBUTE_FONT_FEATURES = 4 — Comma separated list of OpenType feature tags. More info: https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags. Attribute type: String

TEXT_ATTRIBUTE_LANGUAGE = 5 — Language code for line-breaking and text shaping algorithms. Attribute type: String

TEXT_ATTRIBUTE_REPLACEMENT_IMAGE = 6 — Embedded image. Attribute type: Texture

TEXT_ATTRIBUTE_REPLACEMENT_RECT = 7 — Reserved space for custom embedded object. Attribute type: Vector2

TEXT_ATTRIBUTE_REPLACEMENT_ID = 8 — Embedded object id key. Attribute type: Variant

TEXT_ATTRIBUTE_REPLACEMENT_VALIGN = 9 — Embedded image/object inline alignment. Attribute type: TEXT_VALIGN_*

TEXT_ATTRIBUTE_COLOR = 31 — Text color. Attribute type: Color

TEXT_ATTRIBUTE_OUTLINE_COLOR = 32 — Text outline color. Attribute type: Color

TEXT_ATTRIBUTE_UNDERLINE_COLOR = 41 — Underline color. Attribute type: Color

TEXT_ATTRIBUTE_UNDERLINE_WIDTH = 42 — Underline width. Attribute type: int

TEXT_ATTRIBUTE_STRIKETHROUGH_COLOR = 51 — Strike through line color. Attribute type: Color

TEXT_ATTRIBUTE_STRIKETHROUGH_WIDTH = 52 — Strike through line width. Attribute type: int

TEXT_ATTRIBUTE_OVERLINE_COLOR = 61 — Overline color/ Attribute type: Color

TEXT_ATTRIBUTE_OVERLINE_WIDTH = 62 — Overline width. Attribute type: int

TEXT_ATTRIBUTE_HIGHLIGHT_COLOR = 71 — Highlight color. Attribute type: Color

TEXT_ATTRIBUTE_META = 100 — User defined data, use TEXT_ATTRIBUTE_META + x to define multiple user attributes. Attribute type: Variant

enum TextVAlign:

TEXT_VALIGN_TOP = 0 — Inline vertical top alignment.

TEXT_VALIGN_CENTER = 1 — Inline vertical center alignment.

TEXT_VALIGN_BOTTOM = 2 — Inline vertical bottom alignment.

Property Descriptions¶

Array attributes_dict

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Setter

load_attributes_dict(value)

Getter

save_attributes_dict()

Array of attribute Dictionary.

int attribute/type

Temporary attribute type, temporary attributes can be committed to the string by calling commit_attribute.

Variant attribute/value

Temporary attribute value, temporary attributes can be committed to the string by calling commit_attribute.

int attribute/start

Temporary attribute start offset, temporary attributes can be committed to the string by calling commit_attribute.

int attribute/end

Temporary attribute end offset, temporary attributes can be committed to the string by calling commit_attribute.

Method Descriptions¶

void add_attribute ( int attribute, Variant value, int start, int end )

Sets attribute attribute to value for specified text range.

void clear_attributes ( )

Removes all attributes.

void commit_attribute ( )

Variant get_attribute ( int attribute, int index ) const

Returns attribute attribute value for specified text position.

int get_attribute_end ( int attribute, int index ) const

Returns last position of attribute attribute run enclosing specified position.

int get_attribute_start ( int attribute, int index ) const

Returns first position of attribute attribute run enclosing specified position.

Array get_embedded_rects ( )

Returns bounding rectangles of embedded objects (TEXT_ATTRIBUTE_REPLACEMENT_RECT attributes).

bool has_attribute ( int attribute, int index ) const

Returns true if specified position has attribute attribute set.

void load_attributes_dict ( Array array )

Loads attributes from Array of Dictionary.

void remove_attribute ( int attribute, int start, int end )

Removes attribute attribute for specified text range.

void remove_attributes ( int start, int end )

Removes all attributes for specified text range.

Array save_attributes_dict ( ) const

Stores string attributes into Array of Dictionary.

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>libgdtl API — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLBitmapFontFace" href="class_tlbitmapfontface.html" />
    <link rel="prev" title="Compiling GDNative module for iOS" href="../development/compiling_ios.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API

libgdtl API¶

TLBitmapFontFace

TLDynamicFontFace

TLFontFace

TLFontFamily

TLFontIterator

TLGDFontWrapper

TLICUDataLoader

TLLabel

TLLineEdit

TLRichTextEdit

TLRichTextEditSelection

TLShapedAttributedString

TLShapedParagraph

TLShapedString

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLShapedParagraph — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLShapedString" href="class_tlshapedstring.html" />
    <link rel="prev" title="TLShapedAttributedString" href="class_tlshapedattributedstring.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLShapedParagraph

TLShapedParagraph¶

Inherits:

Category: Core

Brief Description¶

Class for formatting entire paragraphs of text at once.

Properties¶

<colgroup>
<col style="width: 42%" />
<col style="width: 44%" />
<col style="width: 14%" />
</colgroup>

Color

back_color

Color( 1, 1, 1, 0 )

int

brk_flags

2

int

halign

0

float

indent

0.0

int

jst_flags

1

float

line_spacing

1.0

TLShapedAttributedString

string

float

width

-1.0

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

void

copy_properties ( TLShapedParagraph source )

TLShapedAttributedString

get_line ( int index ) const

Array

get_line_bounds ( ) const

int

get_lines ( ) const

Vector2

get_size ( ) const

Array

get_word_bounds ( ) const

Signals¶

paragraph_changed ( )

Emitted when text or attributes of the paragraph are changed.

Enumerations¶

enum ParaHAlign:

PARA_HALIGN_LEFT = 0 — Align rows to the left (default).

PARA_HALIGN_CENTER = 1 — Align rows centered.

PARA_HALIGN_RIGHT = 2 — Align rows to the right.

PARA_HALIGN_FILL = 3 — Expand row white spaces to fit the width.

Property Descriptions¶

Color back_color

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

Color( 1, 1, 1, 0 )

Setter

set_back_color(value)

Getter

get_back_color()

Background color of the paragraph.

int brk_flags

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

2

Setter

set_brk_flags(value)

Getter

get_brk_flags()

Line breaking flags.

int halign

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_halign(value)

Getter

get_halign()

Horizontal alignment.

float indent

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0.0

Setter

set_indent(value)

Getter

get_indent()

Indentation.

int jst_flags

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

1

Setter

set_jst_flags(value)

Getter

get_jst_flags()

Justification flags.

float line_spacing

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

1.0

Setter

set_line_spacing(value)

Getter

get_line_spacing()

Lien spacing in pixels.

TLShapedAttributedString string

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Setter

set_string(value)

Getter

get_string()

Text and text attributes of the paragraph.

float width

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

-1.0

Setter

set_width(value)

Getter

get_width()

Max width of the paragraph.

Method Descriptions¶

void copy_properties ( TLShapedParagraph source )

Copies properties of the another paragraph.

TLShapedAttributedString get_line ( int index ) const

Returns line of the pargraphs. NOTE: read only, changes to the line will be discarded on paragraph update!

Array get_line_bounds ( ) const

Returns array of the line boundaries as Vector2(start, end).

int get_lines ( ) const

Returns number of lines in the paragraph.

Vector2 get_size ( ) const

Returns size of the paragraph in pixels.

Array get_word_bounds ( ) const

Returns array of the word boundaries as Vector2(start, end).

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLRichTextEditSelection — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLShapedAttributedString" href="class_tlshapedattributedstring.html" />
    <link rel="prev" title="TLRichTextEdit" href="class_tlrichtextedit.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLRichTextEditSelection

TLRichTextEditSelection¶

Inherits:

Category: Core

Brief Description¶

Selection and caret info of the TLRichTextEdit

Properties¶

<colgroup>
<col style="width: 6%" />
<col style="width: 90%" />
<col style="width: 4%" />
</colgroup>

int

caret_offset

0

int

caret_para

0

int

end_offset

0

int

end_para

0

int

start_offset

0

int

start_para

0

Signals¶

selection_changed ( )

Emitted when selection range is changed or caret moved.

Property Descriptions¶

int caret_offset

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_caret_offset(value)

Getter

get_caret_offset()

Caret position in the paragraph caret_para.

int caret_para

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_caret_para(value)

Getter

get_caret_para()

Paragraph where caret currently is in.

int end_offset

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_end_offset(value)

Getter

get_end_offset()

Offset of the end of selection in the paragraph end_para.

int end_para

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_end_para(value)

Getter

get_end_para()

Last paragraph in the selection.

int start_offset

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_start_offset(value)

Getter

get_start_offset()

Offset of the start of selection in the paragraph start_para.

int start_para

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

Default

0

Setter

set_start_para(value)

Getter

get_start_para()

First paragraph in the selection.

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>TLFontFamily — libgdtl latest documentation</title>

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="TLFontIterator" href="class_tlfontiterator.html" />
    <link rel="prev" title="TLFontFace" href="class_tlfontface.html" />

                latest

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

General

libgdtl introduction

Dependencies

Compiling (as builtin module)

Build options

Building libdgtl module

Compiling (as gdnative module)

Build options

Building godot-cpp static library

Building libdgtl module

License

Demo data

Getting started

Installation

Module

GDNative

Font substitution

Rich text typesetting

Setting formatting for the range of text

Removing formatting

Embedding child control into the text flow

Development

Compiling GDNative module for Windows, macOS and Linux

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for Android

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Compiling GDNative module for iOS

Requirements

Building godot-cpp static library

Building libgdtl static library and built-in dependencies

Adding libgdtl static library to the exported Xcode project

Class reference

libgdtl API

TLBitmapFontFace

Brief Description

Properties

Description

TLDynamicFontFace

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLFontFace

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontFamily

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLFontIterator

Brief Description

Methods

Method Descriptions

TLGDFontWrapper

Brief Description

Properties

Description

Property Descriptions

TLICUDataLoader

Brief Description

Properties

Methods

Property Descriptions

Method Descriptions

TLLabel

Brief Description

Properties

Methods

Enumerations

Description

Property Descriptions

Method Descriptions

TLLineEdit

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

TLRichTextEdit

Brief Description

Properties

Methods

Signals

Property Descriptions

Method Descriptions

TLRichTextEditSelection

Brief Description

Properties

Signals

Property Descriptions

TLShapedAttributedString

Brief Description

Properties

Methods

Enumerations

Property Descriptions

Method Descriptions

TLShapedParagraph

Brief Description

Properties

Methods

Signals

Enumerations

Property Descriptions

Method Descriptions

TLShapedString

Brief Description

Properties

Methods

Signals

Enumerations

Description

Property Descriptions

Method Descriptions

          libgdtl

Docs »

libgdtl API »

TLFontFamily

TLFontFamily¶

Inherits:

Category: Core

Brief Description¶

A set of fonts that make up a font family.

Properties¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

TLFontFace

{style_name}/{index}

TLFontFace

{style_name}/script/{tag}/{index}

TLFontFace

{style_name}/script/{lang}/{index}

Methods¶

<colgroup>
<col style="width: 26%" />
<col style="width: 74%" />
</colgroup>

void

add_face ( String style, TLFontFace ref )

void

add_face_for_language ( String style, TLFontFace ref, String lang )

void

add_face_for_script ( String style, TLFontFace ref, String script )

void

add_face_unlinked ( String style, TLFontFace ref )

void

add_language ( String style, String language )

void

add_script ( String style, String script )

void

add_style ( String style )

TLFontIterator

get_face ( String style ) const

TLFontIterator

get_face_for_language ( String style, String lang ) const

TLFontIterator

get_face_for_script ( String style, String script ) const

bool

has_style ( String style ) const

void

remove_language ( String style, String language )

void

remove_script ( String style, String script )

void

remove_style ( String style )

Property Descriptions¶

TLFontFace {style_name}/{index}

Font faces not linked to the language or script.

TLFontFace {style_name}/script/{tag}/{index}

Font faces linked to the script.

TLFontFace {style_name}/script/{lang}/{index}

Font faces linked to the language.

Method Descriptions¶

void add_face ( String style, TLFontFace ref )

Adds font face to be used for specific style. Supported scripts are detected automatically.

void add_face_for_language ( String style, TLFontFace ref, String lang )

Adds font face to be used for specific language and style.

void add_face_for_script ( String style, TLFontFace ref, String script )

Adds font face to be used for specific script and style.

void add_face_unlinked ( String style, TLFontFace ref )

Adds font face to be used for specific style, without associating it with the script or language.

void add_language ( String style, String language )

Creates new font fallback list for the language, list is created automatically when add_face or add_face_for_language function is called.

Use ISO 639-1 (https://en.wikipedia.org/wiki/ISO_639-1) codes for the language names.

void add_script ( String style, String script )

Creates new font fallback list for the script, list is created automatically when add_face or add_face_for_script function is called.

Use ISO 15924 (https://en.wikipedia.org/wiki/ISO_15924) for the script names.

void add_style ( String style )

Adds new style to the family, style is created automatically when any of the add_face functions is called.

TLFontIterator get_face ( String style ) const

Returns font iterator for the specific style.

TLFontIterator get_face_for_language ( String style, String lang ) const

Returns font iterator for the specific style and supported language.

TLFontIterator get_face_for_script ( String style, String script ) const

Returns font iterator for the specific style and supported script.

bool has_style ( String style ) const

Returns true if font family has style.

void remove_language ( String style, String language )

Removes font fallback list for the language.

void remove_script ( String style, String script )

Removes font fallback list for the script.

void remove_style ( String style )

Removes style from the font family.

        Next

         Previous

  Built with Sphinx using a theme provided by Read the Docs.