public class FontFactory extends Object
| Constructor and Description |
|---|
FontFactory()
Constructs a FontFactory for the font index file bound to this application
in the application signalling.
|
FontFactory(URL u)
Constructs a FontFactory for the font file found at the given location.
|
| Modifier and Type | Method and Description |
|---|---|
Font |
createFont(String name,
int style,
int size)
Creates a font object from the font source associated with this
FontFactory.
|
public FontFactory()
throws FontFormatException,
IOException
FontFormatException - if there is an error in the font index
file bound with the application.IOException - if there is no font index file bound
with the application, or if there is an
error attempting to access the data in that
file.public FontFactory(URL u) throws IOException, FontFormatException
u - The location of the font fileIOException - if there is an
error attempting to access the data referenced
by the URLIllegalArgumentException - if the URL is not both valid and supportedSecurityException - if access to the specified URL is denied by
security policyFontFormatException - if the file at that URL is not a valid
font file as specified in the main body of the present documentpublic Font createFont(String name, int style, int size) throws FontNotAvailableException, FontFormatException, IOException
The value of the style argument must be as defined in java.awt.Font. Valid values are the following:
java.awt.Font.PLAIN
java.awt.Font.BOLD
java.awt.Font.ITALIC
java.awt.Font.BOLD + java.awt.Font.ITALIC
name - the font namestyle - the constant style used, such as java.awt.Font.PLAIN.size - the point size of the fontFontNotAvailableException - if a font with given parameters cannot
be located or created.IOException - if there is an error retrieving a font from the
network. Thrown only for font factory instances bound to the font index file of
an application.IllegalArgumentException - if the style parameter is not in the
set of valid values, or if the size parameter
is zero or negative.FontFormatException - if the font file is not a valid
font file as specified in the main body of the present document.
Thrown only for font factory instances bound to the font index file
of an application.Copyright © 2012 code4tv.com. All Rights Reserved.