mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +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
|
||||
String chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\"!?'.,;:()[]{}<>|/@\\^$-%+=#_&*\u2014\u2022";
|
||||
chars += "ÁÉÍÓÚáéíóúÀÈÌÒÙàèìòùÑñÄËÏÖÜäëïöüẞß";
|
||||
|
||||
final PixmapPacker packer = new PixmapPacker(pageSize, pageSize, Pixmap.Format.RGBA8888, 2, false);
|
||||
final FreeTypeFontParameter parameter = new FreeTypeFontParameter();
|
||||
|
||||
@@ -2,14 +2,12 @@ package forge.card;
|
||||
|
||||
import com.esotericsoftware.minlog.Log;
|
||||
import com.google.common.base.Charsets;
|
||||
import forge.GuiBase;
|
||||
import forge.properties.ForgeConstants;
|
||||
import forge.properties.ForgePreferences;
|
||||
import forge.util.LineReader;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.text.Normalizer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -19,13 +17,6 @@ public class CardTranslation {
|
||||
private static Map <String, String> translatedtypes;
|
||||
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) {
|
||||
String filename = "cardnames-" + language + ".txt";
|
||||
|
||||
@@ -48,39 +39,30 @@ public class CardTranslation {
|
||||
}
|
||||
|
||||
public static String getTranslatedName(String name) {
|
||||
String tname = translatednames.get(name);
|
||||
|
||||
if (tname != null) {
|
||||
if (GuiBase.getInterface().isLibgdxPort()) tname = removeDiacritics(tname);
|
||||
} else {
|
||||
tname = name;
|
||||
if (needsTranslation()) {
|
||||
String tname = translatednames.get(name);
|
||||
return tname == null ? name : tname;
|
||||
}
|
||||
|
||||
return tname;
|
||||
return name;
|
||||
}
|
||||
|
||||
public static String getTranslatedType(String name, String originaltype) {
|
||||
String ttype = translatedtypes.get(name);
|
||||
|
||||
if (ttype != null) {
|
||||
if (GuiBase.getInterface().isLibgdxPort()) ttype = removeDiacritics(ttype);
|
||||
} else {
|
||||
ttype = originaltype;
|
||||
if (needsTranslation()) {
|
||||
String ttype = translatedtypes.get(name);
|
||||
return ttype == null ? originaltype : ttype;
|
||||
}
|
||||
|
||||
return ttype;
|
||||
return originaltype;
|
||||
}
|
||||
|
||||
public static String getTranslatedOracle(String name, String originaloracle) {
|
||||
String toracle = translatedoracles.get(name);
|
||||
|
||||
if (toracle != null) {
|
||||
if (GuiBase.getInterface().isLibgdxPort()) toracle = removeDiacritics(toracle);
|
||||
} else {
|
||||
toracle = originaloracle;
|
||||
if (needsTranslation()) {
|
||||
String toracle = translatedoracles.get(name);
|
||||
return toracle == null ? originaloracle : toracle;
|
||||
}
|
||||
|
||||
return toracle;
|
||||
return originaloracle;
|
||||
}
|
||||
|
||||
private static boolean needsTranslation() {
|
||||
|
||||
Reference in New Issue
Block a user