com.flagstone.transform.font
Class FontName

java.lang.Object
  extended by com.flagstone.transform.font.FontName
All Implemented Interfaces:
Copyable<MovieTag>, SWFEncodeable, MovieTag

public final class FontName
extends Object
implements MovieTag

FontName is used to hold the name and copyright information for a font.


Constructor Summary
FontName(FontName object)
          Creates and initialises a DefineFontName object using the values copied from another DefineFontName object.
FontName(int uid, String fontName, String copyrightNotice)
          Create a new FontName object with the name and copyright information for an existing font definition.
FontName(SWFDecoder coder)
          Creates and initialises a DefineFontName object using values encoded in the Flash binary format.
 
Method Summary
 FontName copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 String getCopyright()
          Get the copyright notice.
 int getIdentifier()
          Get the unique identifier of the font this object is for.
 String getName()
          Returns the name of the font family.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setCopyright(String notice)
          Set the copyright notice.
 void setIdentifier(int uid)
          Set the unique identifier of the font this object is for.
 void setName(String aString)
          Set the name of the font.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FontName

public FontName(SWFDecoder coder)
         throws IOException
Creates and initialises a DefineFontName object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

FontName

public FontName(int uid,
                String fontName,
                String copyrightNotice)
Create a new FontName object with the name and copyright information for an existing font definition.

Parameters:
uid - the unique identifier of the font definition.
fontName - the name of the font.
copyrightNotice - the copyright notice for the font.

FontName

public FontName(FontName object)
Creates and initialises a DefineFontName object using the values copied from another DefineFontName object.

Parameters:
object - a DefineFontName object from which the values will be copied.
Method Detail

getIdentifier

public int getIdentifier()
Get the unique identifier of the font this object is for.

Returns:
the unique identifier of the font definition.

setIdentifier

public void setIdentifier(int uid)
Set the unique identifier of the font this object is for.

Parameters:
uid - the unique identifier of the font definition.

getName

public String getName()
Returns the name of the font family.

Returns:
the name of the font.

setName

public void setName(String aString)
Set the name of the font.

Parameters:
aString - the name assigned to the font, identifying the font family. Must not be null.

getCopyright

public String getCopyright()
Get the copyright notice.

Returns:
a string describing the copyright information.

setCopyright

public void setCopyright(String notice)
Set the copyright notice.

Parameters:
notice - a string describing the copyright information.

copy

public FontName copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<MovieTag>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.