|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jeuclid.font.FontFactory net.sourceforge.jeuclid.font.DefaultFontFactory
@ThreadSafe public class DefaultFontFactory
Concrete FontFactory implementation that does simple caching of Fonts
loaded via Font.createFont(int, File)
APIs.
Field Summary |
---|
Fields inherited from class net.sourceforge.jeuclid.font.FontFactory |
---|
SANSSERIF |
Method Summary | |
---|---|
Font |
getFont(List<String> preferredFonts,
int codepoint,
int style,
float size)
Create a font object which is able to display the requested code point. |
Font |
getFont(String name,
int style,
float size)
Create a font object with specified properties. |
Set<String> |
listFontNames()
Retrieve a list of all fonts registered with this fontFactory. |
Font |
registerFont(int format,
File fontFile)
Load an external font from a file and 'register' (aka 'cache') it for future use. |
Font |
registerFont(int format,
InputStream fontStream)
Load an external font from a stream and 'register' (aka 'cache') it for future use. |
Methods inherited from class net.sourceforge.jeuclid.font.FontFactory |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Font getFont(String name, int style, float size)
getFont
in class FontFactory
name
- font name or font family namestyle
- font stylesize
- font size
Font.Font(String, int, int)
public Font getFont(List<String> preferredFonts, int codepoint, int style, float size)
getFont
in class FontFactory
preferredFonts
- List of preferred fontscodepoint
- code point which must be displayablestyle
- font stylesize
- font size
public Font registerFont(int format, File fontFile) throws IOException, FontFormatException
registerFont
in class FontFactory
format
- font format (TTF or TYPE_1 currently supported by the
platform)fontFile
- file which contains the font
FontFormatException
- if font contained in the file doesn't match the specified
format
IOException
- in case of problem while reading the fileFont.createFont(int, File)
public Font registerFont(int format, InputStream fontStream) throws IOException, FontFormatException
registerFont
in class FontFactory
format
- font format (TTF or TYPE_1 currently supported by the
platform)fontStream
- file which contains the font
FontFormatException
- if font contained in the stream doesn't match the specified
format
IOException
- in case of problem while reading the streamFont.createFont(int, InputStream)
public Set<String> listFontNames()
listFontNames
in class FontFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |