pt.tumba.parser.swf
Class Font

java.lang.Object
  extended by pt.tumba.parser.swf.Symbol
      extended by pt.tumba.parser.swf.Font

public class Font
extends Symbol

A Font Symbol. The Font references a FontDefinition object from which it takes the glyph definitions it needs.

Author:
unknown

Nested Class Summary
 class Font.Chars
          A set of contiguous characters in one font.
 class Font.NoGlyphException
          Description of the Class
 
Field Summary
protected  java.lang.Object font1Key
          Description of the Field
protected  java.lang.Object font2Key
          Description of the Field
protected  FontDefinition fontDef
          Description of the Field
protected  java.util.List glyphList
          Description of the Field
protected  java.util.Map glyphs
          Description of the Field
protected  java.util.Map indices
          Description of the Field
 
Fields inherited from class pt.tumba.parser.swf.Symbol
id
 
Constructor Summary
Font(FontDefinition fontDef)
          Constructor for the Font object
 
Method Summary
 int addGlyph(FontDefinition.Glyph glyph)
          Add a glyph and return the index
 Font.Chars chars(java.lang.String chars, double fontSize)
          Get the Chars instance for the given string at the given font size
protected  int define(boolean textFont, Movie movie, SWFTagTypes tagwriter)
          Description of the Method
protected  int defineFont1(Movie movie, SWFTagTypes tagwriter)
          Description of the Method
protected  int defineFont2(Movie movie, SWFTagTypes tagwriter)
          Description of the Method
protected  int defineSymbol(Movie movie, SWFTagTypes timelineWriter, SWFTagTypes definitionwriter)
          Description of the Method
protected  int[] getCodes()
          Get the codes of the current set of glyphs
 FontDefinition getDefinition()
          Gets the definition attribute of the Font object
protected  FontDefinition.Glyph getGlyph(int code, int[] index2)
          Gets the glyph attribute of the Font object
 java.util.List getGlyphList()
          Gets the glyphList attribute of the Font object
 void loadAllGlyphs()
          Load all glyphs from the font definition
 void loadGlyphs(java.lang.String chars)
          Load the glyphs for the characters in the given string from the FontDefinition into this font.
 void setCode(int index, int code)
          Set the code for the glyph at the given index
 
Methods inherited from class pt.tumba.parser.swf.Symbol
define, getId, getNextId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

font1Key

protected java.lang.Object font1Key
Description of the Field


font2Key

protected java.lang.Object font2Key
Description of the Field


fontDef

protected FontDefinition fontDef
Description of the Field


glyphs

protected java.util.Map glyphs
Description of the Field


indices

protected java.util.Map indices
Description of the Field


glyphList

protected java.util.List glyphList
Description of the Field

Constructor Detail

Font

public Font(FontDefinition fontDef)
Constructor for the Font object

Parameters:
fontDef - Description of the Parameter
Method Detail

getDefinition

public FontDefinition getDefinition()
Gets the definition attribute of the Font object

Returns:
The definition value

getGlyphList

public java.util.List getGlyphList()
Gets the glyphList attribute of the Font object

Returns:
The glyphList value

loadGlyphs

public void loadGlyphs(java.lang.String chars)
                throws Font.NoGlyphException
Load the glyphs for the characters in the given string from the FontDefinition into this font.

Parameters:
chars - Description of the Parameter
Throws:
Font.NoGlyphException

loadAllGlyphs

public void loadAllGlyphs()
Load all glyphs from the font definition


chars

public Font.Chars chars(java.lang.String chars,
                        double fontSize)
                 throws Font.NoGlyphException
Get the Chars instance for the given string at the given font size

Parameters:
chars - Description of the Parameter
fontSize - Description of the Parameter
Returns:
Description of the Return Value
Throws:
Font.NoGlyphException - Description of the Exception

getGlyph

protected FontDefinition.Glyph getGlyph(int code,
                                        int[] index2)
                                 throws Font.NoGlyphException
Gets the glyph attribute of the Font object

Parameters:
code - Description of the Parameter
index - Description of the Parameter
Returns:
The glyph value
Throws:
Font.NoGlyphException - Description of the Exception

addGlyph

public int addGlyph(FontDefinition.Glyph glyph)
Add a glyph and return the index

Parameters:
glyph - The feature to be added to the Glyph attribute
Returns:
Description of the Return Value

setCode

public void setCode(int index,
                    int code)
Set the code for the glyph at the given index

Parameters:
index - The new code value
code - The new code value

define

protected int define(boolean textFont,
                     Movie movie,
                     SWFTagTypes tagwriter)
              throws java.io.IOException
Description of the Method

Parameters:
textFont - Description of the Parameter
movie - Description of the Parameter
tagwriter - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

defineFont1

protected int defineFont1(Movie movie,
                          SWFTagTypes tagwriter)
                   throws java.io.IOException
Description of the Method

Parameters:
movie - Description of the Parameter
tagwriter - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

defineFont2

protected int defineFont2(Movie movie,
                          SWFTagTypes tagwriter)
                   throws java.io.IOException
Description of the Method

Parameters:
movie - Description of the Parameter
tagwriter - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

getCodes

protected int[] getCodes()
Get the codes of the current set of glyphs

Returns:
The codes value

defineSymbol

protected int defineSymbol(Movie movie,
                           SWFTagTypes timelineWriter,
                           SWFTagTypes definitionwriter)
                    throws java.io.IOException
Description of the Method

Specified by:
defineSymbol in class Symbol
Parameters:
movie - Description of the Parameter
timelineWriter - Description of the Parameter
definitionwriter - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception