diff --git a/gdxapp4d-boot-desktop/local-override.xml b/gdxapp4d-boot-desktop/local-override.xml index bb73da12..f1fba545 100644 --- a/gdxapp4d-boot-desktop/local-override.xml +++ b/gdxapp4d-boot-desktop/local-override.xml @@ -4,6 +4,7 @@ ../gdxapp4d-chain-sys-engine/src/chain ../gdxapp4d-chain-sys-engine-fuel/src/chain ../gdxapp4d-chain-dep-osgi-scr/src/chain + ../gdxapp4d-chain-sys-unicode4d/src/chain ../gdxapp4d-app-calculator/src/chain ../gdxapp4d-app-calculator/target/classes diff --git a/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml b/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml index 99ce160a..bc5493b6 100644 --- a/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml +++ b/gdxapp4d-chain-sys-engine/src/chain/warp-sea.xml @@ -4,6 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://wrap-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root http://warp-sea.x4o.distributedrebirth.love/xml/ns/warp-sea-root-1.0.xsd"> + + diff --git a/gdxapp4d-chain-sys-unicode4d/pom.xml b/gdxapp4d-chain-sys-unicode4d/pom.xml new file mode 100644 index 00000000..b4c2d46d --- /dev/null +++ b/gdxapp4d-chain-sys-unicode4d/pom.xml @@ -0,0 +1,10 @@ + + 4.0.0 + + love.distributedrebirth.gdxapp4d + gdxapp4d + 0.0.1-SNAPSHOT + + gdxapp4d-chain-sys-unicode4d + pom + \ No newline at end of file diff --git a/gdxapp4d-tos4/src/main/resources/font/code-2000.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/code-2000.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/code-2000.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/code-2000.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/fa-solid-900.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/fa-solid-900.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/fa-solid-900.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/fa-solid-900.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/free-sans.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/free-sans.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/free-sans.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/free-sans.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/new-gardiner-bmp.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/new-gardiner-bmp.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/new-gardiner-bmp.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/new-gardiner-bmp.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-balinese.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-balinese.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-balinese.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-balinese.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-bamum.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-bamum.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-bamum.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-bamum.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-batak.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-batak.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-batak.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-batak.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-glagolitic.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-glagolitic.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-glagolitic.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-glagolitic.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-lepcha.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-lepcha.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-lepcha.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-lepcha.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-lisu.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-lisu.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-lisu.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-lisu.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-samaritan.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-samaritan.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-samaritan.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-samaritan.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-sinhala.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-sinhala.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-sinhala.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-sinhala.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-sundanese.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-sundanese.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-sundanese.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-sundanese.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-tagalog.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tagalog.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-tagalog.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tagalog.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-tagbanwa.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tagbanwa.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-tagbanwa.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tagbanwa.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-tai-le.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tai-le.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-tai-le.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tai-le.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-tai-tham.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tai-tham.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-tai-tham.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-sans-tai-tham.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-serif-tibetan.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-serif-tibetan.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-serif-tibetan.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane0/noto-serif-tibetan.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/code-2001.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane1/code-2001.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/code-2001.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane1/code-2001.ttf diff --git a/gdxapp4d-chain-sys-unicode4d/src/chain/plane1/new-gardiner-smp.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane1/new-gardiner-smp.ttf new file mode 100644 index 00000000..647b5062 Binary files /dev/null and b/gdxapp4d-chain-sys-unicode4d/src/chain/plane1/new-gardiner-smp.ttf differ diff --git a/gdxapp4d-tos4/src/main/resources/font/noto-sans-brahmi.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane1/noto-sans-brahmi.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/noto-sans-brahmi.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane1/noto-sans-brahmi.ttf diff --git a/gdxapp4d-tos4/src/main/resources/font/code-2002.ttf b/gdxapp4d-chain-sys-unicode4d/src/chain/plane2/code-2002.ttf similarity index 100% rename from gdxapp4d-tos4/src/main/resources/font/code-2002.ttf rename to gdxapp4d-chain-sys-unicode4d/src/chain/plane2/code-2002.ttf diff --git a/gdxapp4d-chain-sys-unicode4d/src/chain/warp-sea.xml b/gdxapp4d-chain-sys-unicode4d/src/chain/warp-sea.xml new file mode 100644 index 00000000..e82523fe --- /dev/null +++ b/gdxapp4d-chain-sys-unicode4d/src/chain/warp-sea.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java index a7222d00..8e6d9fd0 100644 --- a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java +++ b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/GDXAppTos4Activator.java @@ -6,6 +6,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; +import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Properties; @@ -14,6 +15,8 @@ import java.util.function.Consumer; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.x4o.xml.io.X4OConnectionException; @@ -149,25 +152,6 @@ public class GDXAppTos4Activator implements BundleActivator { } } - FreeTypeFontParameter parameter = new FreeTypeFontParameter(); - parameter.characters = FreeTypeFontGenerator.DEFAULT_CHARS + getRangeUnicodeUsed(); - parameter.size = 14; - Gdx.app.postRunnable(new Runnable() { - @Override - public void run() { - FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("font/code-2000.ttf")); - gdxFont = generator.generateFont(parameter); - } - }); - while (gdxFont == null) { - try { - Thread.sleep(100); - } catch (InterruptedException ignored) { - } - } - bootScreen.bootLine("gdx-font: "+parameter.characters.length()+" glyphs loaded."); - - SystemWarpShipImpl systemWarpShip = new SystemWarpShipImpl(); context.registerService(SystemWarpBase.class.getName(), new SystemWarpBaseImpl(), new Hashtable()); @@ -177,11 +161,6 @@ public class GDXAppTos4Activator implements BundleActivator { Gdx.app.setLogLevel(Application.LOG_DEBUG); Gdx.app.setApplicationLogger(systemGdxLog); - context.registerService(SystemGdxFont.class.getName(), new SystemGdxFontImpl(gdxFont), new Hashtable()); - context.registerService(SystemGdxLog.class.getName(), systemGdxLog, new Hashtable()); - context.registerService(SystemGdxBootArgs.class.getName(), new SystemGdxBootArgsImpl(), new Hashtable()); - context.registerService(SystemGdxTerminal.class.getName(), systemGdxTerminal, new Hashtable()); - List registratedSeas = new ArrayList<>(); int result = 0; try { @@ -197,8 +176,34 @@ public class GDXAppTos4Activator implements BundleActivator { startError = true; return; } - bootScreen.bootLine("tos4: chains resolved."); + + List fonts = systemWarpShip.searchMagic(context, "application/x-font-ttf-plane0"); + File systemFont = fonts.get(0); + FreeTypeFontParameter parameter = new FreeTypeFontParameter(); + parameter.characters = FreeTypeFontGenerator.DEFAULT_CHARS + getRangeUnicodeUsed(); + parameter.size = 14; + Gdx.app.postRunnable(new Runnable() { + @Override + public void run() { + FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.absolute(systemFont.getAbsolutePath())); + gdxFont = generator.generateFont(parameter); + } + }); + while (gdxFont == null) { + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + } + } + bootScreen.bootLine("gdx-font: "+parameter.characters.length()+" glyphs loaded."); + + + context.registerService(SystemGdxFont.class.getName(), new SystemGdxFontImpl(gdxFont), new Hashtable()); + context.registerService(SystemGdxLog.class.getName(), systemGdxLog, new Hashtable()); + context.registerService(SystemGdxBootArgs.class.getName(), new SystemGdxBootArgsImpl(), new Hashtable()); + context.registerService(SystemGdxTerminal.class.getName(), systemGdxTerminal, new Hashtable()); + try { systemWarpShip.loadBundles(context, registratedSeas); } catch (BundleException e) { @@ -394,6 +399,28 @@ public class GDXAppTos4Activator implements BundleActivator { } } } + + @Override + public List searchMagic(BundleContext context, String mimeType) { + Collection> oceansRefs = null; + try { + oceansRefs = context.getServiceReferences(SystemWarpSea.class, "(warp.sea.name=*)"); + } catch (InvalidSyntaxException e) { + throw new RuntimeException(e); + } + List result = new ArrayList<>(); + for (ServiceReference serviceRef : oceansRefs) { + SystemWarpSea service = context.getService(serviceRef); + File waterHome = service.getWarpHome(); + for (WaterSeaMagic magic:service.getWarpSea().theWater().getSeaMagics()) { + if (mimeType.equals(magic.getMime())) { + File file = new File(waterHome, magic.getFile()); + result.add(file); + } + } + } + return result; + } } public static class SystemGdxLogImpl implements SystemGdxLog, ApplicationLogger { diff --git a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java index 7a07943c..a6008bcf 100644 --- a/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java +++ b/gdxapp4d-tos4/src/main/java/love/distributedrebirth/gdxapp4d/tos4/service/SystemWarpShip.java @@ -1,5 +1,6 @@ package love.distributedrebirth.gdxapp4d.tos4.service; +import java.io.File; import java.io.IOException; import java.util.List; import java.util.function.Consumer; @@ -20,4 +21,6 @@ public interface SystemWarpShip { int loadWaterOcean(BundleContext context, List registratedSeas, String key, Consumer logger) throws IOException, InterruptedException, X4OConnectionException, SAXException, BundleException; void loadBundles(BundleContext context, List registratedSeas) throws BundleException; + + List searchMagic(BundleContext context, String mimeType); } diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java index 085a515a..a7e2dff6 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/GDXAppVrGem4Activator.java @@ -1,5 +1,6 @@ package love.distributedrebirth.gdxapp4d.vrgem4; +import java.io.File; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; @@ -38,8 +39,16 @@ public class GDXAppVrGem4Activator implements BundleActivator { private static final int VIEW_SLEEP_TIME = 1234; + private ImGuiSetup imguiSetup = new ImGuiSetup(); + @Override public void stop(final BundleContext context) { + Gdx.app.postRunnable(new Runnable() { + @Override + public void run() { + imguiSetup.dispose(); + } + }); } @Override @@ -58,6 +67,9 @@ public class GDXAppVrGem4Activator implements BundleActivator { ServiceReference gdxFontRef = context.getServiceReference(SystemGdxFont.class); SystemGdxFont gdxFont = context.getService(gdxFontRef); + ServiceReference systemWarpShipRef = context.getServiceReference(SystemWarpShip.class); + SystemWarpShip systemWarpShip = context.getService(systemWarpShipRef); + logger.info(this, "Booting"); GDXAppVrGem4BootScreen bootScreen = new GDXAppVrGem4BootScreen(gdxFont.getFont()); Gdx.app.postRunnable(new Runnable() { @@ -86,16 +98,13 @@ public class GDXAppVrGem4Activator implements BundleActivator { } bootScreen.bootLine("BãßBȍőnCoffinʸᴰ init done."); + List fonts = systemWarpShip.searchMagic(context, "application/x-font-ttf-plane0"); bootScreen.bootLine("ImGui Setup"); - try { - Thread.sleep(100); - } catch (InterruptedException ignored) { - } ImBoolean imLoaded = new ImBoolean(false); Gdx.app.postRunnable(new Runnable() { @Override public void run() { - ImGuiSetup.init(); + imguiSetup.init(fonts, v -> logger.info(imguiSetup, v)); imLoaded.set(true); } }); @@ -172,8 +181,7 @@ public class GDXAppVrGem4Activator implements BundleActivator { } - ServiceReference systemWarpShipRef = context.getServiceReference(SystemWarpShip.class); - SystemWarpShip systemWarpShip = context.getService(systemWarpShipRef); + List registratedSeas = new ArrayList<>(); int result = 0; diff --git a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/ImGuiSetup.java b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/ImGuiSetup.java index 603adba8..c2d5d815 100644 --- a/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/ImGuiSetup.java +++ b/gdxapp4d-vrgem4/src/main/java/love/distributedrebirth/gdxapp4d/vrgem4/ImGuiSetup.java @@ -1,5 +1,9 @@ package love.distributedrebirth.gdxapp4d.vrgem4; +import java.io.File; +import java.util.List; +import java.util.function.Consumer; + import com.badlogic.gdx.Gdx; import imgui.ImFontConfig; @@ -16,10 +20,10 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; */ @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class ImGuiSetup { - public static final ImGuiImplGlfw imGuiImp = new ImGuiImplGlfw(); - public static final ImGuiImplGl3 imGuiGlImp = new ImGuiImplGl3(); + public final static ImGuiImplGlfw imGuiImp = new ImGuiImplGlfw(); + public final static ImGuiImplGl3 imGuiGlImp = new ImGuiImplGl3(); - public static void init() { + public void init(List fonts, Consumer logger) { long windowHandle = -1; try { Object window = Gdx.graphics.getClass().getMethod("getWindow").invoke(Gdx.graphics); @@ -28,7 +32,7 @@ public class ImGuiSetup { throw new RuntimeException(e); } ImGui.createContext(); - initFonts(ImGui.getIO()); + initFonts(ImGui.getIO(), fonts, logger); imGuiImp.init(windowHandle, true); imGuiGlImp.init("#version 140"); ImGui.getIO().setIniFilename(null); @@ -36,7 +40,7 @@ public class ImGuiSetup { initStyle(); } - private static void initStyle() { + private void initStyle() { ImGui.styleColorsDark(); ImGuiStyle style = ImGui.getStyle(); style.setWindowRounding(0f); @@ -45,43 +49,25 @@ public class ImGuiSetup { style.setScrollbarSize(22f); } - private static void initFonts(final ImGuiIO io) { + private void initFonts(final ImGuiIO io, List fonts, Consumer logger) { ImFontConfig fontConfig = new ImFontConfig(); ImFontGlyphRangesBuilder fontBuilder = new ImFontGlyphRangesBuilder(); addRangeUnicodePlane0(fontBuilder); final short[] glyphRanges = fontBuilder.buildRanges(); - // Base font has almost everything - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/code-2000.ttf").readBytes(), 22, fontConfig, glyphRanges); - fontConfig.setMergeMode(true); - // note: merges ~148 chars, just for 3 sub chars for SUBHEX, but still missing 2 chars from T12 alt1 clock - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/free-sans.ttf").readBytes(), 22, fontConfig, glyphRanges); - // Egyptian hieroglyphs - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/new-gardiner-bmp.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/fa-solid-900.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-samaritan.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-sinhala.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-serif-tibetan.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tagalog.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tagbanwa.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tai-le.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-tai-tham.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-batak.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-lepcha.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-balinese.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-sundanese.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-lisu.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-bamum.ttf").readBytes(), 22, fontConfig, glyphRanges); - io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/noto-sans-glagolitic.ttf").readBytes(), 22, fontConfig, glyphRanges); - - // Missig plane 1++ - // - code-2001 - // - code-2002 - // - noto-sans-brahmi + boolean first = true; + for (File font: fonts) { + logger.accept("Load font: "+font); + io.getFonts().addFontFromMemoryTTF(Gdx.files.absolute(font.getAbsolutePath()).readBytes(), 22, fontConfig, glyphRanges); + if (first) { + fontConfig.setMergeMode(true); + first = false; + } + } fontConfig.destroy(); } - private static void addRangeUnicodePlane0(ImFontGlyphRangesBuilder fontBuilder) { + private void addRangeUnicodePlane0(ImFontGlyphRangesBuilder fontBuilder) { for (int c=0x0001;c<=0xFFEF;c++) { StringBuilder buf = new StringBuilder(); buf.append(""+(char)c); @@ -89,7 +75,7 @@ public class ImGuiSetup { } } - public static void dispose() { + public void dispose() { imGuiImp.dispose(); imGuiGlImp.dispose(); ImGui.destroyContext(); diff --git a/pom.xml b/pom.xml index 3552832e..0522d6a4 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,7 @@ gdxapp4d-chain-music-templeos gdxapp4d-chain-sys-engine gdxapp4d-chain-sys-engine-fuel + gdxapp4d-chain-sys-unicode4d gdxapp4d-lib-basicwd gdxapp4d-lib-imxmi gdxapp4d-lib-numberxd