|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.font.DefineFont3
public final class DefineFont3
DefineFont3 provides the same functionality as DefineFont2 but the coordinates are expressed at 20 times the resolution, i.e. 1/20th of a twip to increase the quality of the displayed text. DefineFont3 is used in conjunction with FontAlignment zones to support snapping glyphs to the nearest pixel again to improve display quality.
| Constructor Summary | |
|---|---|
DefineFont3(DefineFont3 object)
Creates and initialises a DefineFont3 object using the values copied from another DefineFont3 object. |
|
DefineFont3(int uid,
String fontName)
Creates a DefineFont2 object specifying only the name of the font. |
|
DefineFont3(SWFDecoder coder,
Context context)
Creates and initialises a DefineFont3 object using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
DefineFont3 |
add(Bounds rect)
Add a bounds object to the list of bounds for each glyph. |
DefineFont3 |
add(Kerning anObject)
Add a kerning object to the list of kernings for pairs of glyphs. |
DefineFont3 |
addAdvance(int anAdvance)
Add an advance to the list of advances. |
DefineFont3 |
addGlyph(int code,
Shape obj)
Add a character code and the corresponding glyph that will be displayed. |
DefineFont3 |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
List<Integer> |
getAdvances()
Returns the list of advances defined for each glyph in the font. |
int |
getAscent()
Returns the ascent for the font in twips. |
List<Bounds> |
getBounds()
Returns the list of bounding rectangles defined for each glyph in the font. |
List<Integer> |
getCodes()
Returns the list of codes used to identify each glyph in the font. |
int |
getDescent()
Returns the descent for the font in twips. |
CharacterFormat |
getEncoding()
Returns the encoding scheme used for characters rendered in the font, either ASCII, SJIS or UCS2. |
int |
getIdentifier()
Get the unique identifier assigned to this object. |
List<Kerning> |
getKernings()
Returns the list of kerning records that define the spacing between glyph pairs. |
Language |
getLanguage()
Returns the language code identifying the type of spoken language for the font. |
int |
getLeading()
Returns the leading for the font in twips. |
String |
getName()
Returns the name of the font family. |
List<Shape> |
getShapes()
Returns the list of shapes used to define the outlines of each font glyph. |
boolean |
isBold()
Is the font bold. |
boolean |
isItalic()
Is the font italicised. |
boolean |
isSmall()
Does the font have a small point size. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setAdvances(List<Integer> list)
Sets the list of advances for each glyph in the font. |
void |
setAscent(int aNumber)
Sets the ascent for the font in twips. |
void |
setBold(boolean aBool)
Set the font is bold. |
void |
setBounds(List<Bounds> list)
Sets the list of bounding rectangles for each glyph in the font. |
void |
setCodes(List<Integer> list)
Sets the codes used to identify each glyph in the font. |
void |
setDescent(int aNumber)
Sets the descent for the font in twips. |
void |
setEncoding(CharacterFormat anEncoding)
Sets the font character encoding. |
void |
setIdentifier(int uid)
Sets the unique identifier for an object within a given Movie. |
void |
setItalic(boolean aBool)
Set the font is italicised. |
void |
setKernings(List<Kerning> list)
Sets the list of kerning records for pairs of glyphs in the font. |
void |
setLanguage(Language lang)
Sets the language code used to determine the position of line-breaks in text rendered using the font. |
void |
setLeading(int aNumber)
Sets the leading for the font in twips. |
void |
setName(String aString)
Set the name of the font. |
void |
setShapes(List<Shape> list)
Set the list of shape records that define the outlines of the characters used from the font. |
void |
setSmall(boolean aBool)
Sets the font is small. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefineFont3(SWFDecoder coder,
Context context)
throws IOException
coder - an SWFDecoder object that contains the encoded Flash data.context - a Context object used to manage the decoders for different
type of object and to pass information on how objects are
decoded.
IOException - if an error occurs while decoding the data.
public DefineFont3(int uid,
String fontName)
uid - the unique identifier for this font object.fontName - the name of the font.public DefineFont3(DefineFont3 object)
object - a DefineFont3 object from which the values will be
copied.| Method Detail |
|---|
public int getIdentifier()
getIdentifier in interface DefineTagpublic void setIdentifier(int uid)
setIdentifier in interface DefineTaguid - a unique identifier for the object. Must be in the range
1..65535.
public DefineFont3 addGlyph(int code,
Shape obj)
code - the character code. Must be in the range 0..65535.obj - the shape that represents the glyph displayed for the
character code.
public DefineFont3 addAdvance(int anAdvance)
anAdvance - an advance for a glyph. Must be in the range -32768..32767.
public DefineFont3 add(Bounds rect)
rect - an Bounds. Must not be null.
public DefineFont3 add(Kerning anObject)
anObject - an Kerning. Must not be null.
public CharacterFormat getEncoding()
public boolean isSmall()
public void setSmall(boolean aBool)
aBool - a boolean flag indicating the font will be aligned on pixel
boundaries.public boolean isItalic()
public boolean isBold()
public Language getLanguage()
public void setLanguage(Language lang)
lang - the Language identifying the spoken language for the text
rendered using the font.public String getName()
public List<Shape> getShapes()
public List<Integer> getCodes()
public int getAscent()
public int getDescent()
public int getLeading()
public List<Integer> getAdvances()
public List<Bounds> getBounds()
public List<Kerning> getKernings()
public void setEncoding(CharacterFormat anEncoding)
anEncoding - the encoding used to identify characters, either ASCII, SJIS
or UNICODE.public void setItalic(boolean aBool)
aBool - a boolean flag indicating whether the font will be rendered in
italicspublic void setBold(boolean aBool)
aBool - a boolean flag indicating whether the font will be rendered in
bold face.public void setName(String aString)
aString - the name assigned to the font, identifying the font family.
Must not be null.public void setShapes(List<Shape> list)
list - a list of Shape objects that define the glyphs for the font.
Must not be null.public void setCodes(List<Integer> list)
list - sets the code table that maps a particular glyph to a
character code. Must not be null.public void setAscent(int aNumber)
aNumber - the ascent for the font in the range -32768..32767.public void setDescent(int aNumber)
aNumber - the descent for the font in the range -32768..32767.public void setLeading(int aNumber)
aNumber - the descent for the font in the range -32768..32767.public void setAdvances(List<Integer> list)
list - of Integer objects that define the spacing between glyphs.
Must not be null.public void setBounds(List<Bounds> list)
list - a list of Bounds objects that define the bounding rectangles
that enclose each glyph in the font. Must not be null.public void setKernings(List<Kerning> list)
list - a list of Kerning objects that define an adjustment applied
to the spacing between pairs of glyphs. Must not be null.public DefineFont3 copy()
copy in interface Copyable<MovieTag>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder,
Context context)
throws IOException
encode in interface SWFEncodeablecoder - an SWFEncoder object.context - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException - if an error occurs while encoding the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||