|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.text.TextSettings
public final class TextSettings
TextSettings allows you to control how individual text fields are rendered.
There are four parameters that control how the text is rendered:
The thickness and sharpness control the how the text is rendered:
outsideCutoff = (0.5 * sharpness - thickness) * fontSize insideCutoff = (-0.5 * sharpness - thickness) * fontSizeNote that Adobe reports the results can be poor when the text is scaled by a significant amount and so the default values of 0.0 should be used for the thickness and sharpness values.
Nested Class Summary | |
---|---|
static class |
TextSettings.Grid
Grid specifies how letters are aligned with respect to the pixel grid on a screen. |
Constructor Summary | |
---|---|
TextSettings(int uid,
boolean advanced,
TextSettings.Grid grid,
float thick,
float sharp)
Creates a TextSettings object with the specified values. |
|
TextSettings(SWFDecoder coder)
Creates and initialises an TextSettings using values encoded in the Flash binary format. |
|
TextSettings(TextSettings object)
Creates an TextSettings object and initialised it by copying the values from an existing one. |
Method Summary | |
---|---|
TextSettings |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
TextSettings.Grid |
getGrid()
Returns the alignment of letters with respect to the pixel grid. |
int |
getIdentifier()
Get the unique identifier of the text definition that this object applies to. |
float |
getSharpness()
Get the value used to control the sharpness of a line when rendered. |
float |
getThickness()
Get the value used to control the thickness of a line when rendered. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setGrid(TextSettings.Grid alignment)
Selects how the text letters will be aligned with respect to the pixel grid used in LCD screens. |
void |
setIdentifier(int uid)
Sets the identifier of the text definition that this object applies to. |
void |
setSharpness(float level)
Sets the value used to control the sharpness of a line when rendered. |
void |
setThickness(float level)
Sets the value used to control the thickness of a line when rendered. |
String |
toString()
|
boolean |
useAdvanced()
Will the advanced text rendering engine, introduced in Flash 8 be used. |
void |
useAdvanced(boolean flag)
Sets whether the advanced text rendering engine (true) or standard engine (false) will be used to render the text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextSettings(SWFDecoder coder) throws IOException
coder
- an SWFDecoder object that contains the encoded Flash data.
IOException
- if an error occurs while decoding the data.public TextSettings(int uid, boolean advanced, TextSettings.Grid grid, float thick, float sharp)
uid
- the unique identifier of an existing text field.advanced
- whether the advanced rendering engine will be used to display
the text.grid
- how letters are aligned with respect to the pixel grid.thick
- the thickness used when anti-aliasing the text.sharp
- the sharpness used when anti-aliasing the text.public TextSettings(TextSettings object)
object
- a TextSettings object.Method Detail |
---|
public int getIdentifier()
public void setIdentifier(int uid)
uid
- the unique identifier of an DefineText, DefineText2 or
DefineTextField object. Must be in the range 1..65535.public boolean useAdvanced()
public void useAdvanced(boolean flag)
flag
- set true to select the advanced text rendering engine, false
for the standard rendering engine.public TextSettings.Grid getGrid()
public void setGrid(TextSettings.Grid alignment)
alignment
- the alignment with respect to the pixel grid, either NONE,
PIXEL or SUBPIXEL.public float getThickness()
public void setThickness(float level)
level
- the value of the thickness parameter used by the rendering
engine.public float getSharpness()
public void setSharpness(float level)
level
- the value of the sharpness parameter used by the rendering
engine.public TextSettings copy()
copy
in interface Copyable<MovieTag>
public String toString()
toString
in class Object
public int prepareToEncode(Context context)
prepareToEncode
in interface SWFEncodeable
context
- 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 SWFEncodeable
coder
- 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 |