mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Merge branch 'master' into 'master'
[Android] Fix startup with CJK Fonts See merge request core-developers/forge!4113
This commit is contained in:
@@ -79,6 +79,7 @@ public class Forge implements ApplicationListener {
|
|||||||
public static int androidVersion = 0;
|
public static int androidVersion = 0;
|
||||||
public static boolean autoCache = false;
|
public static boolean autoCache = false;
|
||||||
public static int lastButtonIndex = 0;
|
public static int lastButtonIndex = 0;
|
||||||
|
public static String CJK_Font = "";
|
||||||
|
|
||||||
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean value, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) {
|
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean value, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) {
|
||||||
if (GuiBase.getInterface() == null) {
|
if (GuiBase.getInterface() == null) {
|
||||||
@@ -140,6 +141,7 @@ public class Forge implements ApplicationListener {
|
|||||||
locale = prefs.getPref(FPref.UI_LANGUAGE);
|
locale = prefs.getPref(FPref.UI_LANGUAGE);
|
||||||
autoCache = prefs.getPrefBoolean(FPref.UI_AUTO_CACHE_SIZE);
|
autoCache = prefs.getPrefBoolean(FPref.UI_AUTO_CACHE_SIZE);
|
||||||
disposeTextures = prefs.getPrefBoolean(FPref.UI_ENABLE_DISPOSE_TEXTURES);
|
disposeTextures = prefs.getPrefBoolean(FPref.UI_ENABLE_DISPOSE_TEXTURES);
|
||||||
|
CJK_Font = prefs.getPref(FPref.UI_CJK_FONT);
|
||||||
|
|
||||||
if (autoCache) {
|
if (autoCache) {
|
||||||
//increase cacheSize for devices with RAM more than 5GB, default is 400. Some phones have more than 10GB RAM (Mi 10, OnePlus 8, S20, etc..)
|
//increase cacheSize for devices with RAM more than 5GB, default is 400. Some phones have more than 10GB RAM (Mi 10, OnePlus 8, S20, etc..)
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
|
|
||||||
import forge.FThreads;
|
import forge.FThreads;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
//import forge.model.FModel;
|
|
||||||
import forge.properties.ForgeConstants;
|
import forge.properties.ForgeConstants;
|
||||||
//import forge.properties.ForgePreferences.FPref;
|
|
||||||
import forge.util.FileUtil;
|
import forge.util.FileUtil;
|
||||||
import forge.util.LineReader;
|
import forge.util.LineReader;
|
||||||
import forge.util.TextBounds;
|
import forge.util.TextBounds;
|
||||||
@@ -380,11 +378,10 @@ public class FSkinFont {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//String locale = FModel.getPreferences().getPref(FPref.UI_LANGUAGE);
|
|
||||||
String fontName = "f" + fontSize;
|
String fontName = "f" + fontSize;
|
||||||
/*if (locale.equals("zh-CN") || locale.equals("ja-JP")) {
|
if (Forge.locale.equals("zh-CN") || Forge.locale.equals("ja-JP")) {
|
||||||
fontName += locale;
|
fontName += Forge.locale;
|
||||||
}*/
|
}
|
||||||
FileHandle fontFile = Gdx.files.absolute(ForgeConstants.FONTS_DIR + fontName + ".fnt");
|
FileHandle fontFile = Gdx.files.absolute(ForgeConstants.FONTS_DIR + fontName + ".fnt");
|
||||||
if (fontFile != null && fontFile.exists()) {
|
if (fontFile != null && fontFile.exists()) {
|
||||||
final BitmapFontData data = new BitmapFontData(fontFile, false);
|
final BitmapFontData data = new BitmapFontData(fontFile, false);
|
||||||
@@ -395,17 +392,15 @@ public class FSkinFont {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
generateFont(FSkin.getSkinFile(TTF_FILE), fontName, fontSize);
|
if (Forge.locale.equals("zh-CN") || Forge.locale.equals("ja-JP")) {
|
||||||
/*
|
String ttfName = Forge.CJK_Font;
|
||||||
if (locale.equals("zh-CN") || locale.equals("ja-JP")) {
|
|
||||||
String ttfName = FModel.getPreferences().getPref(FPref.UI_CJK_FONT);
|
|
||||||
FileHandle ttfFile = Gdx.files.absolute(ForgeConstants.FONTS_DIR + ttfName + ".ttf");
|
FileHandle ttfFile = Gdx.files.absolute(ForgeConstants.FONTS_DIR + ttfName + ".ttf");
|
||||||
if (ttfFile != null && ttfFile.exists()) {
|
if (ttfFile != null && ttfFile.exists()) {
|
||||||
generateFont(ttfFile, fontName, fontSize);
|
generateFont(ttfFile, fontName, fontSize);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
generateFont(FSkin.getSkinFile(TTF_FILE), fontName, fontSize);
|
generateFont(FSkin.getSkinFile(TTF_FILE), fontName, fontSize);
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user