Add two override fonts to cover the Gujarati and Oriya/Odia scripts.

Add code to select these fonts in preference to DejaVu based on the
language code.  This fixes bug 699.
This commit is contained in:
Ross Combs 2014-06-13 17:22:38 +02:00 committed by kelson42
parent 4c703d108f
commit cf5e77de78
3 changed files with 8 additions and 0 deletions

Binary file not shown.

BIN
assets/fonts/Lohit-Odia.ttf Normal file

Binary file not shown.

View File

@ -253,7 +253,15 @@ public class LanguageUtils {
// Define the exceptions to the rule. The font has to be placed in the assets folder.
// Key: the language code; Value: the name of the font.
HashMap<String, String> exceptions = new HashMap<String, String>();
exceptions.put("gu", "fonts/Lohit-Gujarati.ttf");
exceptions.put("my", "fonts/Parabaik.ttf");
exceptions.put("or", "fonts/Lohit-Odia.ttf");
// These scripts could be supported via more Lohit fonts if DevaVu doesn't
// support them. That is untested now as they aren't even in the language
// menu:
// * (no ISO code?) (Devanagari/Nagari) -- at 0% in translatewiki
// * mr (Marathi) -- at 21% in translatewiki
// * pa (Punjabi) -- at 3% in translatewiki
// Check, if an exception applies to our current locale
if (exceptions.containsKey(Locale.getDefault().getLanguage())) {