Skip to content
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

Unify TextServer built-in module and GDExtension code. #58233

Merged
merged 1 commit into from
Mar 18, 2022

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Feb 17, 2022

Allows build the same TextServer code as a GDExtension or built-in module.

  • Adds String operator + char32_t.
  • Exposes String::num_int64 and String::num_uint64 methods to scripting.
  • Exposes Image::create_from_data and Image::create_empty to C++.
  • Makes TextServer interface GDExtension compatible.
  • Adds SCons scripts to build TextServer implementation as GDExtension.
  • Adds a TextServerDummy, which is not capable of loading fonts and rendering text, but allows building Godot (including editor builds) without real text servers and FreeType.

GDExtension modules depends on godotengine/godot-cpp#701, and require extension_api.json update to build.

@bruvzg bruvzg added this to the 4.0 milestone Feb 17, 2022
@bruvzg bruvzg force-pushed the gde_ts branch 2 times, most recently from 6a08510 to be83773 Compare February 18, 2022 08:23
@bruvzg bruvzg changed the title [WIP] Unify TextServer built-in module and GDExtension code. Unify TextServer built-in module and GDExtension code. Feb 18, 2022
@bruvzg
Copy link
Member Author

bruvzg commented Feb 18, 2022

Some binary size stats:


Editor release-debug build (ARM64 macOS build):

With both Advanced and Fallback text servers: Unstripped 159 MB, stripped 118 MB.
Without any text servers, and FreeType: Unstripped 147 MB, stripped 107 MB.


Export template build release (ARM64 macOS build, with LTO):

With both Advanced and Fallback text servers: stripped 70 MB.
Without any text servers, and FreeType: stripped 63 MB.


GDExtension modules (works with both exported project and editor, Universal ARM64+x86_64 macOS build):

Advanced - Unstripped debug 32 MB, stripped debug 19 MB, unstripped release 20 MB, stripped release 18 MB.
Fallback - Unstripped debug 10 MB, stripped debug 6 MB, unstripped release 6 MB, stripped release 5 MB.

@bruvzg bruvzg force-pushed the gde_ts branch 2 times, most recently from 444a0a2 to d570175 Compare February 18, 2022 17:30
@bruvzg bruvzg marked this pull request as ready for review February 18, 2022 19:40
@bruvzg bruvzg requested review from a team as code owners February 18, 2022 19:40
.gitignore Outdated Show resolved Hide resolved
@@ -741,7 +741,7 @@ if selected_platform in platform_list:
if env["minizip"]:
env.Append(CPPDEFINES=["MINIZIP_ENABLED"])

editor_module_list = ["freetype"]
editor_module_list = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't really need the editor_module_list logic now.

That being said, we could decide to make both regex and svg modules mandatory for the editor so I guess we can keep it for later use.

@akien-mga akien-mga merged commit 5c8bd6f into godotengine:master Mar 18, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants