mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Added new font characters to mobile port (diacritics).
Deleted removeDiacritics because it's not needed now in mobile port.
This commit is contained in:
@@ -187,6 +187,7 @@ public class FSkinFont {
|
|||||||
|
|
||||||
//only generate images for characters that could be used by Forge
|
//only generate images for characters that could be used by Forge
|
||||||
String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!?'.,;:()[]{}<>|/@\\^$-%+=#_&*\u2014\u2022";
|
String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!?'.,;:()[]{}<>|/@\\^$-%+=#_&*\u2014\u2022";
|
||||||
|
chars += "ÁÉÍÓÚáéíóúÀÈÌÒÙàèìòùÑñÄËÏÖÜäëïöüẞß";
|
||||||
|
|
||||||
final PixmapPacker packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 2, false);
|
final PixmapPacker packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 2, false);
|
||||||
final FreeTypeFontParameter parameter = new FreeTypeFontParameter();
|
final FreeTypeFontParameter parameter = new FreeTypeFontParameter();
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ package forge.card;
|
|||||||
|
|
||||||
import com.esotericsoftware.minlog.Log;
|
import com.esotericsoftware.minlog.Log;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import forge.GuiBase;
|
|
||||||
import forge.properties.ForgeConstants;
|
import forge.properties.ForgeConstants;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
import forge.util.LineReader;
|
import forge.util.LineReader;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.Normalizer;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -19,13 +17,6 @@ public class CardTranslation {
|
|||||||
private static Map <String, String> translatedtypes;
|
private static Map <String, String> translatedtypes;
|
||||||
private static Map <String, String> translatedoracles;
|
private static Map <String, String> translatedoracles;
|
||||||
|
|
||||||
private static String removeDiacritics(String text) {
|
|
||||||
text = text.replace("ñ", "ny");
|
|
||||||
text = Normalizer.normalize(text, Normalizer.Form.NFD);
|
|
||||||
text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void readTranslationFile(String language) {
|
private static void readTranslationFile(String language) {
|
||||||
String filename = "cardnames-" + language + ".txt";
|
String filename = "cardnames-" + language + ".txt";
|
||||||
|
|
||||||
@@ -48,39 +39,30 @@ public class CardTranslation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getTranslatedName(String name) {
|
public static String getTranslatedName(String name) {
|
||||||
|
if (needsTranslation()) {
|
||||||
String tname = translatednames.get(name);
|
String tname = translatednames.get(name);
|
||||||
|
return tname == null ? name : tname;
|
||||||
if (tname != null) {
|
|
||||||
if (GuiBase.getInterface().isLibgdxPort()) tname = removeDiacritics(tname);
|
|
||||||
} else {
|
|
||||||
tname = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tname;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTranslatedType(String name, String originaltype) {
|
public static String getTranslatedType(String name, String originaltype) {
|
||||||
|
if (needsTranslation()) {
|
||||||
String ttype = translatedtypes.get(name);
|
String ttype = translatedtypes.get(name);
|
||||||
|
return ttype == null ? originaltype : ttype;
|
||||||
if (ttype != null) {
|
|
||||||
if (GuiBase.getInterface().isLibgdxPort()) ttype = removeDiacritics(ttype);
|
|
||||||
} else {
|
|
||||||
ttype = originaltype;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ttype;
|
return originaltype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTranslatedOracle(String name, String originaloracle) {
|
public static String getTranslatedOracle(String name, String originaloracle) {
|
||||||
|
if (needsTranslation()) {
|
||||||
String toracle = translatedoracles.get(name);
|
String toracle = translatedoracles.get(name);
|
||||||
|
return toracle == null ? originaloracle : toracle;
|
||||||
if (toracle != null) {
|
|
||||||
if (GuiBase.getInterface().isLibgdxPort()) toracle = removeDiacritics(toracle);
|
|
||||||
} else {
|
|
||||||
toracle = originaloracle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return toracle;
|
return originaloracle;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean needsTranslation() {
|
private static boolean needsTranslation() {
|
||||||
|
|||||||
Reference in New Issue
Block a user