|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSTransformObject
com.flagstone.transform.FSMovieObject
com.flagstone.transform.FSFontInfo
public class FSFontInfo
FSFontInfo defines the name and face of a font and maps the codes for a given character set to the glyphs that are drawn to represent each character.
Attributes | |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
identifier | The unique identifier, in the range 1..65535, for the FSDefineFont object that contains the glyphs for the font. |
name | The name of the font. |
encoding | Specifies whether the codes for the character set are represented using ANSI (ASCII), SJIS or Unicode. |
bold | Indicates the font is small enough to align to pixel boundaries. |
bold | Whether the font is bold. |
italic | Whether the font is rendered in italics. |
isSmall | Indicates the font is small enough to align to pixel boundaries. |
codes | An array mapping a glyph index to a particular character code in the font. |
The ANSI character set is used for Latin languages, SJIS is used for Japanese language characters and Unicode is used for any character set. The encoding attributes uses the constants FSText.ANSI, FSText.SJIS or FSText.Unicode for each character set type.
The index of each entry in the codes array matches the index in the corresponding glyph in the shapes array of an FSDefineFont object, allowing a given character code to be mapped to a given glyph.
The class allows the font associated with a Flash file to be mapped to a font installed on the device where the Flash Player displaying the file is hosted. The use of a font from a device is not automatic but is determined by the HTML tag option deviceFont which is passed to the Flash Player when it is first started. If a device does not support a given font then the glyphs in the FSDefineFont class are used to render the characters.
An important distinction between the host device to specify the font and using the glyphs in an FSDefineFont object is that the device is not anti-aliased and the rendering is dependent on the host device. The glyphs in an FSDefineFont object are anti-aliased and are guaranteed to look identical on every device the text is displayed.
The FSFontInfo class represents the DefineFontInfo data structure from the Flash specification. It was introduced in Flash 1. Support for small fonts was added in Flash 7.
Field Summary |
---|
Constructor Summary | |
---|---|
FSFontInfo(FSCoder coder)
Construct an FSFontInfo object, initialising it with values decoded from an encoded object. |
|
FSFontInfo(FSFontInfo obj)
Constructs an FSFontInfo object by copying values from an existing object. |
|
FSFontInfo(int anIdentifier,
java.lang.String aName)
Constructs a basic FSFontInfo object specifying only the name of the font. |
Method Summary | |
---|---|
void |
appendDescription(java.lang.StringBuffer buffer,
int depth)
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. |
java.lang.Object |
clone()
Creates a deep copy of the entire object. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
java.util.ArrayList |
getCodes()
Gets the array of character codes. |
int |
getEncoding()
Gets the encoding scheme used for characters rendered in the font, either FSText.ASCII, FSText.SJIS or FSText.Unicode. |
int |
getIdentifier()
Gets the identifier of the font that this font information is for. |
java.lang.String |
getName()
Gets the name of the font family. |
boolean |
isBold()
Is the font bold. |
boolean |
isItalic()
Is the font italics. |
boolean |
isSmall()
Does the font have a small point size. |
int |
length(FSCoder coder)
|
void |
setBold(boolean aBool)
Sets the font is bold. |
void |
setCodes(java.util.ArrayList anArray)
Sets the array of character codes. |
void |
setEncoding(int anEncoding)
Sets the font character encoding. |
void |
setIdentifier(int anIdentifier)
Sets the identifier of the font that this font information is for. |
void |
setItalic(boolean aBool)
Sets the font is italics. |
void |
setName(java.lang.String aString)
Sets the name of the font. |
void |
setSmall(boolean aBool)
Sets the font is small. |
Methods inherited from class com.flagstone.transform.FSMovieObject |
---|
getType |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSFontInfo(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSFontInfo(int anIdentifier, java.lang.String aName)
anIdentifier
- the unique identifier of the FSDefineFont that contains the
glyphs for the font.aName
- the name assigned to the font, identifying the font family.public FSFontInfo(FSFontInfo obj)
obj
- an FSFontInfo object.Method Detail |
---|
public int getIdentifier()
public java.lang.String getName()
public int 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 java.util.ArrayList getCodes()
public void setIdentifier(int anIdentifier)
anIdentifier
- the unique identifier of the FSDefineFont that contains the
glyphs for the font.public void setName(java.lang.String aString)
aString
- the name assigned to the font, identifying the font family.public void setEncoding(int anEncoding)
anEncoding
- the encoding used to identify characters, either FSText.ASCII,
FSText.SJIS or FSText.Unicode.public void setItalic(boolean aBool)
aBool
- a boolean flag indicating whether the font will be rendered in
italics.public void setBold(boolean aBool)
aBool
- a boolean flag indicating whether the font will be rendered in
bold face.public void setCodes(java.util.ArrayList anArray)
anArray
- the array mapping glyphs to particular character codes.public java.lang.Object clone()
FSTransformObject
clone
in class FSTransformObject
public boolean equals(java.lang.Object anObject)
FSMovieObject
equals
in class FSMovieObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSMovieObject
buffer
- a StringBuffer to which the description of each object is
appended.depth
- the maximum level of nesting up to which objects will be
displayed.public int length(FSCoder coder)
length
in class FSMovieObject
public void encode(FSCoder coder)
encode
in class FSMovieObject
public void decode(FSCoder coder)
decode
in class FSMovieObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |