public final class

TextAttribute

extends AttributedCharacterIterator.Attribute
java.lang.Object
   ↳java.text.AttributedCharacterIterator.Attribute
    ↳java.awt.font.TextAttribute

Class Overview

The TextAttribute class defines attribute keys and attribute values for text rendering. Each TextAttributes should have the following information:

  • key name;
  • valid values;
  • relevant constants;
  • default action if the attribute is absent;
  • default action's description.

Summary

Constants
TextAttributeBACKGROUNDThe BACKGROUND text attribute.
TextAttributeBIDI_EMBEDDINGThe BIDI_EMBEDDING text attribute key.
TextAttributeCHAR_REPLACEMENTThe CHAR_REPLACEMENT text attribute key.
TextAttributeFAMILYThe FAMILY text attribute key.
TextAttributeFONTThe FONT text attribute key.
TextAttributeFOREGROUNDThe FOREGROUND text attribute key.
TextAttributeINPUT_METHOD_HIGHLIGHTThe INPUT_METHOD_HIGHLIGHT text attribute key.
TextAttributeINPUT_METHOD_UNDERLINEThe INPUT_METHOD_UNDERLINE text attribute key.
TextAttributeJUSTIFICATIONThe JUSTIFICATION text attribute key.
FloatJUSTIFICATION_FULLThe Constant JUSTIFICATION_indicates the full requested width.
FloatJUSTIFICATION_NONEThe Constant JUSTIFICATION_NONE indicates that line is not allowed for justification.
TextAttributeKERNINGThe KERNING text attribute key.
IntegerKERNING_ON
TextAttributeLIGATURESThe LIGATURES text attribute key.
IntegerLIGATURES_ON
TextAttributeNUMERIC_SHAPINGThe NUMERIC_SHAPING text attribute.
TextAttributePOSTUREThe POSTURE text attribute.
FloatPOSTURE_OBLIQUEThe Constant POSTURE_OBLIQUE indicates italic posture.
FloatPOSTURE_REGULARThe Constant POSTURE_REGULAR indicates regular posture.
TextAttributeRUN_DIRECTIONThe RUN_DIRECTION text attribute.
BooleanRUN_DIRECTION_LTRThe Constant RUN_DIRECTION_LTR indicates left-to-right run direction.
BooleanRUN_DIRECTION_RTLThe Constant RUN_DIRECTION_RTL indicates right-to-left run direction.
TextAttributeSIZEThe SIZE text attribute.
TextAttributeSTRIKETHROUGHThe STRIKETHROUGH text attribute.
BooleanSTRIKETHROUGH_ONThe Constant STRIKETHROUGH_ON indicates a single strikethrough.
TextAttributeSUPERSCRIPTThe SUPERSCRIPT text attribute.
IntegerSUPERSCRIPT_SUBThe Constant SUPERSCRIPT_SUB indicates a standard subscript.
IntegerSUPERSCRIPT_SUPERThe Constant SUPERSCRIPT_SUPER indicates a standard superscript.
TextAttributeSWAP_COLORSThe SWAP_COLORS text attribute.
BooleanSWAP_COLORS_ONThe Constant SWAP_COLORS_ON indicates a swap of foreground and background.
TextAttributeTRACKINGThe TRACKING text attribute key.
FloatTRACKING_LOOSE
FloatTRACKING_TIGHT
TextAttributeTRANSFORMThe TRANSFORM text attribute.
TextAttributeUNDERLINEThe Constant UNDERLINE text attribute.
IntegerUNDERLINE_LOW_DASHEDThe Constant UNDERLINE_LOW_DASHED indicates single pixel dashed low underline.
IntegerUNDERLINE_LOW_DOTTEDThe Constant UNDERLINE_LOW_DOTTED indicates a single pixel dotted low underline.
IntegerUNDERLINE_LOW_GRAYThe Constant UNDERLINE_LOW_GRAY indicates double pixel gray low underline.
IntegerUNDERLINE_LOW_ONE_PIXELThe Constant UNDERLINE_LOW_ONE_PIXEL indicates a single pixel solid low underline.
IntegerUNDERLINE_LOW_TWO_PIXELThe Constant UNDERLINE_LOW_TWO_PIXEL indicates a double pixel solid low underline.
IntegerUNDERLINE_ONThe Constant UNDERLINE_ON indicates a standard underline at the roman baseline for roman text.
TextAttributeWEIGHTThe WEIGHT text attribute.
FloatWEIGHT_BOLDThe Constant WEIGHT_BOLD indicates the standard bold weight.
FloatWEIGHT_DEMIBOLDThe Constant WEIGHT_DEMIBOLD indicates a lighter weight than BOLD.
FloatWEIGHT_DEMILIGHTThe Constant WEIGHT_DEMILIGHT indicates an intermediate weight between LIGHT and STANDARD.
FloatWEIGHT_EXTRABOLDThe Constant WEIGHT_EXTRABOLD indicates an extra heavy weight.
FloatWEIGHT_EXTRA_LIGHTThe Constant WEIGHT_EXTRA_LIGHT indicates the lightest predefined weight.
FloatWEIGHT_HEAVYThe Constant WEIGHT_HEAVY indicates a heavier weight than BOLD.
FloatWEIGHT_LIGHTThe Constant WEIGHT_LIGHT indicates the standard light weight.
FloatWEIGHT_MEDIUMThe Constant WEIGHT_MEDIUM indicates average weight between the REGULAR and BOLD.
FloatWEIGHT_REGULARThe Constant WEIGHT_REGULAR indicates the standart weight.
FloatWEIGHT_SEMIBOLDThe Constant WEIGHT_SEMIBOLD indicates a semi weight of REGULAR.
FloatWEIGHT_ULTRABOLDThe Constant WEIGHT_ULTRABOLD indicates the heaviest predefined weight.
TextAttributeWIDTHThe WIDTH text attribute.
FloatWIDTH_CONDENSEDThe Constant WIDTH_CONDENSED indicates the most condensed predefined width.
FloatWIDTH_EXTENDEDThe Constant WIDTH_EXTENDED indicates extended width.
FloatWIDTH_REGULARThe Constant WIDTH_REGULAR indicates the standard width.
FloatWIDTH_SEMI_CONDENSEDThe Constant WIDTH_SEMI_CONDENSED indicates a semi condensed width.
FloatWIDTH_SEMI_EXTENDEDThe Constant WIDTH_SEMI_EXTENDED indicates semi extended width.
[Expand]
Inherited Constants
From class java.text.AttributedCharacterIterator.Attribute
Protected Constructors
TextAttribute(String name)
Instantiates a new TextAttribute with the specified name.
Protected Methods
Object readResolve()
Resolves the instance being deserialized.
[Expand]
Inherited Methods
From class java.text.AttributedCharacterIterator.Attribute
From class java.lang.Object

Constants

public static final TextAttribute BACKGROUND

Since: API Level 1

The BACKGROUND text attribute.

public static final TextAttribute BIDI_EMBEDDING

Since: API Level 1

The BIDI_EMBEDDING text attribute key.

public static final TextAttribute CHAR_REPLACEMENT

Since: API Level 1

The CHAR_REPLACEMENT text attribute key.

public static final TextAttribute FAMILY

Since: API Level 1

The FAMILY text attribute key.

public static final TextAttribute FONT

Since: API Level 1

The FONT text attribute key.

public static final TextAttribute FOREGROUND

Since: API Level 1

The FOREGROUND text attribute key.

public static final TextAttribute INPUT_METHOD_HIGHLIGHT

Since: API Level 1

The INPUT_METHOD_HIGHLIGHT text attribute key.

public static final TextAttribute INPUT_METHOD_UNDERLINE

Since: API Level 1

The INPUT_METHOD_UNDERLINE text attribute key.

public static final TextAttribute JUSTIFICATION

Since: API Level 1

The JUSTIFICATION text attribute key.

public static final Float JUSTIFICATION_FULL

Since: API Level 1

The Constant JUSTIFICATION_indicates the full requested width.

public static final Float JUSTIFICATION_NONE

Since: API Level 1

The Constant JUSTIFICATION_NONE indicates that line is not allowed for justification.

public static final TextAttribute KERNING

Since: API Level 9

The KERNING text attribute key.

public static final Integer KERNING_ON

Since: API Level 9

public static final TextAttribute LIGATURES

Since: API Level 9

The LIGATURES text attribute key.

public static final Integer LIGATURES_ON

Since: API Level 9

public static final TextAttribute NUMERIC_SHAPING

Since: API Level 1

The NUMERIC_SHAPING text attribute.

public static final TextAttribute POSTURE

Since: API Level 1

The POSTURE text attribute.

public static final Float POSTURE_OBLIQUE

Since: API Level 1

The Constant POSTURE_OBLIQUE indicates italic posture.

public static final Float POSTURE_REGULAR

Since: API Level 1

The Constant POSTURE_REGULAR indicates regular posture.

public static final TextAttribute RUN_DIRECTION

Since: API Level 1

The RUN_DIRECTION text attribute.

public static final Boolean RUN_DIRECTION_LTR

Since: API Level 1

The Constant RUN_DIRECTION_LTR indicates left-to-right run direction.

public static final Boolean RUN_DIRECTION_RTL

Since: API Level 1

The Constant RUN_DIRECTION_RTL indicates right-to-left run direction.

public static final TextAttribute SIZE

Since: API Level 1

The SIZE text attribute.

public static final TextAttribute STRIKETHROUGH

Since: API Level 1

The STRIKETHROUGH text attribute.

public static final Boolean STRIKETHROUGH_ON

Since: API Level 1

The Constant STRIKETHROUGH_ON indicates a single strikethrough.

public static final TextAttribute SUPERSCRIPT

Since: API Level 1

The SUPERSCRIPT text attribute.

public static final Integer SUPERSCRIPT_SUB

