From 400616c4500468ca70066fc1cef16d432442fbd7 Mon Sep 17 00:00:00 2001 From: HugeFrog24 <62775760+HugeFrog24@users.noreply.github.com> Date: Tue, 17 Mar 2026 04:29:49 +0100 Subject: [PATCH] Fix NDK 29 build and add Georgian font support - Bump ndkVersion to 29.0.14206865 to match installed NDK - Fix PAGE_SIZE build error in artpatch.c: macro was removed from NDK 29 public headers; replaced with a sysconf(_SC_PAGESIZE) define - Add Georgian (Mkhedruli, U+10A0-10FF) glyph range to ImGui font atlas by merging NotoSansGeorgian from Android system fonts; tries VF/static/fallback candidates in order so it works across Android versions --- app/build.gradle | 2 +- app/src/main/cpp/Utils/artpatch/artpatch.c | 6 +++- .../cpp/Utils/imgui_androidbk/androidbk.cpp | 28 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 49feef8..4f367e0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -60,7 +60,7 @@ android { dataBinding = true prefab true } - ndkVersion = '26.1.10909125' + ndkVersion = '29.0.14206865' namespace 'git.artdeell.skymodloader' } diff --git a/app/src/main/cpp/Utils/artpatch/artpatch.c b/app/src/main/cpp/Utils/artpatch/artpatch.c index 29a7505..47919d2 100644 --- a/app/src/main/cpp/Utils/artpatch/artpatch.c +++ b/app/src/main/cpp/Utils/artpatch/artpatch.c @@ -6,8 +6,12 @@ #include #include #include -#include #include +#include +// PAGE_SIZE was removed from NDK 29 public headers; derive it at runtime. +#ifndef PAGE_SIZE +# define PAGE_SIZE ((size_t)sysconf(_SC_PAGESIZE)) +#endif #include "procutils.h" diff --git a/app/src/main/cpp/Utils/imgui_androidbk/androidbk.cpp b/app/src/main/cpp/Utils/imgui_androidbk/androidbk.cpp index a33b66f..9299a65 100644 --- a/app/src/main/cpp/Utils/imgui_androidbk/androidbk.cpp +++ b/app/src/main/cpp/Utils/imgui_androidbk/androidbk.cpp @@ -253,6 +253,34 @@ PRIVATE_API static void loadFonts(ImGuiIO& io, jfloat fontsize, AAssetManager *m rangesEuropean.Data); /* END */ + /* GEORGIAN GLYPH MERGE — merged into the Roboto atlas above. + * Roboto does not ship Georgian glyphs; we pull them from whichever + * NotoSansGeorgian variant is present on the device (path varies by + * Android version and OEM). First successful load wins; missing files + * are silently skipped by AddFontFromFileTTF returning nullptr. */ + { + static const ImWchar kGeorgianRanges[] = { + 0x10A0, 0x10FF, // Georgian (Mkhedruli) + 0, + }; + static const char* kGeorgianFontCandidates[] = { + "/system/fonts/NotoSansGeorgian-VF.ttf", // OEM / Android 11+ (variable) + "/system/fonts/NotoSansGeorgian-Regular.ttf", // Android <= 11 (static) + "/system/fonts/NotoSansGeorgian[wdth,wght].ttf", // alternative variable naming + "/system/fonts/NotoSans-Regular.ttf", // broad fallback + nullptr, + }; + ImFontConfig fcGeo; + fcGeo.MergeMode = true; + for (int gi = 0; kGeorgianFontCandidates[gi]; ++gi) { + if (io.Fonts->AddFontFromFileTTF(kGeorgianFontCandidates[gi], fontsize, + &fcGeo, kGeorgianRanges)) { + break; + } + } + } + /* END GEORGIAN */ + void* fontBufferDroidSans = nullptr; /* DROID SANS */