-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Complex Text Layouts] Implement TextServer interface. #41100
[Complex Text Layouts] Implement TextServer interface. #41100
Conversation
94e903b
to
756fa32
Compare
3ad959b
to
31a02c8
Compare
e2ddb26
to
72e373f
Compare
…ls to use Text Server interface. Implement interface mirroring. Add TextLine and TextParagraph classes. Handle UTF-16 input on macOS and Windows.
…vasItem, Theme and modified controls documentation.
e6d1f95
to
7e2c0ff
Compare
This is an incredible piece of work. I think its really good, probably best to leave it up to the community to use and give feedback on usage but I think it should be good enough. My main fear is backwards compatibility with older scenes, but I guess it should work? |
We are discussing a way to do compatibility filters between older and newer Godot versions, so there might be a way I guess. |
Here we go! A huge thank you for this amazing feature! |
bool Control::is_layout_rtl() const {
if (data.layout_dir == LAYOUT_DIRECTION_INHERITED) {
Window *parent_window = Object::cast_to<Window>(get_parent());
Control *parent_control = get_parent_control();
if (parent_control) {
return parent_control->is_layout_rtl();
} else if (parent_window) {
return parent_window->is_layout_rtl();
} else {
if (GLOBAL_GET("display/window/force_right_to_left_layout_direction")) {
return true;
}
} else if (data.layout_dir == LAYOUT_DIRECTION_LOCALE) {
if (GLOBAL_GET("display/window/force_right_to_left_layout_direction")) {
return true;
} |
So I noticed it just now, but why does this PR introduce theme font sizes instead of using theme constants for this purpose? |
Font size have some extra fallback logic for the Theme and global default values, constants use |
Part of godotengine/godot-proposals#1180 implementation.
Depends on #40999TODO:
Label
,LineEdit
,TextEdit
,RichTextLabel
) TS base text ✔️LineEdit
s andCodeEdit
✔️Label
✔️LineEdit
✔️TextEdit
+CodeEdit
✔️RichTextLabel
(probably will be done as the separate PR)MessageQuery
size to 2048 KB to handle additionalLineEdit
/TextEdit
popup submenus (superseded by MessageQueue: Change default queue size to 4096 KB #42296) ✔️Breaking changes:
BitmapFont
,DynamicFont
andDyamicFontData
are removed and replaced with universalFont
+FontData
, actual implementation is handled byTextServer
.Font
andCanvasItem
API changes:draw_multiline_string
function.DynamicFont
fallback (single list ofFontData
).Major Font API changes:
Old:New:
TextServer interface structure:
Test projects:
GDNative plugin template: https://github.com/bruvzg/gdnative_text_server_template
Current status:
RichTextLabel
and containers support mirroring and useTexeServer
base text rendering.Input:
Input of the characters outside BMP (codes
> 0xFFFF
, emoji, rare/ancient scripts, e.t.c.) is fully tested on macOS, Windows 10, Android and Wine under macOS.Should work on Linux (input is received as UTF-8 string), but might need some more testing with different input methods.
On iOS, it should work as well (input is received as UTF-16 string), but I can't test it since I do not have any iOS device, and simulator currently do not have all Metal features supported to run Godot.
Screenshots - click to expand
Fixed and related issues / PRs:
Previous implementations: #21791, #10546
Fixes #40688
Fixes #28371
Fixes #3081
Fixes #9961
Fixes #982