Changeset 18042 for release-kits


Ignore:
Timestamp:
2008-12-03T16:40:04+13:00 (15 years ago)
Author:
oranfry
Message:

force use of a UTF-8 font in uninstaller

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release-kits/shared/uninstaller/Uninstaller.java

    r18033 r18042  
    3030import javax.swing.SwingUtilities;
    3131
     32import java.util.Enumeration;
     33import java.awt.Font;
     34import javax.swing.plaf.FontUIResource;
     35import javax.swing.UIManager;
     36
     37
    3238
    3339public class Uninstaller {
     
    7177
    7278    public void go() {
     79
     80        //set font
     81        String new_default_font_str = null;
     82        if ( System.getProperty("os.name").equals("Linux") ) {
     83            new_default_font_str = "Bitstream Cyberbit";
     84        } else if ( System.getProperty("os.name").startsWith("Windows") ) {
     85            new_default_font_str = "Arial Unicode MS";
     86        }
     87
     88        if ( new_default_font_str != null ) {
     89
     90            FontUIResource default_font = new FontUIResource(new_default_font_str, Font.PLAIN, 12);
     91            Enumeration keys = UIManager.getDefaults().keys();
     92            while (keys.hasMoreElements()) {
     93                Object key = keys.nextElement();
     94                Object value = UIManager.get(key);
     95                if (value instanceof FontUIResource) {
     96                    UIManager.put(key, default_font);
     97                }
     98            }
     99
     100        }
     101
    73102
    74103        mainThread = Thread.currentThread();
Note: See TracChangeset for help on using the changeset viewer.