Top Inners Fields Constructors Methods
com.sun.javafx.font

public abstract Class PrismFontFactory

extends Object
implements FontFactory
Class Inheritance
All Implemented Interfaces
com.sun.javafx.font.FontFactory
Known Direct Subclasses
com.sun.javafx.font.coretext.CTFactory, com.sun.javafx.font.directwrite.DWFactory, com.sun.javafx.font.freetype.FTFactory
Imports
java.io.File, .FilenameFilter, .InputStream, java.lang.ref.WeakReference, java.lang.reflect.Method, java.util.ArrayList, .Collections, .HashMap, .HashSet, .Iterator, .Locale, com.sun.glass.ui.Screen, com.sun.glass.utils.NativeLibLoader, com.sun.javafx.PlatformUtil, com.sun.javafx.text.GlyphLayout

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static ArrayList<String>
private static ArrayList<String>
public static final int
pack-priv HashMap<String, CompositeFontResource>
private static final String
public static final boolean
private static final String
private HashMap<String, PrismFontFile>
private HashMap<String, ArrayList<String>>
private static Thread
private HashMap<String, PrismFontFile>
private HashMap<String, String>
pack-priv HashMap<String, FontResource>
private static float
private HashMap<String, String>
private volatile HashMap<String, String>
private static final String
public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final boolean
private static final String
private static final String
private static final String
private static String
private static float
private static boolean
private static String
private int
private static final String[]
public static final int
public static final int
public static final int
private static int
private static String
private static String
private static float
private static PrismFontFactory
private ArrayList<WeakReference<PrismFontFile>>
private static String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized void
private synchronized void
private synchronized void
pack-priv void
public synchronized PGFont
createFont(String familyName, boolean bold, boolean italic, float size)

Implements com.sun.javafx.font.FontFactory.createFont.

public synchronized PGFont
protected abstract PrismFontFile
createFontFile(String name, String filename, int fIndex, boolean register, boolean embedded, boolean copy, boolean tracked)

private PrismFontFile
createFontResource(String filename, int index)

private PrismFontFile
createFontResource(String name, String filename, int index, boolean register, boolean embedded, boolean copy, boolean tracked)

private PrismFontFile
private PrismFontFile[]
createFontResources(String name, String filename, boolean register, boolean embedded, boolean copy, boolean tracked, boolean loadAll)

public abstract GlyphLayout
public synchronized PGFont
deriveFont(PGFont
the original font.
font
,
boolean
the bold style for the new font.
bold
,
boolean
the italic style fort the new font.
italic
,
float
the size for the new font.
size
)

Implements com.sun.javafx.font.FontFactory.deriveFont.

Creates a new Font object by replicating the current Font object and applying a new bold style, italic style, and size to it.

private String
dotStyleStr(boolean bold, boolean italic)

private String
public int
findFontIndex(String targetName, String filename)

pack-priv FontResource
getDefaultFontResource(boolean wantComp)

public abstract FontFallbackInfo
getFallbacks(FontResource primaryResource)

public static synchronized PrismFontFactory
private static synchronized PrismFontFactory
getFontFactory(String factoryClass)

public String[]
public String[]
public String[]
private static native String
public synchronized FontResource
getFontResource(String familyName, boolean bold, boolean italic, boolean wantComp)

private PrismFontFile
public synchronized FontResource
getFontResource(String name, String file, boolean wantComp)

private synchronized FontResource
getFontResourceByFileName(String file, boolean wantComp)

private synchronized FontResource
getFontResourceByFullName(String name, boolean wantComp)

public static float
private synchronized HashMap<String, String>
private static String
public static float
pack-priv static native int
private static String
protected static String
getPathNameWindows(final String filename)

private static void
public final int
public static String
private static native String
public static float
private static native float
pack-priv static native short
public boolean
public static boolean
public boolean
public boolean
public PGFont[]
loadEmbeddedFont(String
the name for font, it can be null.
name
,
InputStream
the stream from which to load the font.
fontStream
,
float
the size for the font.
size
,
boolean
whether the font should be register.
register
,
boolean
whether to load all fonts from a TTC
loadAll
)

Implements com.sun.javafx.font.FontFactory.loadEmbeddedFont.

Loads a font from the specified input stream.

public PGFont[]

Returns:

font name extracted from font file
loadEmbeddedFont
(String
font name
name
,
String
Path name to system file
path
,
float
font size
size
,
boolean
whether the font should be registered.
register
,
boolean
whether to load all fonts if it is a TTC
loadAll
)

Implements com.sun.javafx.font.FontFactory.loadEmbeddedFont.

