|
|||||||||
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.FSFontInfo2
public class FSFontInfo2
FSFontInfo2 describes the mapping of codes for a given character set to the glyphs that are drawn to represent the character.
It extends the functionality provided by FSFontInfo by adding a language attribute which is support to support line-breaking when displaying text in different spoken languages. Support for small fonts was added in Flash 7.
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.
Attributes | |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
identifier | The unique identifier for an FSDefineFont object that contains all the glyphs for the font. |
name | The name of the font. |
small | Indicates the font is small enough to align to pixel boundaries. |
encoding | Specifies whether the character codes areTransform.ANSI,Transform.SJIS, Unicode. |
bold | Whether the font is bold. |
italic | Whether the font is italicised. |
language | A code identifying the spoken language for a font, either Latin, Japanese, Korean, SimplifiedChinese or TraditionalChinese. The language code is used to assist in determining the position of line breaks in text displayed using the font. |
codes | An array mapping a glyph index to a particular character code in the font. |
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 FSFontInfo2 class supports the DefineFontInfo2 data structure introduced in Flash 6. Support for small fonts was added in Flash 7.
Field Summary |
---|
Constructor Summary | |
---|---|
FSFontInfo2(FSCoder coder)
Construct an FSFontInfo2 object, initialising it with values decoded from an encoded object. |
|
FSFontInfo2(FSFontInfo2 obj)
Constructs an FSFontInfo2 object by copying values from an existing object. |
|
FSFontInfo2(int anIdentifier,
java.lang.String aName)
Constructs a basic FSFontInfo2 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. |
int |
getLanguage()
Gets the language code identifying the type of spoken language for the font, either FSText.Japanese, FSText.Korean, FSText.Latin, FSText.SimplifiedChinese or FSText.TraditionalChinese. |
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 |
setLanguage(int code)
Sets the language code used to determine the position of line-breaks in text rendered using the font. |
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 FSFontInfo2(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSFontInfo2(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 FSFontInfo2(FSFontInfo2 obj)
obj
- an FSFontInfo2 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 int getLanguage()
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 setLanguage(int code)
code
- the code identifying the spoken language either Latin,
Japanese, Korean, SimplifiedChinese or TraditionalChinese.public void setCodes(java.util.ArrayList anArray)
anArray
- the array mapping glyphs to particular character codes. The
ordinal position of a character code in the array identifies
the index of the corresponding glyph in the FSDefineFont
object.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 |