APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.font

public abstract Class SunFontManager

extends Object
implements FontSupport, FontManagerForSGE
Class Inheritance
All Implemented Interfaces
sun.font.FontManagerForSGE, sun.font.FontManager, sun.java2d.FontSupport
Known Direct Subclasses
sun.awt.FcFontManager
Imports
java.awt.Font, .FontFormatException, java.io.BufferedReader, .File, .FileInputStream, .FilenameFilter, .IOException, .InputStreamReader, java.util.ArrayList, .HashMap, .HashSet, .Hashtable, .List, .Locale, .Map, .NoSuchElementException, .StringTokenizer, .TreeMap, .Vector, java.util.concurrent.ConcurrentHashMap, javax.swing.plaf.FontUIResource, sun.awt.FontConfiguration, .SunToolkit, sun.awt.util.ThreadGroupUtils, sun.java2d.FontSupport, sun.util.logging.PlatformLogger

The base implementation of the FontManager interface. It implements the platform independent, shared parts of OpenJDK's FontManager implementations. The platform specific parts are declared as abstract methods that have to be implemented by specific implementations.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private String[]
private Font[]
private ArrayList<String>
protected static final int
private CompositeFont[]
private ConcurrentHashMap<String, CompositeFont>
private Hashtable<String, FontFamily>
private Hashtable<String, Font2D>
private int
private String
private String
private PhysicalFont
private final ConcurrentHashMap<String, SunFontManager.FontRegistrationInfo>
private boolean
private HashMap<String, ArrayList<String>>
pack-priv Thread
private static Font2DHandle
private FontConfiguration
protected FileFont[]
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private ConcurrentHashMap<String, Font2D>
protected String
private boolean
private HashMap<String, String>
private HashMap<String, String>
protected ConcurrentHashMap<String, Font2D>
private static boolean
private boolean
private boolean
private boolean
private final ConcurrentHashMap<String, Font2DHandle>
private static HashSet<String>
public static String
public static String
pack-priv String[]
private Locale
private int
private boolean
pack-priv boolean
pack-priv boolean
private HashMap<String, TrueTypeFont>
pack-priv static boolean
private int
private static int
private static HashSet<String>
pack-priv boolean
public static boolean
private String[]
private ConcurrentHashMap<String, PhysicalFont>
pack-priv static volatile HashMap<String, SunFontManager.FamilyDescription>
private static final Object
protected HashSet<String>
private ConcurrentHashMap<String, PhysicalFont>
private static String[]
private static Locale
systemLocale

Default locale can be changed but we need to know the initial locale as that is what is used by native code.

private static final FilenameFilter
pack-priv Vector<File>
private static final FilenameFilter

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private void
private void
addDirFonts(String dirName, File dirFile, FilenameFilter filter, int fontFormat, boolean useJavaRasterizer, int fontRank, boolean defer, boolean resolveSymLinks)

protected void
addFontToPlatformFontPath(String platformFontName)

Notifies graphics environment that the logical font configuration uses the given platform font name.

protected void
addNativeFontFamilyNames(TreeMap<String, String> familyNames, Locale requestedLocale)

protected PhysicalFont
protected void
pack-priv void
private synchronized void
checkForUnreferencedFontFiles()

In some cases windows may have fonts in the fonts folder that don't show up in the registry or in the GDI calls to enumerate fonts.

public void
createCompositeFonts(ConcurrentHashMap<String, Font2D> altNameCache, boolean preferLocale, boolean preferProportional)

public Font2D[]
createFont2D(File fontFile, int fontFormat, boolean all, boolean isCopy)

Implements sun.font.FontManager.createFont2D.

Creates a Font2D for the specified font file, that is expected to be in the specified font format (according to the constants in java.awt.Font).

protected abstract FontConfiguration
createFontConfiguration()

Creates this environment's FontConfiguration.

public abstract FontConfiguration
createFontConfiguration(boolean preferLocaleFonts, boolean preferPropFonts)

public synchronized void
private static String
dotStyleStr(int num)

private PhysicalFont
findDeferredFont(String name, int style)

public Font2D
findFont2D(String name, int style, int fallback)

Implements sun.font.FontManager.findFont2D.

The client supplies a name and a style.

private Font2D
findFont2DAllLocales(String name, int style)

private Font2D
findFontFromPlatform(String lcName, int style)

pack-priv Font2D
findFontFromPlatformMap(String lcName, int style)

pack-priv PhysicalFont
findJREDeferredFont(String name, int style)

private PhysicalFont
findOtherDeferredFont(String name, int style)

private static boolean
public Font[]
getAllInstalledFonts()

Implements sun.font.FontManagerForSGE.getAllInstalledFonts.

Returns all fonts installed in this environment.

public TreeMap<String, String>
getCreatedFontFamilyNames()

Implements sun.font.FontManagerForSGE.getCreatedFontFamilyNames.

Similar to getCreatedFonts, but returns a TreeMap of fonts by family name.

public Font[]
getCreatedFonts()