registerEmbeddedFont(String name, String path) is a small subset of registerEmbeddedFont(String name, InputStream fontStream) It does not attempt to create a temporary file and has different parameters.

private synchronized PrismFontFile[]
loadEmbeddedFont1(String name, String path, boolean register, boolean copy, boolean tracked, boolean loadAll)

private void
logFontInfo(String message, HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap)

private FontResource
lookupResource(String lcName, boolean wantComp)

pack-priv static native void
populateFontFileNameMap(HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap, Locale locale)

pack-priv void
protected boolean
private void
pack-priv synchronized void
private void
resolveFontFiles(HashSet<String> unmappedFiles, ArrayList<String> unmappedFonts, HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap)

private void
resolveWindowsFonts(HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap)

protected void
storeInMap(String name, FontResource resource)

public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allFamilyNamesback to summary
private static ArrayList<String> allFamilyNames
allFontNamesback to summary
private static ArrayList<String> allFontNames
cacheLayoutSizeback to summary
public static final int cacheLayoutSize
compResourceMapback to summary
pack-priv HashMap<String, CompositeFontResource> compResourceMap
CT_FACTORYback to summary
private static final String CT_FACTORY
debugFontsback to summary
public static final boolean debugFonts
DW_FACTORYback to summary
private static final String DW_FACTORY
embeddedFontsback to summary
private HashMap<String, PrismFontFile> embeddedFonts
familyToFontListMapback to summary
private HashMap<String, ArrayList<String>> familyToFontListMap
fileCloserback to summary
private static Thread fileCloser
fileNameToFontResourceMapback to summary
private HashMap<String, PrismFontFile> fileNameToFontResourceMap
fileToFontMapback to summary
private HashMap<String, String> fileToFontMap
fontResourceMapback to summary
pack-priv HashMap<String, FontResource> fontResourceMap
fontSizeLimitback to summary
private static float fontSizeLimit
fontToFamilyNameMapback to summary
private HashMap<String, String> fontToFamilyNameMap
fontToFileMapback to summary
private volatile HashMap<String, String> fontToFileMap
FT_FACTORYback to summary
private static final String FT_FACTORY
isAndroidback to summary
public static final boolean isAndroid
isEmbeddedback to summary
public static final boolean isEmbedded
isIOSback to summary
public static final boolean isIOS
isLinuxback to summary
public static final boolean isLinux
isMacOSXback to summary
public static final boolean isMacOSX
isWindowsback to summary
public static final boolean isWindows
jreDefaultFontback to summary
private static final String jreDefaultFont
jreDefaultFontFileback to summary
private static final String jreDefaultFontFile
jreDefaultFontLCback to summary
private static final String jreDefaultFontLC
jreFontDirback to summary
private static String jreFontDir
lcdContrastback to summary
private static float lcdContrast
lcdEnabledback to summary
private static boolean lcdEnabled
monospaceFontFamilyback to summary
private static String monospaceFontFamily
numEmbeddedFontsback to summary
private int numEmbeddedFonts
STR_ARRAYback to summary
private static final String[] STR_ARRAY
SUB_PIXEL_NATIVEback to summary
public static final int SUB_PIXEL_NATIVE
SUB_PIXEL_ONback to summary
public static final int SUB_PIXEL_ON
SUB_PIXEL_Yback to summary
public static final int SUB_PIXEL_Y
subPixelModeback to summary
private static int subPixelMode
sysFontDirback to summary
private static String sysFontDir
systemFontFamilyback to summary
private static String systemFontFamily
systemFontSizeback to summary
private static float systemFontSize
theFontFactoryback to summary
private static PrismFontFactory theFontFactory
tmpFontsback to summary
private ArrayList<WeakReference<PrismFontFile>> tmpFonts
userFontDirback to summary
private static String userFontDir

Constructor Detail

PrismFontFactoryback to summary
public PrismFontFactory()

Method Detail

addDecodedFontback to summary
pack-priv synchronized void addDecodedFont(PrismFontFile fr)
addFileCloserHookback to summary
private synchronized void addFileCloserHook()
addTmpFontback to summary
private synchronized void addTmpFont(PrismFontFile fr)
addToMapsback to summary
pack-priv void addToMaps(PrismFontFile fr)
createFontback to summary
public synchronized PGFont createFont(String familyName, boolean bold, boolean italic, float size)

Implements com.sun.javafx.font.FontFactory.createFont.

Annotations
@Override
createFontback to summary
public synchronized PGFont createFont(String name, float size)

Implements com.sun.javafx.font.FontFactory.createFont.

