Package com.jogamp.graph.font
Class FontFactory
- java.lang.Object
-
- com.jogamp.graph.font.FontFactory
-
public class FontFactory extends Object
The optional property jogamp.graph.font.ctor allows user to specify theFontConstructor
implementation.Default
FontConstructor
isTypecastFontConstructor
, i.e. using our internal typecast branch.
-
-
Constructor Summary
Constructors Constructor Description FontFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FontSet
get(int font)
static Font
get(File file)
Creates a Font instance.static Font
get(InputStream stream, boolean closeStream)
Creates a Font instance based on an undeterminated font stream length.static Font
get(InputStream stream, int streamLen, boolean closeStream)
Creates a Font instance based on a determinated font stream with its given length of the font segment.static Font
get(Class<?> context, String fname, boolean useTempJarCache)
static FontSet
getDefault()
static boolean
isPrintableChar(char c)
-
-
-
Field Detail
-
UBUNTU
public static final int UBUNTU
Ubuntu is the default font family, 0- See Also:
- Constant Field Values
-
JAVA
public static final int JAVA
Java fonts are optional, 1- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefault
public static final FontSet getDefault()
-
get
public static final FontSet get(int font)
-
get
public static final Font get(File file) throws IOException
Creates a Font instance.- Parameters:
file
- font file- Returns:
- the new Font instance
- Throws:
IOException
-
get
public static final Font get(InputStream stream, int streamLen, 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 knownstreamLen
.- Parameters:
stream
- font streamstreamLen
- length of the font segment within this font streamcloseStream
-true
to close thestream
- Returns:
- the new Font instance
- Throws:
IOException
-
get
public static final Font get(InputStream stream, 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
- dedicated font streamcloseStream
-true
to close thestream
- Returns:
- the new Font instance
- Throws:
IOException
-
get
public static final Font get(Class<?> context, String fname, boolean useTempJarCache) throws IOException
- Throws:
IOException
-
isPrintableChar
public static boolean isPrintableChar(char c)
-
-