|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.font.FontInfo2
public final class FontInfo2
FontInfo2 is an updated version of FontInfo with support for spoken languages for improving line breaks when displaying text.
FontInfo2 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. Support for languages and 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 DefineFont class are used to render the characters.
An important distinction between the host device to specify the font and using the glyphs in an DefineFont object is that the device is not anti-aliased and the rendering is dependent on the host device. The glyphs in an DefineFont object are anti-aliased and are guaranteed to look identical on every device the text is displayed.
FontInfo| Constructor Summary | |
|---|---|
FontInfo2(FontInfo2 object)
Creates and initialises a FontInfo2 object using the values copied from another FontInfo2 object. |
|
FontInfo2(int uid,
String fontName,
boolean isBold,
boolean isItalic)
Constructs a basic FontInfo2 object specifying only the name of the font. |
|
FontInfo2(SWFDecoder coder)
Creates and initialises a FontInfo2 object using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
void |
addCode(int aCode)
Add a code to the list of codes. |
FontInfo2 |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
List<Integer> |
getCodes()
Get the list of character codes. |
CharacterFormat |
getEncoding()
Get the encoding scheme used for characters rendered in the font, either ASCII, SJIS or UCS2. |
int |
getIdentifier()
Get the unique identifier of the font definition that this font information is for. |
Language |
getLanguage()
Returns the language code identifying the type of spoken language for the font. |
String |
getName()
Get the name of the font family. |
boolean |
isBold()
Is the font weight bold. |
boolean |
isItalic()
Is the font style italics. |
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 |
setBold(boolean aBool)
Sets the font is bold. |
void |
setCodes(List<Integer> list)
Sets the list of character codes. |
void |
setEncoding(CharacterFormat anEncoding)
Sets the font character encoding. |
void |
setIdentifier(int uid)
Sets the identifier of the font that this font information is for. |
void |
setItalic(boolean aBool)
Sets the font is italics. |
void |
setLanguage(Language lang)
Sets the language code used to determine the position of line-breaks in text rendered using the font. |
void |
setName(String aString)
Sets the name of 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 FontInfo2(SWFDecoder coder)
throws IOException
coder - an SWFDecoder object that contains the encoded Flash data.
IOException - if an error occurs while decoding the data.
public FontInfo2(int uid,
String fontName,
boolean isBold,
boolean isItalic)
uid - the unique identifier of the DefineFont that contains the
glyphs for the font.fontName - the name assigned to the font, identifying the font family.isBold - indicates whether the font weight is bold (true) or normal
(false).isItalic - indicates whether the font style is italic (true) or plain
(false).public FontInfo2(FontInfo2 object)
object - a FontInfo2 object from which the values will be
copied.| Method Detail |
|---|
public int getIdentifier()
public String getName()
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 List<Integer> getCodes()
public void setIdentifier(int uid)
uid - the unique identifier of the DefineFont that contains the
glyphs for the font. Must be in the range 1..65535.public void setName(String aString)
aString - the name assigned to the font, identifying the font family.
Must not be null.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
italics.public void setBold(boolean aBool)
aBool - a boolean flag indicating whether the font will be rendered in
bold face.public void setLanguage(Language lang)
lang - the Language identifying the spoken language for the text
rendered using the font.public void addCode(int aCode)
aCode - a code for a glyph. Must be in the range 0..65535public void setCodes(List<Integer> list)
list - the list mapping glyphs to particular character codes. The
ordinal position of a character code in the list identifies
the index of the corresponding glyph in the DefineFont object.
Must not be null.public FontInfo2 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 | |||||||||