Java DTV API 1.3
18-Nov-2009

com.sun.dtv.ui
Class DownloadableFont

java.lang.Object
  extended by com.sun.dtv.ui.DownloadableFont

public class DownloadableFont
extends Object

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

DownloadableFont

public DownloadableFont()
Method Detail

installFont

public static void installFont(URL url)
                        throws IOException,
                               IllegalArgumentException,
                               SecurityException,
                               FontFileException
Downloads a font from the specified URL and installs the font (or fonts, if informations for a font family are found) in the system. The installed font or fonts can be afterwards used like pre-installed fonts, using the 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.

Parameters:
url - the URL specifying the font file to be downloaded; any type of URL is valid, including any form of locators
Throws:
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 format

installFont

public static void installFont(URL url,
                               int timeout)
                        throws IOException,
                               IllegalArgumentException,
                               SecurityException,
                               FontFileException
Downloads a font from the specified URL and installs the font (or fonts, if informations for a font family are found) in the system. The installed font or fonts can be afterwards used like pre-installed fonts, using the 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.

Parameters:
url - the URL specifying the font file to be downloaded; any type of URL is valid, including any form of locators
timeout - timeout in milliseconds
Throws:
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

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.