pt.tumba.parser.swf
Class FontDefinition

java.lang.Object
  extended by pt.tumba.parser.swf.FontDefinition

public class FontDefinition
extends java.lang.Object

A Font Definition that can referenced by Font symbols. If read in from an existing Flash movie the font definition may only contain a subset of the glyphs in the font. To use a system font set the hasMetrics flag to false.

Author:
unknown

Nested Class Summary
static class FontDefinition.Glyph
          A Glyph within the font.
static class FontDefinition.KerningPair
          A Kerning Pair is an adjustment to the advance between two particular glyphs.
 
Field Summary
protected  double ascent
          Description of the Field
protected  double descent
          Description of the Field
protected  java.util.Map glyphLookup
          Description of the Field
protected  java.util.List glyphs
          Description of the Field
protected  boolean hasMetrics
          Description of the Field
protected  boolean isAnsi
          Description of the Field
protected  boolean isBold
          Description of the Field
protected  boolean isItalic
          Description of the Field
protected  boolean isShiftJIS
          Description of the Field
protected  boolean isUnicode
          Description of the Field
protected  java.util.List kerning
          Description of the Field
protected  java.util.Map kernLookup
          Description of the Field
protected  double leading
          Description of the Field
protected  java.lang.String name
          Description of the Field
 
Constructor Summary
FontDefinition()
          Constructor for the FontDefinition object
FontDefinition(java.lang.String name, double ascent, double descent, double leading, boolean isUnicode, boolean isShiftJIS, boolean isAnsi, boolean isItalic, boolean isBold, boolean hasMetrics)
          Constructor for the FontDefinition object
 
Method Summary
 double getAscent()
          Gets the ascent attribute of the FontDefinition object
 double getDescent()
          Gets the descent attribute of the FontDefinition object
 FontDefinition.Glyph getGlyph(int code)
          Look up a glyph by code
 java.util.List getGlyphList()
          Get the List of Glyph objects
 double getKerningOffset(int code1, int code2)
          Get the kerning adjustment required between the two given codes
 java.util.List getKerningPairList()
          Get the List of KerningPair objects
 double getLeading()
          Gets the leading attribute of the FontDefinition object
 java.lang.String getName()
          Gets the name attribute of the FontDefinition object
 boolean hasMetrics()
          Description of the Method
 boolean isAnsi()
          Gets the ansi attribute of the FontDefinition object
 boolean isBold()
          Gets the bold attribute of the FontDefinition object
 boolean isItalic()
          Gets the italic attribute of the FontDefinition object
 boolean isShiftJIS()
          Gets the shiftJIS attribute of the FontDefinition object
 boolean isUnicode()
          Gets the unicode attribute of the FontDefinition object
 void setAscent(double ascent)
          Sets the ascent attribute of the FontDefinition object
 void setDescent(double descent)
          Sets the descent attribute of the FontDefinition object
 void setFontFlags(boolean isUnicode, boolean isShiftJIS, boolean isAnsi, boolean isItalic, boolean isBold, boolean hasMetrics)
          Sets the fontFlags attribute of the FontDefinition object
 void setLeading(double leading)
          Sets the leading attribute of the FontDefinition object
 void setName(java.lang.String name)
          Sets the name attribute of the FontDefinition object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Description of the Field


ascent

protected double ascent
Description of the Field


descent

protected double descent
Description of the Field


leading

protected double leading
Description of the Field


isUnicode

protected boolean isUnicode
Description of the Field


isShiftJIS

protected boolean isShiftJIS
Description of the Field


isAnsi

protected boolean isAnsi
Description of the Field


isItalic

protected boolean isItalic
Description of the Field


isBold

protected boolean isBold
Description of the Field


hasMetrics

protected boolean hasMetrics
Description of the Field


glyphs

protected java.util.List glyphs
Description of the Field


kerning

protected java.util.List kerning
Description of the Field


glyphLookup

protected java.util.Map glyphLookup
Description of the Field


kernLookup

protected java.util.Map kernLookup
Description of the Field

Constructor Detail

FontDefinition

public FontDefinition()
Constructor for the FontDefinition object


FontDefinition

public FontDefinition(java.lang.String name,
                      double ascent,
                      double descent,
                      double leading,
                      boolean isUnicode,
                      boolean isShiftJIS,
                      boolean isAnsi,
                      boolean isItalic,
                      boolean isBold,
                      boolean hasMetrics)
Constructor for the FontDefinition object

Parameters:
name - Description of the Parameter
ascent - Description of the Parameter
descent - Description of the Parameter
leading - Description of the Parameter
isUnicode - Description of the Parameter
isShiftJIS - Description of the Parameter
isAnsi - Description of the Parameter
isItalic - Description of the Parameter
isBold - Description of the Parameter
hasMetrics - Description of the Parameter
Method Detail

getName

public java.lang.String getName()
Gets the name attribute of the FontDefinition object

Returns:
The name value

getAscent

public double getAscent()
Gets the ascent attribute of the FontDefinition object

Returns:
The ascent value

getDescent

public double getDescent()
Gets the descent attribute of the FontDefinition object

Returns:
The descent value

getLeading

public double getLeading()
Gets the leading attribute of the FontDefinition object

Returns:
The leading value

isUnicode

public boolean isUnicode()
Gets the unicode attribute of the FontDefinition object

Returns:
The unicode value

isShiftJIS

public boolean isShiftJIS()
Gets the shiftJIS attribute of the FontDefinition object

Returns:
The shiftJIS value

isAnsi

public boolean isAnsi()
Gets the ansi attribute of the FontDefinition object

Returns:
The ansi value

isItalic

public boolean isItalic()
Gets the italic attribute of the FontDefinition object

Returns:
The italic value

isBold

public boolean isBold()
Gets the bold attribute of the FontDefinition object

Returns:
The bold value

hasMetrics

public boolean hasMetrics()
Description of the Method

Returns:
Description of the Return Value

getGlyphList

public java.util.List getGlyphList()
Get the List of Glyph objects

Returns:
The glyphList value

getKerningPairList

public java.util.List getKerningPairList()
Get the List of KerningPair objects

Returns:
The kerningPairList value

setName

public void setName(java.lang.String name)
Sets the name attribute of the FontDefinition object

Parameters:
name - The new name value

setAscent

public void setAscent(double ascent)
Sets the ascent attribute of the FontDefinition object

Parameters:
ascent - The new ascent value

setDescent

public void setDescent(double descent)
Sets the descent attribute of the FontDefinition object

Parameters:
descent - The new descent value

setLeading

public void setLeading(double leading)
Sets the leading attribute of the FontDefinition object

Parameters:
leading - The new leading value

setFontFlags

public void setFontFlags(boolean isUnicode,
                         boolean isShiftJIS,
                         boolean isAnsi,
                         boolean isItalic,
                         boolean isBold,
                         boolean hasMetrics)
Sets the fontFlags attribute of the FontDefinition object

Parameters:
isUnicode - The new fontFlags value
isShiftJIS - The new fontFlags value
isAnsi - The new fontFlags value
isItalic - The new fontFlags value
isBold - The new fontFlags value
hasMetrics - The new fontFlags value

getGlyph

public FontDefinition.Glyph getGlyph(int code)
Look up a glyph by code

Parameters:
code - Description of the Parameter
Returns:
null if the code has no glyph

getKerningOffset

public double getKerningOffset(int code1,
                               int code2)
Get the kerning adjustment required between the two given codes

Parameters:
code1 - Description of the Parameter
code2 - Description of the Parameter
Returns:
The kerningOffset value