Annotations
@Override
createFontFileback to summary
protected abstract PrismFontFile createFontFile(String name, String filename, int fIndex, boolean register, boolean embedded, boolean copy, boolean tracked) throws Exception
createFontResourceback to summary
private PrismFontFile createFontResource(String filename, int index)
createFontResourceback to summary
private PrismFontFile createFontResource(String name, String filename, int index, boolean register, boolean embedded, boolean copy, boolean tracked)
createFontResourceback to summary
private PrismFontFile createFontResource(String name, String filename)
createFontResourcesback to summary
private PrismFontFile[] createFontResources(String name, String filename, boolean register, boolean embedded, boolean copy, boolean tracked, boolean loadAll)
createGlyphLayoutback to summary
public abstract GlyphLayout createGlyphLayout()
deriveFontback to summary
public synchronized PGFont deriveFont(PGFont font, boolean bold, boolean italic, float size)

Implements com.sun.javafx.font.FontFactory.deriveFont.

Doc from com.sun.javafx.font.FontFactory.deriveFont.

Creates a new Font object by replicating the current Font object and applying a new bold style, italic style, and size to it.

Note

bold and italic are hints.

Parameters
font:PGFont

the original font.

bold:boolean

the bold style for the new font.

italic:boolean

the italic style fort the new font.

size:float

the size for the new font.

Returns:PGFont

the new font.

Annotations
@Override
dotStyleStrback to summary
private String dotStyleStr(boolean bold, boolean italic)
findFileback to summary
private String findFile(String name)
findFontIndexback to summary
public int findFontIndex(String targetName, String filename)
getDefaultFontResourceback to summary
pack-priv FontResource getDefaultFontResource(boolean wantComp)
getFallbacksback to summary
public abstract FontFallbackInfo getFallbacks(FontResource primaryResource)
getFontFactoryback to summary
public static synchronized PrismFontFactory getFontFactory()
getFontFactoryback to summary
private static synchronized PrismFontFactory getFontFactory(String factoryClass)
getFontFamilyNamesback to summary
public String[] getFontFamilyNames()

Implements com.sun.javafx.font.FontFactory.getFontFamilyNames.

Annotations
@Override
getFontFullNamesback to summary
public String[] getFontFullNames()

Implements com.sun.javafx.font.FontFactory.getFontFullNames.

Annotations
@Override
getFontFullNamesback to summary
public String[] getFontFullNames(String family)

Implements com.sun.javafx.font.FontFactory.getFontFullNames.

Annotations
@Override
getFontPathback to summary
private static native String getFontPath()
getFontResourceback to summary
public synchronized FontResource getFontResource(String familyName, boolean bold, boolean italic, boolean wantComp)
getFontResourceback to summary
private PrismFontFile getFontResource(String name, String file)
getFontResourceback to summary
public synchronized FontResource getFontResource(String name, String file, boolean wantComp)
getFontResourceByFileNameback to summary
private synchronized FontResource getFontResourceByFileName(String file, boolean wantComp)
getFontResourceByFullNameback to summary
private synchronized FontResource getFontResourceByFullName(String name, boolean wantComp)
getFontSizeLimitback to summary
public static float getFontSizeLimit()
getFullNameToFileMapback to summary
private synchronized HashMap<String, String> getFullNameToFileMap()
getJDKFontDirback to summary
private static String getJDKFontDir()
getLCDContrastback to summary
public static float getLCDContrast()
getLCDContrastWin32back to summary
pack-priv static native int getLCDContrastWin32()
getNativeFactoryNameback to summary
private static String getNativeFactoryName()
getPathNameWindowsback to summary
protected static String getPathNameWindows(final String filename)
getPlatformFontDirsback to summary
private static void getPlatformFontDirs()
getSubPixelModeback to summary
public final int getSubPixelMode()
getSystemFontback to summary
public static String getSystemFont(String name)
getSystemFontNativeback to summary
private static native String getSystemFontNative()
getSystemFontSizeback to summary
public static float getSystemFontSize()
getSystemFontSizeNativeback to summary
private static native float getSystemFontSizeNative()
getSystemLCIDback to summary
pack-priv static native short getSystemLCID()
isExcludedback to summary
public boolean isExcluded(String name)
isJreFontback to summary
public static boolean isJreFont(FontResource fr)
isLCDTextSupportedback to summary
public boolean isLCDTextSupported()
isPlatformFontback to summary
public boolean isPlatformFont(String name)

Implements com.sun.javafx.font.FontFactory.isPlatformFont.

Annotations
@Override
loadEmbeddedFontback to summary
public PGFont[] loadEmbeddedFont(String name, InputStream fontStream, float size, boolean register, boolean loadAll)

Implements com.sun.javafx.font.FontFactory.loadEmbeddedFont.

Doc from com.sun.javafx.font.FontFactory.loadEmbeddedFont.

Loads a font from the specified input stream. If the load is successful such that the stream can be fully read, and it represents a supported font format then a PGFont object will be returned.

Any failure such as abbreviated input, or an unsupported font format will result in a null return. It is the application's responsibility to check this before use.

If the register flag is true, and the loading operation completes successfully, then the returned font is registered with the FX graphics system for creation by available constructors and factory methods, and the application should use it in this manner rather than calling this method again, which would repeat the overhead of re-reading and installing the font.

When the font is registered, an alternative name can be supplied. This name can be used for creation by available constructors and factory methods.

The font size parameter is a convenience so that in typical usage the application can directly use the returned (non-null) font rather than needing to create one via a constructor. Invalid sizes are those <=0 and will result in a default size.

This method does not close the input stream.

Parameters
name:String

the name for font, it can be null.

fontStream:InputStream

the stream from which to load the font.

size:float

the size for the font.

register:boolean

whether the font should be register.

loadAll:boolean

whether to load all fonts from a TTC

Returns:PGFont[]

the Font, or null if the font cannot be created.

Annotations
@Override
loadEmbeddedFontback to summary
public PGFont[] loadEmbeddedFont(String name, String path, float size, boolean register, boolean loadAll)

Implements com.sun.javafx.font.FontFactory.loadEmbeddedFont.

registerEmbeddedFont(String name, String path) is a small subset of registerEmbeddedFont(String name, InputStream fontStream) It does not attempt to create a temporary file and has different parameters.

Parameters
name:String

font name

path:String

Path name to system file

size:float

font size

register:boolean

whether the font should be registered.

loadAll:boolean

whether to load all fonts if it is a TTC

Returns:PGFont[]

font name extracted from font file

Annotations
@Override
loadEmbeddedFont1back to summary
private synchronized PrismFontFile[] loadEmbeddedFont1(String name, String path, boolean register, boolean copy, boolean tracked, boolean loadAll)
logFontInfoback to summary
private void logFontInfo(String message, HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap)
lookupResourceback to summary
private FontResource lookupResource(String lcName, boolean wantComp)
populateFontFileNameMapback to summary
pack-priv static native void populateFontFileNameMap(HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap, Locale locale)
populateFontFileNameMapGenericback to summary
pack-priv void populateFontFileNameMapGeneric(String fontDir)
registerEmbeddedFontback to summary
protected boolean registerEmbeddedFont(String path)
removeEmbeddedFontback to summary
private void removeEmbeddedFont(String name)
removeTmpFontback to summary
pack-priv synchronized void removeTmpFont(WeakReference<PrismFontFile> ref)
resolveFontFilesback to summary
private void resolveFontFiles(HashSet<String> unmappedFiles, ArrayList<String> unmappedFonts, HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap)
resolveWindowsFontsback to summary
private void resolveWindowsFonts(HashMap<String, String> fontToFileMap, HashMap<String, String> fontToFamilyNameMap, HashMap<String, ArrayList<String>> familyToFontListMap)
storeInMapback to summary
protected void storeInMap(String name, FontResource resource)
test_getNumEmbeddedFontsback to summary
public int test_getNumEmbeddedFonts()
com.sun.javafx.font back to summary

private Class PrismFontFactory.TTFilter

extends Object
implements FilenameFilter
Class Inheritance
All Implemented Interfaces
java.io.FilenameFilter

Field Summary

Modifier and TypeField and Description
pack-priv static PrismFontFactory.TTFilter

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
accept(File
the directory in which the file was found.
dir
,
String
the name of the file.
name
)

Implements java.io.FilenameFilter.accept.

Tests if a specified file should be included in a file list.

pack-priv static PrismFontFactory.TTFilter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ttFilterback to summary
pack-priv static PrismFontFactory.TTFilter ttFilter

Constructor Detail

TTFilterback to summary
private TTFilter()

Method Detail

acceptback to summary
public boolean accept(File dir, String name)

Implements java.io.FilenameFilter.accept.

Doc from java.io.FilenameFilter.accept.

Tests if a specified file should be included in a file list.

Parameters
dir:File

the directory in which the file was found.

name:String

the name of the file.

Returns:boolean

true if and only if the name should be included in the file list; false otherwise.

Annotations
@Override
getInstanceback to summary
pack-priv static PrismFontFactory.TTFilter getInstance()