From a46a5abf49132fab89ae4caf1237e93611511b06 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 16 Oct 2019 14:11:07 -0400 Subject: [PATCH] v0.7.5c: fixed additional errors with font setup --- .../android/AndroidPlatformSupport.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java index a91959dea..07f219f63 100644 --- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java +++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidPlatformSupport.java @@ -211,11 +211,11 @@ public class AndroidPlatformSupport extends PlatformSupport { fonts = new HashMap<>(); basicFontGenerator = KRFontGenerator = SCFontGenerator = JPFontGenerator = null; - if (systemfont && Gdx.files.absolute("/system/fonts/DroidSans.ttf").exists()){ + if (systemfont && Gdx.files.absolute("/system/fonts/Roboto-Regular.ttf").exists()) { + basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/Roboto-Regular.ttf")); + } else if (systemfont && Gdx.files.absolute("/system/fonts/DroidSans.ttf").exists()){ basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/DroidSans.ttf")); } else { - //FIXME should probably add more latin/cyrillic glyphs to this - //and go over translations basicFontGenerator = new FreeTypeFontGenerator(Gdx.files.internal("pixel_font.ttf")); } @@ -251,8 +251,6 @@ public class AndroidPlatformSupport extends PlatformSupport { if (Gdx.files.absolute("/system/fonts/NotoSansSC-Regular.otf").exists()){ SCFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansSC-Regular.otf")); } else if (Gdx.files.absolute("/system/fonts/NotoSansHans-Regular.otf").exists()){ - //TODO this seems to also have a lot of JP characters. - // Might be cases where this font shows up and NotoSansJP is mostly empty =S SCFontGenerator = new FreeTypeFontGenerator(Gdx.files.absolute("/system/fonts/NotoSansHans-Regular.otf")); } @@ -281,13 +279,8 @@ public class AndroidPlatformSupport extends PlatformSupport { if (SCFontGenerator != null) fonts.put(SCFontGenerator, SCFonts); if (JPFontGenerator != null) fonts.put(JPFontGenerator, JPFonts); - String renderer = Gdx.gl.glGetString(Gdx.gl.GL_RENDERER); - //want to use RGBA4444 to save memory if we can, but this causes problems on Mali gpus - if (renderer.contains("Mali") || renderer.contains("mali")) { - packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 1, false); - } else { - packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA4444, 1, false); - } + //would be nice to use RGBA4444 to save memory, but this causes problems on some gpus =S + packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 1, false); } @Override