|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.ui.DownloadableFont
public class DownloadableFont
This class introduces the possibility to download fonts. The offered method
downloads a font (family) from the specified URL, and installs it on the
platform.
Afterwards, the installed font (or fonts if the file contained information
for a font family) can be used like any pre-installed font, using the class
Font
.
Implementations should take care, that any URl syntax is supported, including any kind of locators.
The font file located at the place specified by the URL has to be present there in open font format.
Constructor Summary | |
---|---|
DownloadableFont()
|
Method Summary | |
---|---|
static void |
installFont(URL url)
Downloads a font from the specified URL and installs the font (or fonts, if informations for a font family are found) in the system. |
static void |
installFont(URL url,
int timeout)
Downloads a font from the specified URL and installs the font (or fonts, if informations for a font family are found) in the system. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DownloadableFont()
Method Detail |
---|
public static void installFont(URL url) throws IOException, IllegalArgumentException, SecurityException, FontFileException
Font
class.
Be aware that this method works synchronous, i.e. it just returns after the Font information has been successfully downloaded.
The file found at the locations specified by the URL must contain the font information in the open font format.
url
- the URL specifying the font file to be downloaded; any type
of URL is valid, including any form of locators
IOException
- if an error attempts while trying to access
the data the URL is referring to
IllegalArgumentException
- if there is no valid URL
provided
SecurityException
- if current security policy does not
allow for access to the specified URL
FontFileException
- if the file the URL is referring to cannot be
recognized as a valid font file in open font formatpublic static void installFont(URL url, int timeout) throws IOException, IllegalArgumentException, SecurityException, FontFileException
Font
class.
Be aware that this method works synchronous, i.e. it just returns after the Font information has been successfully downloaded, or the time as specified in the timeout parameter has gone by without a successful download of the font information.
The file found at the locations specified by the URL must contain the font information in the open font format.
url
- the URL specifying the font file to be downloaded; any type
of URL is valid, including any form of locatorstimeout
- timeout in milliseconds
IOException
- if an error attempts while trying to access
the data the URL is referring to, including timeout as specified in the
timeout parameter
IllegalArgumentException
- if there is no valid URL
provided
SecurityException
- if current security policy does not
allow for access to the specified URL
FontFileException
- if the file the URL is referring to cannot be
recognized as a valid font file in open font format
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |