Commit c52960ea authored by swordshine's avatar swordshine

Merge branch 'master' into 'master'

Android:prevent generate excessive font cache for zh_CN

See merge request core-developers/forge!2237
parents 4a6725d2 9115148e
......@@ -26,8 +26,10 @@ import java.util.Map;
public class FSkinFont {
private static final int MIN_FONT_SIZE = 8;
private static final int MAX_FONT_SIZE = 72;
private static final int MAX_FONT_SIZE_ZH_CN = 28;
private static int MAX_FONT_SIZE = 72;
private static final int MAX_FONT_SIZE_LESS_GLYPHS = 72;
private static final int MAX_FONT_SIZE_MANY_GLYPHS = 36;
private static final String TTF_FILE = "font1.ttf";
private static final Map<Integer, FSkinFont> fonts = new HashMap<>();
......@@ -60,8 +62,9 @@ public class FSkinFont {
//pre-load all supported font sizes
public static void preloadAll(String language) {
int maxfontSize = (language.equals("zh-CN")) ? MAX_FONT_SIZE_ZH_CN : MAX_FONT_SIZE;
for (int size = MIN_FONT_SIZE; size <= maxfontSize; size++) {
//todo:really check the language glyph is a lot
MAX_FONT_SIZE = (language.equals("zh-CN")) ? MAX_FONT_SIZE_MANY_GLYPHS : MAX_FONT_SIZE_LESS_GLYPHS;
for (int size = MIN_FONT_SIZE; size <= MAX_FONT_SIZE; size++) {
_get(size);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment