Top Description Fields Constructors Methods
com.jogamp.graph.font

public Class FontFactory

extends Object
Class Inheritance
Imports
java.io.BufferedInputStream, .File, .FileInputStream, .IOException, .InputStream, java.security.AccessController, .PrivilegedAction, com.jogamp.common.net.Uri, com.jogamp.common.util.IOUtil, .PropertyAccess, .ReflectionUtil, com.jogamp.common.util.cache.TempJarCache, jogamp.graph.font.FontConstructor, .JavaFontLoader, .UbuntuFontLoader

The optional property jogamp.graph.font.ctor allows user to specify the FontConstructor implementation.

Default FontConstructor is jogamp.graph.font.typecast.TypecastFontConstructor, i.e. using our internal typecast branch.

Field Summary

Modifier and TypeField and Description
private static final String
private static final FontConstructor
private static final String
public static final int
JAVA

Java fonts are optional,

public static final int
UBUNTU

Ubuntu is the default font family,

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final FontSet
get(final int font)

public static final Font

Returns:

the new Font instance
get
(final File
font file
file
)

Creates a Font instance.

public static final Font

Returns:

the new Font instance
get
(final InputStream
font stream
stream
,
final int
length of the font segment within this font stream
streamLen
,
final boolean
true to close the stream
closeStream
)

Creates a Font instance based on a determinated font stream with its given length of the font segment.

public static final Font

Returns:

the new Font instance
get
(final InputStream
dedicated font stream
stream
,
final boolean
true to close the stream
closeStream
)

Creates a Font instance based on an undeterminated font stream length.

public static final Font
get(final Class<?> context, final String fname, final boolean useTempJarCache)

public static final FontSet
public static boolean
isPrintableChar(final char c)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DefaultFontConstructorback to summary
private static final String DefaultFontConstructor
fontConstrback to summary
private static final FontConstructor fontConstr
FontConstructorPropKeyback to summary
private static final String FontConstructorPropKey
JAVAback to summary
public static final int JAVA

Java fonts are optional,

UBUNTUback to summary
public static final int UBUNTU

Ubuntu is the default font family,

Constructor Detail

FontFactoryback to summary
public FontFactory()

Method Detail

getback to summary
public static final FontSet get(final int font)
getback to summary
public static final Font get(final File file) throws IOException

Creates a Font instance.

Parameters
file:File

font file

Returns:Font

the new Font instance

getback to summary
public static final Font get(final InputStream stream, final int streamLen, final boolean closeStream) throws IOException

Creates a Font instance based on a determinated font stream with its given length of the font segment.

No explicit stream copy is performed as in get(InputStream, boolean) due to the known streamLen.

Parameters
stream:InputStream

font stream

streamLen:int

length of the font segment within this font stream

closeStream:boolean

true to close the stream

Returns:Font

the new Font instance

getback to summary
public static final Font get(final InputStream stream, final boolean closeStream) throws IOException

Creates a Font instance based on an undeterminated font stream length.

The font stream is temporarily copied into a temp file to gather it's size and to gain random access. The temporary file will be deleted at exit.

Parameters
stream:InputStream

dedicated font stream

closeStream:boolean

true to close the stream

Returns:Font

the new Font instance

getback to summary
public static final Font get(final Class<?> context, final String fname, final boolean useTempJarCache) throws IOException
getDefaultback to summary
public static final FontSet getDefault()
isPrintableCharback to summary
public static boolean isPrintableChar(final char c)