sun.awt.FontConfiguration Java Examples

The following examples show how to use sun.awt.FontConfiguration. 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: SunFontManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferProportionalFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger()
            .info("Entered preferProportionalFonts().");
    }
    /* If no proportional fonts are configured, there's no need
     * to take any action.
     */
    if (!FontConfiguration.hasMonoToPropMap()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gPropPref == true) {
            return;
        }
        gPropPref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(proportionalFontKey) == proportionalFontKey) {
            return;
        }
        appContext.put(proportionalFontKey, proportionalFontKey);
        boolean acLocalePref =
            appContext.get(localeFontKey) == localeFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, acLocalePref, true);
    }
}
 
Example #2
Source File: SunFontManager.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferProportionalFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger()
            .info("Entered preferProportionalFonts().");
    }
    /* If no proportional fonts are configured, there's no need
     * to take any action.
     */
    if (!FontConfiguration.hasMonoToPropMap()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gPropPref == true) {
            return;
        }
        gPropPref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(proportionalFontKey) == proportionalFontKey) {
            return;
        }
        appContext.put(proportionalFontKey, proportionalFontKey);
        boolean acLocalePref =
            appContext.get(localeFontKey) == localeFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, acLocalePref, true);
    }
}
 
Example #3
Source File: SunFontManager.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #4
Source File: SunFontManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #5
Source File: SunFontManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void
    createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache,
                         boolean preferLocale,
                         boolean preferProportional) {

    FontConfiguration fontConfig =
        createFontConfiguration(preferLocale, preferProportional);
    initCompositeFonts(fontConfig, altNameCache);
}
 
Example #6
Source File: CompileFontConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
CompileFontConfig(String inFile, String outFile, boolean verbose) {
    try {
        FileInputStream in = new FileInputStream(inFile);
        FileOutputStream out = new FileOutputStream(outFile);
        FontConfiguration.verbose = verbose;
        FontConfiguration.loadProperties(in);
        FontConfiguration.saveBinary(out);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example #7
Source File: SunFontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #8
Source File: SunFontManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferProportionalFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger()
            .info("Entered preferProportionalFonts().");
    }
    /* If no proportional fonts are configured, there's no need
     * to take any action.
     */
    if (!FontConfiguration.hasMonoToPropMap()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gPropPref == true) {
            return;
        }
        gPropPref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(proportionalFontKey) == proportionalFontKey) {
            return;
        }
        appContext.put(proportionalFontKey, proportionalFontKey);
        boolean acLocalePref =
            appContext.get(localeFontKey) == localeFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, acLocalePref, true);
    }
}
 
Example #9
Source File: SunFontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #10
Source File: SunFontManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #11
Source File: CompileFontConfig.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
CompileFontConfig(String inFile, String outFile, boolean verbose) {
    try {
        FileInputStream in = new FileInputStream(inFile);
        FileOutputStream out = new FileOutputStream(outFile);
        FontConfiguration.verbose = verbose;
        FontConfiguration.loadProperties(in);
        FontConfiguration.saveBinary(out);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example #12
Source File: SunFontManager.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }
    if (gLocalePref == true) {
        return;
    }
    gLocalePref = true;
    createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
    _usingAlternateComposites = true;
}
 
Example #13
Source File: SunFontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void
    createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache,
                         boolean preferLocale,
                         boolean preferProportional) {

    FontConfiguration fontConfig =
        createFontConfiguration(preferLocale, preferProportional);
    initCompositeFonts(fontConfig, altNameCache);
}
 
Example #14
Source File: SunFontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void
    createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache,
                         boolean preferLocale,
                         boolean preferProportional) {

    FontConfiguration fontConfig =
        createFontConfiguration(preferLocale, preferProportional);
    initCompositeFonts(fontConfig, altNameCache);
}
 
Example #15
Source File: SunFontManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void
    createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache,
                         boolean preferLocale,
                         boolean preferProportional) {

    FontConfiguration fontConfig =
        createFontConfiguration(preferLocale, preferProportional);
    initCompositeFonts(fontConfig, altNameCache);
}
 
Example #16
Source File: SunFontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #17
Source File: SunFontManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferProportionalFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger()
            .info("Entered preferProportionalFonts().");
    }
    /* If no proportional fonts are configured, there's no need
     * to take any action.
     */
    if (!FontConfiguration.hasMonoToPropMap()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gPropPref == true) {
            return;
        }
        gPropPref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(proportionalFontKey) == proportionalFontKey) {
            return;
        }
        appContext.put(proportionalFontKey, proportionalFontKey);
        boolean acLocalePref =
            appContext.get(localeFontKey) == localeFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, acLocalePref, true);
    }
}
 
Example #18
Source File: SunFontManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void
    createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache,
                         boolean preferLocale,
                         boolean preferProportional) {

    FontConfiguration fontConfig =
        createFontConfiguration(preferLocale, preferProportional);
    initCompositeFonts(fontConfig, altNameCache);
}
 
Example #19
Source File: SunFontManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #20
Source File: SunFontManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #21
Source File: SunFontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #22
Source File: CompileFontConfig.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
CompileFontConfig(String inFile, String outFile, boolean verbose) {
    try {
        FileInputStream in = new FileInputStream(inFile);
        FileOutputStream out = new FileOutputStream(outFile);
        FontConfiguration.verbose = verbose;
        FontConfiguration.loadProperties(in);
        FontConfiguration.saveBinary(out);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example #23
Source File: SunFontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void
    createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache,
                         boolean preferLocale,
                         boolean preferProportional) {

    FontConfiguration fontConfig =
        createFontConfiguration(preferLocale, preferProportional);
    initCompositeFonts(fontConfig, altNameCache);
}
 
Example #24
Source File: SunFontManager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public synchronized void preferLocaleFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger().info("Entered preferLocaleFonts().");
    }
    /* Test if re-ordering will have any effect */
    if (!FontConfiguration.willReorderForStartupLocale()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gLocalePref == true) {
            return;
        }
        gLocalePref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(localeFontKey) == localeFontKey) {
            return;
        }
        appContext.put(localeFontKey, localeFontKey);
        boolean acPropPref =
            appContext.get(proportionalFontKey) == proportionalFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, true, acPropPref);
    }
}
 
Example #25
Source File: SunFontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return the default font configuration.
 */
public FontConfiguration getFontConfiguration() {
    return fontConfig;
}
 
Example #26
Source File: CFontManager.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
public FontConfiguration createFontConfiguration(boolean preferLocaleFonts,
                                                 boolean preferPropFonts)
{
    return new CFontConfiguration(this, preferLocaleFonts, preferPropFonts);
}
 
Example #27
Source File: PSPrinterJob.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
* Given an array of CharsetStrings that make up a run
* of text, this routine converts each CharsetString to
* an index into our PostScript font list. If one or more
* CharsetStrings can not be represented by a PostScript
* font, then this routine will return a null array.
*/
private int[] getPSFontIndexArray(Font font, CharsetString[] charSet) {
   int[] psFont = null;

   if (mFontProps != null) {
       psFont = new int[charSet.length];
   }

   for (int i = 0; i < charSet.length && psFont != null; i++){

       /* Get the encoding of the run of text.
        */
       CharsetString cs = charSet[i];

       CharsetEncoder fontCS = cs.fontDescriptor.encoder;
       String charsetName = cs.fontDescriptor.getFontCharsetName();
       /*
        * sun.awt.Symbol perhaps should return "symbol" for encoding.
        * Similarly X11Dingbats should return "dingbats"
        * Forced to check for win32 & x/unix names for these converters.
        */

       if ("Symbol".equals(charsetName)) {
           charsetName = "symbol";
       } else if ("WingDings".equals(charsetName) ||
                  "X11Dingbats".equals(charsetName)) {
           charsetName = "dingbats";
       } else {
           charsetName = makeCharsetName(charsetName, cs.charsetChars);
       }

       int styleMask = font.getStyle() |
           FontUtilities.getFont2D(font).getStyle();

       String style = FontConfiguration.getStyleString(styleMask);

       /* First we map the font name through the properties file.
        * This mapping provides alias names for fonts, for example,
        * "timesroman" is mapped to "serif".
        */
       String fontName = font.getFamily().toLowerCase(Locale.ENGLISH);
       fontName = fontName.replace(' ', '_');
       String name = mFontProps.getProperty(fontName, "");

       /* Now map the alias name, character set name, and style
        * to a PostScript name.
        */
       String psName =
           mFontProps.getProperty(name + "." + charsetName + "." + style,
                                 null);

       if (psName != null) {

           /* Get the PostScript font index for the PostScript font.
            */
           try {
               psFont[i] =
                   Integer.parseInt(mFontProps.getProperty(psName));

           /* If there is no PostScript font for this font name,
            * then we want to termintate the loop and the method
            * indicating our failure. Setting the array to null
            * is used to indicate these failures.
            */
           } catch(NumberFormatException e){
               psFont = null;
           }

       /* There was no PostScript name for the font, character set,
        * and style so give up.
        */
       } else {
           psFont = null;
       }
   }

    return psFont;
}
 
Example #28
Source File: SunFontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public abstract FontConfiguration
createFontConfiguration(boolean preferLocaleFonts,
                        boolean preferPropFonts);
 
Example #29
Source File: SunFontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Return the default font configuration.
 */
public FontConfiguration getFontConfiguration() {
    return fontConfig;
}
 
Example #30
Source File: CFontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected FontConfiguration createFontConfiguration() {
    FontConfiguration fc = new CFontConfiguration(this);
    fc.init();
    return fc;
}