diff --git a/Android.mk b/Android.mk index bb55acc2..a3ff6512 100644 --- a/Android.mk +++ b/Android.mk @@ -5,6 +5,9 @@ SDL_TTF_LOCAL_PATH := $(call my-dir) SUPPORT_HARFBUZZ ?= true HARFBUZZ_LIBRARY_PATH := external/harfbuzz +# Enable this if you want to use SDL_TextEngine +SUPPORT_SDL_TEXTENGINE ?= true + FREETYPE_LIBRARY_PATH := external/freetype # Build freetype library @@ -25,6 +28,12 @@ LOCAL_MODULE := SDL3_ttf LOCAL_SRC_FILES := src/SDL_ttf.c.neon +ifeq ($(SUPPORT_SDL_TEXTENGINE),true) + LOCAL_SRC_FILES += src/SDL_hashtable.c src/SDL_renderer_textengine.c src/SDL_surface_textengine.c +else + LOCAL_CFLAGS += -DSDL_DISABLE_TEXTENGINE +endif + LOCAL_C_INCLUDES += $(LOCAL_PATH)/include LOCAL_CFLAGS += -O2 diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c index 0cc00de6..7355915c 100644 --- a/src/SDL_ttf.c +++ b/src/SDL_ttf.c @@ -4251,3 +4251,34 @@ int TTF_WasInit(void) return SDL_GetAtomicInt(&TTF_state.refcount); } +#if defined(SDL_DISABLE_TEXTENGINE) + +TTF_TextEngine *TTF_CreateRendererTextEngine(SDL_Renderer *renderer) +{ + return NULL; +} + +TTF_TextEngine *TTF_CreateSurfaceTextEngine(void) +{ + return NULL; +} + +void TTF_DestroyRendererTextEngine(TTF_TextEngine *engine) +{ +} + +void TTF_DestroySurfaceTextEngine(TTF_TextEngine *engine) +{ +} + +bool TTF_DrawRendererText(TTF_Text *text, float x, float y) +{ + return false; +} + +bool TTF_DrawSurfaceText(TTF_Text *text, int x, int y, SDL_Surface *surface) +{ + return false; +} + +#endif