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); } }
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); } }
public void createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache, boolean preferLocale, boolean preferProportional) { FontConfiguration fontConfig = createFontConfiguration(preferLocale, preferProportional); initCompositeFonts(fontConfig, altNameCache); }
public synchronized void preferLocaleFonts() { if (FontUtilities.isLogging()) { FontUtilities.getLogger().info("Entered preferLocaleFonts()."); } /* Test if re-ordering will have any effect */ if (!FontConfiguration.willReorderForStartupLocale()) { return; } }
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(); } }