feat(api): make FreeType a toggleable option which is disabled by default (#254)

* deps(build): bump FreeType from 2.12.1 to 2.13.3

* fix(generator): add missing ImGuiFreeTypeBuilderFlags

* feat(generator): add possibility to provide additional defines specifically for AST

* feat(api): make FreeType optional and disabled by default

FreeType renderer is still included in the final build.
Its usage is toggleable and DISABLED by default.
This commit is contained in:
SpaiR authored and GitHub committed 2024-08-18 10:45:27 +03:00
1 parent 887e3d9c85
commit d252c145c5
15 files changed
+370 -10

No files matched your search

@@ -460,6 +460,32 @@ public final class ImFontAtlas extends ImGuiStructDestroyable {
// Building in RGBA32 format is provided for convenience and compatibility, but note that unless you manually manipulate or copy color data into
// the texture (e.g. when using the AddCustomRect*** api), then the RGB pixels emitted will always be white (~75% of memory/bandwidth waste.
/*JNI
#ifdef IMGUI_ENABLE_FREETYPE
#include "misc/freetype/imgui_freetype.h"
#endif
*/
/**
* <b>BINDING NOTICE:</b> This method is specific to the imgui-java binding.
* <p>
* Since FreeType is included in the final build, it's possible to use both font renderers (STB_TrueType and FreeType) simultaneously without needing to rebuild the library.
* By default, we use small hacks to set STB_TrueType as the default font renderer. However, this method allows you to enforce the use of the FreeType renderer.
* <p>
* This method MUST be called before invoking the "#build" or "#getTexData*" methods.
*
* @param enabled true to enable the FreeType font renderer
*/
public native void setFreeTypeRenderer(boolean enabled); /*
#ifdef IMGUI_ENABLE_FREETYPE
if (enabled) {
THIS->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType();
} else {
THIS->FontBuilderIO = NULL;
}
#endif
*/
/**
* Build pixels data. This is called automatically for you by the GetTexData*** functions.
*/