Since: API Level 1

The Constant SUPERSCRIPT_SUB indicates a standard subscript.

public static final Integer SUPERSCRIPT_SUPER

Since: API Level 1

The Constant SUPERSCRIPT_SUPER indicates a standard superscript.

public static final TextAttribute SWAP_COLORS

Since: API Level 1

The SWAP_COLORS text attribute.

public static final Boolean SWAP_COLORS_ON

Since: API Level 1

The Constant SWAP_COLORS_ON indicates a swap of foreground and background.

public static final TextAttribute TRACKING

Since: API Level 9

The TRACKING text attribute key.

public static final Float TRACKING_LOOSE

Since: API Level 9

public static final Float TRACKING_TIGHT

Since: API Level 9

public static final TextAttribute TRANSFORM

Since: API Level 1

The TRANSFORM text attribute.

public static final TextAttribute UNDERLINE

Since: API Level 1

The Constant UNDERLINE text attribute.

public static final Integer UNDERLINE_LOW_DASHED

Since: API Level 1

The Constant UNDERLINE_LOW_DASHED indicates single pixel dashed low underline.

public static final Integer UNDERLINE_LOW_DOTTED

Since: API Level 1

The Constant UNDERLINE_LOW_DOTTED indicates a single pixel dotted low underline.

public static final Integer UNDERLINE_LOW_GRAY

Since: API Level 1

The Constant UNDERLINE_LOW_GRAY indicates double pixel gray low underline.

public static final Integer UNDERLINE_LOW_ONE_PIXEL

Since: API Level 1

The Constant UNDERLINE_LOW_ONE_PIXEL indicates a single pixel solid low underline.

public static final Integer UNDERLINE_LOW_TWO_PIXEL

Since: API Level 1

The Constant UNDERLINE_LOW_TWO_PIXEL indicates a double pixel solid low underline.

public static final Integer UNDERLINE_ON

Since: API Level 1

The Constant UNDERLINE_ON indicates a standard underline at the roman baseline for roman text.

public static final TextAttribute WEIGHT

Since: API Level 1

The WEIGHT text attribute.

public static final Float WEIGHT_BOLD

Since: API Level 1

The Constant WEIGHT_BOLD indicates the standard bold weight.

public static final Float WEIGHT_DEMIBOLD

Since: API Level 1

The Constant WEIGHT_DEMIBOLD indicates a lighter weight than BOLD.

public static final Float WEIGHT_DEMILIGHT

Since: API Level 1

The Constant WEIGHT_DEMILIGHT indicates an intermediate weight between LIGHT and STANDARD.

public static final Float WEIGHT_EXTRABOLD

Since: API Level 1

The Constant WEIGHT_EXTRABOLD indicates an extra heavy weight.

public static final Float WEIGHT_EXTRA_LIGHT

Since: API Level 1

The Constant WEIGHT_EXTRA_LIGHT indicates the lightest predefined weight.

public static final Float WEIGHT_HEAVY

Since: API Level 1

The Constant WEIGHT_HEAVY indicates a heavier weight than BOLD.

public static final Float WEIGHT_LIGHT

Since: API Level 1

The Constant WEIGHT_LIGHT indicates the standard light weight.

public static final Float WEIGHT_MEDIUM

Since: API Level 1

The Constant WEIGHT_MEDIUM indicates average weight between the REGULAR and BOLD.

public static final Float WEIGHT_REGULAR

Since: API Level 1

The Constant WEIGHT_REGULAR indicates the standart weight.

public static final Float WEIGHT_SEMIBOLD

Since: API Level 1

The Constant WEIGHT_SEMIBOLD indicates a semi weight of REGULAR.

public static final Float WEIGHT_ULTRABOLD

Since: API Level 1

The Constant WEIGHT_ULTRABOLD indicates the heaviest predefined weight.

public static final TextAttribute WIDTH

Since: API Level 1

The WIDTH text attribute.

public static final Float WIDTH_CONDENSED

Since: API Level 1

The Constant WIDTH_CONDENSED indicates the most condensed predefined width.

public static final Float WIDTH_EXTENDED

Since: API Level 1

The Constant WIDTH_EXTENDED indicates extended width.

public static final Float WIDTH_REGULAR

Since: API Level 1

The Constant WIDTH_REGULAR indicates the standard width.

public static final Float WIDTH_SEMI_CONDENSED

Since: API Level 1

The Constant WIDTH_SEMI_CONDENSED indicates a semi condensed width.

public static final Float WIDTH_SEMI_EXTENDED

Since: API Level 1

The Constant WIDTH_SEMI_EXTENDED indicates semi extended width.

Protected Constructors

protected TextAttribute (String name)

Since: API Level 1

Instantiates a new TextAttribute with the specified name.

Parameters
name the name of TextAttribute.

Protected Methods

protected Object readResolve ()

Since: API Level 1

Resolves the instance being deserialized.

Returns
  • the Object.
Throws
InvalidObjectException the InvalidObjectException.