Implements sun.font.FontManagerForSGE.getCreatedFonts.

Return an array of created Fonts, or null, if no fonts were created yet.

public synchronized String
getDefaultFontFaceName()

Returns face name for default font, or null if no face names are used for CompositeFontDescriptors for this platform.

public synchronized String
getDefaultFontFile()

Returns file name for default font, either absolute or relative as needed by registerFontFile.

public Font2D
public PhysicalFont
protected abstract String[]
getDefaultPlatformFont()

Returns an array of two strings.

public TrueTypeFont
public boolean
getFamilyNamesFromPlatform(TreeMap<String, String> familyNames, Locale requestedLocale)

public String
protected String
getFileNameFromPlatformName(String platformFontName)

Returns a file name for the physical font represented by this platform font name.

protected FontUIResource
getFontConfigFUIR(String family, int style, int size)

public FontConfiguration
getFontConfiguration()

Implements sun.java2d.FontSupport.getFontConfiguration.

Return the default font configuration.

private String[]
getFontFilesFromPath(boolean noType1)

protected String[]
protected abstract String
getFontPath(boolean noType1Fonts)

public synchronized String
private synchronized HashMap<String, String>
public String[]

Returns:

list of installed fonts in the system.
getInstalledFontFamilyNames
(Locale requestedLocale)

Implements sun.font.FontManagerForSGE.getInstalledFontFamilyNames.

Get a list of installed fonts in the requested Locale.

private static HashSet<String>
public static SunFontManager

Returns:

the global SunFontManager instance
getInstance
()

Returns the global SunFontManager instance.

public static final String
getJDKFontDir()

If the module image layout changes the location of JDK fonts, this will be updated to reflect that.

protected void
getJREFontFamilyNames(TreeMap<String, String> familyNames, Locale requestedLocale)

protected String[]
getNativeNames(String fontFileName, String platformName)

public Font2DHandle
getNewComposite(String family, int style, Font2DHandle handle)

Implements sun.font.FontManager.getNewComposite.

Creates a derived composite font from the specified font (handle).

public int
private String
protected PhysicalFont[]
protected String[]
getPlatformFontDirs(boolean noType1Fonts)

public String
getPlatformFontPath(boolean noType1Font)

public PhysicalFont
public Font2D[]
private static Locale
public FilenameFilter
public FilenameFilter
public boolean
private void
public synchronized PhysicalFont
protected synchronized void
private static native void
private static void
public boolean
private boolean
public boolean
public void
protected void
private synchronized void
private void
protected void
populateFontFileNameMap(HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap, Locale locale)

public HashMap<String, SunFontManager.FamilyDescription>
populateHardcodedFileNameMap()

default implementation does nothing.

public synchronized void
preferLocaleFonts()

Implements sun.font.FontManager.preferLocaleFonts.

Indicates a preference for locale-specific fonts in the mapping of logical fonts to physical fonts.

public synchronized void
preferProportionalFonts()

Implements sun.font.FontManager.preferProportionalFonts.

preferLocaleFonts() and preferProportionalFonts() are called to inform that the application could be using an alternate set of composite fonts, and so the implementation should try to create a CompositeFonts with this directive in mind.

public void
protected void
registerCompositeFont(String compositeName, String[] componentFileNames, String[] componentNames, int numMetricsSlots, int[] exclusionRanges, int[] exclusionMaxIndex, boolean defer)

protected static void
registerCompositeFont(String compositeName, String[] componentFileNames, String[] componentNames, int numMetricsSlots, int[] exclusionRanges, int[] exclusionMaxIndex, boolean defer, ConcurrentHashMap<String, Font2D> altNameCache)

public void
registerDeferredFont(String fileNameKey, String fullPathName, String[] nativeNames, int fontFormat, boolean useJavaRasterizer, int fontRank)

protected synchronized void
public boolean
registerFont(Font font)

Implements sun.font.FontManager.registerFont.

Register a new font.

protected void
protected void
public PhysicalFont
registerFontFile(String fileName, String[] nativeNames, int fontFormat, boolean useJavaRasterizer, int fontRank)

private PhysicalFont
protected void
registerFontFile(String fontFileName, String[] nativeNames, int fontRank, boolean defer)

public void
registerFonts(String[] fileNames, String[][] nativeNames, int fontCount, int fontFormat, boolean useJavaRasterizer, int fontRank, boolean defer)

public void
protected void
registerFontsInDir(String dirName, boolean useJavaRasterizer, int fontRank, boolean defer, boolean resolveSymLinks)

private void
registerFontsOnPath(String pathName, boolean useJavaRasterizer, int fontRank, boolean defer, boolean resolveSymLinks)

protected void
registerOtherFontFiles(HashSet<String> registeredFontFiles)

protected void
private void
public synchronized void
private void
resolveFontFiles(HashSet<String> unmappedFiles, ArrayList<String> unmappedFonts)

private void
protected boolean
useAbsoluteFontFileNames()

Whether registerFontFile expects absolute or relative font file names.

public synchronized void
public boolean
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait