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 theFontConstructorimplementation.Default
FontConstructorisTypecastFontConstructor, 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 FontSetget(int font)static Fontget(File file)Creates a Font instance.static Fontget(InputStream stream, boolean closeStream)Creates a Font instance based on an undeterminated font stream length.static Fontget(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 Fontget(Class<?> context, String fname, boolean useTempJarCache)static FontSetgetDefault()static FontgetDefaultFont()static FontgetFallbackFont()Returns registered fallbackFont, maybenull.static FontgetSymbolsFont()Returns the default symbolsFontornullif n/astatic booleanisPrintableChar(char c)static voidsetFallbackFont(Font f)Registers givenFontas the default fallback font.
-
-
-
Field Detail
-
UBUNTU
public static final int UBUNTU
Ubuntu is the default font family, 0- See Also:
- Constant Field Values
-
SYMBOLS
public static final int SYMBOLS
Symbols is the default symbol font family and contains rounded material symbol fonts, 10- 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-trueto 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-trueto 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)
-
getDefaultFont
public static Font getDefaultFont()
-
getFallbackFont
public static Font getFallbackFont()
-
-