org.gnu.jfiglet.core
Class FIGFont

java.lang.Object
  extended byorg.gnu.jfiglet.core.FIGFont

public class FIGFont
extends java.lang.Object

A FIGfont, which file format is specified by this document.

Version:
$Id: FIGFont.java,v 1.3 2004/04/27 20:09:28 sbrunot Exp $
Author:
Sebastien Brunot

Field Summary
static int MAX_8BIT_CHARSET_CHAR_CODE
          The maximum valid code for a character of the FIGFont 8-bit characterset
 
Constructor Summary
FIGFont(java.lang.String theName)
          Create an empty FIGFont whith a provided name.
 
Method Summary
 FIGCharacter getFIGCharacter(int theCharacterCode)
          Get one of the FIGFont FIGCharacters.
 FIGFontInfo getInfo()
          Get informations about the FIGFont.
 void loadFromFile()
          Load the content of the FIGFont from the fontname.flf file provided in the fonts directory in the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_8BIT_CHARSET_CHAR_CODE

public static final int MAX_8BIT_CHARSET_CHAR_CODE
The maximum valid code for a character of the FIGFont 8-bit characterset

See Also:
Constant Field Values
Constructor Detail

FIGFont

public FIGFont(java.lang.String theName)
Create an empty FIGFont whith a provided name.

Parameters:
theName - the name of the font
Method Detail

loadFromFile

public void loadFromFile()
                  throws java.io.IOException,
                         java.util.zip.ZipException,
                         IllegalFIGFontFileException
Load the content of the FIGFont from the fontname.flf file provided in the fonts directory in the classpath.

Throws:
java.io.IOException - if such an exception occured while accessing the fontname.flf file.
java.util.zip.ZipException - if the fontname.flf file is a zip file and such an exception occurs reading its content.
IllegalFIGFontFileException - if the fontname.flf file provided in the classpath is not a valid FIGFont file or if there is no fontname.flf file provided in the fonts directory in the classpath.

getFIGCharacter

public FIGCharacter getFIGCharacter(int theCharacterCode)
Get one of the FIGFont FIGCharacters.

Parameters:
theCharacterCode - the code of the FIGCharacter in the FIGFont characterset. An IllegalArgumentException is thrown if this code is lower than 0 or greater than MAX_8BIT_CHARSET_CHAR_CODE
Returns:
the FIGCharacter which code is theCharacterCode in the FIGFont characterset. If no FIGCharacter is defined for this code in the FIGFont, the FIGCharacter which code is 0 is returned.

getInfo

public FIGFontInfo getInfo()
Get informations about the FIGFont.

Returns:
informations about the FIGFont.


Copyright © 2004 Sebastien Brunot. All Rights Reserved.