Clients usually instantiate object of the class.
TextAttribute
class defines attribute keys and attribute values used for text rendering. TextAttribute
instances are used as attribute keys to identify attributes in {@link java.awt.Font Font}, {@link java.awt.font.TextLayout TextLayout}, {@link java.text.AttributedCharacterIterator AttributedCharacterIterator}, and other classes handling text attributes. Other constants defined in this class can be used as attribute values.
For each text attribute, the documentation provides:
null
is treated the same as the default value and results in the default behavior. TextAttribute.WEIGHT_BOLD
and new Float(2.0)
indicate the same WEIGHT
. Number
(used for WEIGHT
, WIDTH
, POSTURE
, SIZE
, JUSTIFICATION
, and TRACKING
) can vary along their natural range and are not restricted to the predefined constants. Number.floatValue()
is used to get the actual value from the Number
. WEIGHT
, WIDTH
, and POSTURE
are interpolated by the system, which can select the 'nearest available' font or use other techniques to approximate the user's request.
@see java.awt.Font
@see java.awt.font.TextLayout
@see java.text.AttributedCharacterIterator
Key Value Type Principal Constants Default Value {@link #FAMILY} String See Font {@link java.awt.Font#DIALOG DIALOG}, {@link java.awt.Font#DIALOG_INPUT DIALOG_INPUT},
{@link java.awt.Font#SERIF SERIF}, {@link java.awt.Font#SANS_SERIF SANS_SERIF}, and {@link java.awt.Font#MONOSPACED MONOSPACED}. "Default" (use platform default) {@link #WEIGHT} Number WEIGHT_REGULAR, WEIGHT_BOLD WEIGHT_REGULAR {@link #WIDTH} Number WIDTH_CONDENSED, WIDTH_REGULAR,
WIDTH_EXTENDEDWIDTH_REGULAR {@link #POSTURE} Number POSTURE_REGULAR, POSTURE_OBLIQUE POSTURE_REGULAR {@link #SIZE} Number none 12.0 {@link #TRANSFORM} {@link TransformAttribute} See TransformAttribute {@link TransformAttribute#IDENTITY IDENTITY} TransformAttribute.IDENTITY {@link #SUPERSCRIPT} Integer SUPERSCRIPT_SUPER, SUPERSCRIPT_SUB 0 (use the standard glyphs and metrics) {@link #FONT} {@link java.awt.Font} none null (do not override font resolution) {@link #CHAR_REPLACEMENT} {@link GraphicAttribute} none null (draw text using font glyphs) {@link #FOREGROUND} {@link java.awt.Paint} none null (use current graphics paint) {@link #BACKGROUND} {@link java.awt.Paint} none null (do not render background) {@link #UNDERLINE} Integer UNDERLINE_ON -1 (do not render underline) {@link #STRIKETHROUGH} Boolean STRIKETHROUGH_ON false (do not render strikethrough) {@link #RUN_DIRECTION} Boolean RUN_DIRECTION_LTR
RUN_DIRECTION_RTLnull (use {@link java.text.Bidi} standard default) {@link #BIDI_EMBEDDING} Integer none 0 (use base line direction) {@link #JUSTIFICATION} Number JUSTIFICATION_FULL JUSTIFICATION_FULL {@link #INPUT_METHOD_HIGHLIGHT} {@link java.awt.im.InputMethodHighlight},
{@link java.text.Annotation}(see class) null (do not apply input highlighting) {@link #INPUT_METHOD_UNDERLINE} Integer UNDERLINE_LOW_ONE_PIXEL,
UNDERLINE_LOW_TWO_PIXEL-1 (do not render underline) {@link #SWAP_COLORS} Boolean SWAP_COLORS_ON false (do not swap colors) {@link #NUMERIC_SHAPING} {@link java.awt.font.NumericShaper} none null (do not shape digits) {@link #KERNING} Integer KERNING_ON 0 (do not request kerning) {@link #LIGATURES} Integer LIGATURES_ON 0 (do not form optional ligatures) {@link #TRACKING} Number TRACKING_LOOSE, TRACKING_TIGHT 0 (do not add tracking)
Clients usually instantiate object of the class.
This is an attribute that is rendered as text annotation.
@author Edward A. Lee @version $Id: TextAttribute.java,v 1.20 2007/02/04 01:27:59 cxh Exp $ @since Ptolemy II 4.0 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (cxh)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|