Java Code Examples for sun.awt.SunToolkit#getStartupLocale()

The following examples show how to use sun.awt.SunToolkit#getStartupLocale() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FontConfigManager.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 2
Source File: SunFontManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 3
Source File: SunFontManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 4
Source File: SunFontManager.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 5
Source File: FontConfigManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 6
Source File: SunFontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 7
Source File: SunFontManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 8
Source File: FontConfigManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 9
Source File: FontConfigManager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 10
Source File: SunFontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 11
Source File: FontConfigManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 12
Source File: FontConfigManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 13
Source File: FontConfigManager.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static String getFCLocaleStr() {
    Locale l = SunToolkit.getStartupLocale();
    String localeStr = l.getLanguage();
    String country = l.getCountry();
    if (!country.equals("")) {
        localeStr = localeStr + "-" + country;
    }
    return localeStr;
}
 
Example 14
Source File: SunFontManager.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private void resolveFontFiles(HashSet<String> unmappedFiles,
                              ArrayList<String> unmappedFonts) {

    Locale l = SunToolkit.getStartupLocale();

    for (String file : unmappedFiles) {
        try {
            int fn = 0;
            TrueTypeFont ttf;
            String fullPath = getPathName(file);
            if (FontUtilities.isLogging()) {
                FontUtilities.getLogger()
                               .info("Trying to resolve file " + fullPath);
            }
            do {
                ttf = new TrueTypeFont(fullPath, null, fn++, false);
                //  prefer the font's locale name.
                String fontName = ttf.getFontName(l).toLowerCase();
                if (unmappedFonts.contains(fontName)) {
                    fontToFileMap.put(fontName, file);
                    unmappedFonts.remove(fontName);
                    if (FontUtilities.isLogging()) {
                        FontUtilities.getLogger()
                              .info("Resolved absent registry entry for " +
                                    fontName + " located in " + fullPath);
                    }
                }
            }
            while (fn < ttf.getFontCount());
        } catch (Exception e) {
        }
    }
}
 
Example 15
Source File: X11InputMethodDescriptor.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * returns supported locale. Currently this method returns the locale in which
 * the VM is started since Solaris doesn't provide a way to determine the login locale.
 */
static Locale getSupportedLocale() {
    return SunToolkit.getStartupLocale();
}
 
Example 16
Source File: X11InputMethodDescriptor.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * returns supported locale. Currently this method returns the locale in which
 * the VM is started since Solaris doesn't provide a way to determine the login locale.
 */
static Locale getSupportedLocale() {
    return SunToolkit.getStartupLocale();
}
 
Example 17
Source File: X11InputMethodDescriptor.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * returns supported locale. Currently this method returns the locale in which
 * the VM is started since Solaris doesn't provide a way to determine the login locale.
 */
static Locale getSupportedLocale() {
    return SunToolkit.getStartupLocale();
}
 
Example 18
Source File: X11InputMethodDescriptor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * returns supported locale. Currently this method returns the locale in which
 * the VM is started since Solaris doesn't provide a way to determine the login locale.
 */
static Locale getSupportedLocale() {
    return SunToolkit.getStartupLocale();
}
 
Example 19
Source File: X11InputMethodDescriptor.java    From jdk8u_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * returns supported locale. Currently this method returns the locale in which
 * the VM is started since Solaris doesn't provide a way to determine the login locale.
 */
static Locale getSupportedLocale() {
    return SunToolkit.getStartupLocale();
}
 
Example 20
Source File: X11InputMethodDescriptor.java    From dragonwell8_jdk with GNU General Public License v2.0 2 votes vote down vote up
/**
 * returns supported locale. Currently this method returns the locale in which
 * the VM is started since Solaris doesn't provide a way to determine the login locale.
 */
static Locale getSupportedLocale() {
    return SunToolkit.getStartupLocale();
}