Changeset 8099 in josm


Ignore:
Timestamp:
2015-02-22T23:04:55+01:00 (10 years ago)
Author:
Don-vip
Message:

see #10989 - add support for more languages on recent version of Windows:

  • Yi, 2m (ii, Win Vista)
  • Tai Lü, 700k (khb, Win 7)
  • Lisu, 940k (lis, Win 8)
  • Buginese, 5m (bug, Win 8.1)
  • Javanese, 82m (jav, Win 8.1)
  • Santali, 6m (sat, Win 8.1: Ol Chiki script)
  • Sora, 250k (srb, Win 8.1: Sora Sompeng script)

+ fix potential NPE, improve javadoc

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r8073 r8099  
    447447
    448448    /**
    449      * Add more fallback fonts to the Java runtime, in order to get
    450      * support for more scripts.
    451      *
    452      * The font configuration in Java doesn't include some Indic scripts,
     449     * <p>Add more fallback fonts to the Java runtime, in order to get
     450     * support for more scripts.</p>
     451     *
     452     * <p>The font configuration in Java doesn't include some Indic scripts,
    453453     * even though MS Windows ships with fonts that cover these unicode
    454      * ranges.
    455      *
    456      * To fix this, the fontconfig.properties template is copied to the JOSM
     454     * ranges.</p>
     455     *
     456     * <p>To fix this, the fontconfig.properties template is copied to the JOSM
    457457     * cache folder. Then, the additional entries are added to the font
    458458     * configuration. Finally the system property "sun.awt.fontconfig" is set
    459      * to the customized fontconfig.properties file.
    460      *
    461      * This is a crude hack, but better than no font display at all for these
     459     * to the customized fontconfig.properties file.</p>
     460     *
     461     * <p>This is a crude hack, but better than no font display at all for these
    462462     * languages.
    463463     * There is no guarantee, that the template file
     
    465465     * configuration (which is in a binary format).
    466466     * Furthermore, the system property "sun.awt.fontconfig" is undocumented and
    467      * may no longer work in future versions of Java.
     467     * may no longer work in future versions of Java.</p>
     468     *
     469     * <p>Related Java bug: <a href="https://bugs.openjdk.java.net/browse/JDK-8008572">JDK-8008572</a></p>
    468470     *
    469471     * @param templateFileName file name of the fontconfig.properties template file
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r8015 r8099  
    320320                fontsAvail.add(p.getFileName().toString().toUpperCase());
    321321            }
     322            fontsAvail.add(""); // for devanagari
    322323        } catch (IOException ex) {
     324            Main.error(ex, false);
    323325            Main.warn("extended font config - failed to load available Fonts");
    324326            fontsAvail = null;
    325327        }
    326         fontsAvail.add(""); // for devanagari
    327328        return fontsAvail;
    328329    }
     
    333334        def.add(new FontEntry("devanagari", "", "")); // just include in fallback list
    334335                                                      // font already defined in template
    335         // Win 8 (and later)
    336         def.add(new FontEntry("myanmar", "Myanmar Text", "MMRTEXT.TTF"));           // ISO 639: my
    337 
    338         // Win 7 and later
    339         def.add(new FontEntry("nko_tifinagh_vai_osmanya", "Ebrima", "EBRIMA.TTF")); // ISO 639: ber
    340         def.add(new FontEntry("khmer1", "Khmer UI", "KHMERUI.TTF"));                // ISO 639: km
    341         def.add(new FontEntry("lao1", "Lao UI", "LAOUI.TTF"));                      // ISO 639: lo
    342 
    343         // Win Vista and later:
     336
     337        // Windows scripts: https://msdn.microsoft.com/en-us/goglobal/bb688099.aspx
     338        // IE default fonts: https://msdn.microsoft.com/en-us/library/ie/dn467844(v=vs.85).aspx
     339
     340        // Windows 8/8.1 and later
     341        def.add(new FontEntry("javanese", "Javanese Text", "JAVATEXT.TTF"));           // ISO 639: jv
     342        def.add(new FontEntry("leelawadee", "Leelawadee", "LEELAWAD.TTF"));            // ISO 639: bug
     343        def.add(new FontEntry("myanmar", "Myanmar Text", "MMRTEXT.TTF"));              // ISO 639: my
     344        def.add(new FontEntry("nirmala", "Nirmala UI", "NIRMALA.TTF"));                // ISO 639: sat,srb
     345        def.add(new FontEntry("segoeui", "Segoe UI", "SEGOEUI.TTF"));                  // ISO 639: lis
     346
     347        // Windows 7 and later
     348        def.add(new FontEntry("nko_tifinagh_vai_osmanya", "Ebrima", "EBRIMA.TTF"));    // ISO 639: ber. Nko only since Win 8
     349        def.add(new FontEntry("khmer1", "Khmer UI", "KHMERUI.TTF"));                   // ISO 639: km
     350        def.add(new FontEntry("lao1", "Lao UI", "LAOUI.TTF"));                         // ISO 639: lo
     351        def.add(new FontEntry("tai_le", "Microsoft Tai Le", "TAILE.TTF"));             // ISO 639: khb
     352        def.add(new FontEntry("new_tai_lue", "Microsoft New Tai Lue", "NTHAILU.TTF")); // ISO 639: khb
     353
     354        // Windows Vista and later:
    344355        def.add(new FontEntry("ethiopic", "Nyala", "NYALA.TTF"));                   // ISO 639: am,gez,ti
    345356        def.add(new FontEntry("tibetan", "Microsoft Himalaya", "HIMALAYA.TTF"));    // ISO 639: bo,dz
     
    352363        def.add(new FontEntry("oriya", "Kalinga", "KALINGA.TTF"));                  // ISO 639: or
    353364        def.add(new FontEntry("sinhala", "Iskoola Pota", "ISKPOTA.TTF"));           // ISO 639: si
    354 
    355         // Win XP and later
     365        def.add(new FontEntry("yi", "Yi Baiti", "MSYI.TTF"));                       // ISO 639: ii
     366
     367        // Windows XP and later
    356368        def.add(new FontEntry("gujarati", "Shruti", "SHRUTI.TTF"));
    357369        def.add(new FontEntry("kannada", "Tunga", "TUNGA.TTF"));
    358         def.add(new FontEntry("gurmuhi", "Raavi", "RAAVI.TTF"));
    359         def.add(new FontEntry("tamil", "Latha", "LATHA.TTF"));
     370        def.add(new FontEntry("gurmukhi", "Raavi", "RAAVI.TTF"));
    360371        def.add(new FontEntry("telugu", "Gautami", "GAUTAMI.TTF"));
    361         def.add(new FontEntry("bengali", "Vrinda", "VRINDA.TTF"));
     372        def.add(new FontEntry("bengali", "Vrinda", "VRINDA.TTF"));                  // since XP SP2
    362373        def.add(new FontEntry("syriac", "Estrangelo Edessa", "ESTRE.TTF"));         // ISO 639: arc
    363374        def.add(new FontEntry("thaana", "MV Boli", "MVBOLI.TTF"));                  // ISO 639: dv
    364375        def.add(new FontEntry("malayalam", "Kartika", "KARTIKA.TTF"));              // ISO 639: ml; since XP SP2
    365376
     377        // Windows 2000 and later
     378        def.add(new FontEntry("tamil", "Latha", "LATHA.TTF"));
     379
    366380        // Comes with MS Office & Outlook 2000. Good unicode coverage, so add if available.
    367381        def.add(new FontEntry("arialuni", "Arial Unicode MS", "ARIALUNI.TTF"));
     
    369383        return def;
    370384    }
    371 
    372385}
Note: See TracChangeset for help on using the changeset viewer.