Skip to content

Most visited

Recently visited

navigation
Added in API level 1

TextAttribute

public final class TextAttribute
extends AttributedCharacterIterator.Attribute

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


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

Summary

Fields

public static final TextAttribute BACKGROUND

The BACKGROUND text attribute.

public static final TextAttribute BIDI_EMBEDDING

The BIDI_EMBEDDING text attribute key.

public static final TextAttribute CHAR_REPLACEMENT

The CHAR_REPLACEMENT text attribute key.

public static final TextAttribute FAMILY

The FAMILY text attribute key.

public static final TextAttribute FONT

The FONT text attribute key.

public static final TextAttribute FOREGROUND

The FOREGROUND text attribute key.

public static final TextAttribute INPUT_METHOD_HIGHLIGHT

The INPUT_METHOD_HIGHLIGHT text attribute key.

public static final TextAttribute INPUT_METHOD_UNDERLINE

The INPUT_METHOD_UNDERLINE text attribute key.

public static final TextAttribute JUSTIFICATION

The JUSTIFICATION text attribute key.

public static final Float JUSTIFICATION_FULL

The Constant JUSTIFICATION_indicates the full requested width.

public static final Float JUSTIFICATION_NONE

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

public static final TextAttribute KERNING

The KERNING text attribute key.

public static final Integer KERNING_ON

public static final TextAttribute LIGATURES

The LIGATURES text attribute key.

public static final Integer LIGATURES_ON

public static final TextAttribute NUMERIC_SHAPING

The NUMERIC_SHAPING text attribute.

public static final TextAttribute POSTURE

The POSTURE text attribute.

public static final Float POSTURE_OBLIQUE

The Constant POSTURE_OBLIQUE indicates italic posture.

public static final Float POSTURE_REGULAR

The Constant POSTURE_REGULAR indicates regular posture.

public static final TextAttribute RUN_DIRECTION

The RUN_DIRECTION text attribute.

public static final Boolean RUN_DIRECTION_LTR

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

public static final Boolean RUN_DIRECTION_RTL

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

public static final TextAttribute SIZE

The SIZE text attribute.

public static final TextAttribute STRIKETHROUGH

The STRIKETHROUGH text attribute.

public static final Boolean STRIKETHROUGH_ON

The Constant STRIKETHROUGH_ON indicates a single strikethrough.

public static final TextAttribute SUPERSCRIPT

The SUPERSCRIPT text attribute.

public static final Integer SUPERSCRIPT_SUB

The Constant SUPERSCRIPT_SUB indicates a standard subscript.

public static final Integer SUPERSCRIPT_SUPER

The Constant SUPERSCRIPT_SUPER indicates a standard superscript.

public static final TextAttribute SWAP_COLORS

The SWAP_COLORS text attribute.

public static final Boolean SWAP_COLORS_ON

The Constant SWAP_COLORS_ON indicates a swap of foreground and background.

public static final TextAttribute TRACKING

The TRACKING text attribute key.

public static final Float TRACKING_LOOSE

public static final Float TRACKING_TIGHT

public static final TextAttribute TRANSFORM

The TRANSFORM text attribute.

public static final TextAttribute UNDERLINE

The Constant UNDERLINE text attribute.

public static final Integer UNDERLINE_LOW_DASHED

The Constant UNDERLINE_LOW_DASHED indicates single pixel dashed low underline.

public static final Integer UNDERLINE_LOW_DOTTED

The Constant UNDERLINE_LOW_DOTTED indicates a single pixel dotted low underline.

public static final Integer UNDERLINE_LOW_GRAY

The Constant UNDERLINE_LOW_GRAY indicates double pixel gray low underline.

public static final Integer UNDERLINE_LOW_ONE_PIXEL

The Constant UNDERLINE_LOW_ONE_PIXEL indicates a single pixel solid low underline.

public static final Integer UNDERLINE_LOW_TWO_PIXEL

The Constant UNDERLINE_LOW_TWO_PIXEL indicates a double pixel solid low underline.

public static final Integer UNDERLINE_ON

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

public static final TextAttribute WEIGHT

The WEIGHT text attribute.

public static final Float WEIGHT_BOLD

The Constant WEIGHT_BOLD indicates the standard bold weight.

public static final Float WEIGHT_DEMIBOLD

The Constant WEIGHT_DEMIBOLD indicates a lighter weight than BOLD.

public static final Float WEIGHT_DEMILIGHT

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

public static final Float WEIGHT_EXTRABOLD

The Constant WEIGHT_EXTRABOLD indicates an extra heavy weight.

public static final Float WEIGHT_EXTRA_LIGHT

The Constant WEIGHT_EXTRA_LIGHT indicates the lightest predefined weight.

public static final Float WEIGHT_HEAVY

The Constant WEIGHT_HEAVY indicates a heavier weight than BOLD.

public static final Float WEIGHT_LIGHT

The Constant WEIGHT_LIGHT indicates the standard light weight.

public static final Float WEIGHT_MEDIUM

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

public static final Float WEIGHT_REGULAR

The Constant WEIGHT_REGULAR indicates the standart weight.

public static final Float WEIGHT_SEMIBOLD

The Constant WEIGHT_SEMIBOLD indicates a semi weight of REGULAR.

public static final Float WEIGHT_ULTRABOLD

The Constant WEIGHT_ULTRABOLD indicates the heaviest predefined weight.

public static final TextAttribute WIDTH

The WIDTH text attribute.

public static final Float WIDTH_CONDENSED

The Constant WIDTH_CONDENSED indicates the most condensed predefined width.

public static final Float WIDTH_EXTENDED

The Constant WIDTH_EXTENDED indicates extended width.

public static final Float WIDTH_REGULAR

The Constant WIDTH_REGULAR indicates the standard width.

public static final Float WIDTH_SEMI_CONDENSED

The Constant WIDTH_SEMI_CONDENSED indicates a semi condensed width.

public static final Float WIDTH_SEMI_EXTENDED

The Constant WIDTH_SEMI_EXTENDED indicates semi extended width.

Inherited fields

From class java.text.AttributedCharacterIterator.Attribute

Protected constructors

TextAttribute(String name)

Instantiates a new TextAttribute with the specified name.

Inherited methods

From class java.text.AttributedCharacterIterator.Attribute
From class java.lang.Object

Fields

BACKGROUND

Added in API level 1
TextAttribute BACKGROUND

The BACKGROUND text attribute.

BIDI_EMBEDDING

Added in API level 1
TextAttribute BIDI_EMBEDDING

The BIDI_EMBEDDING text attribute key.

CHAR_REPLACEMENT

Added in API level 1
TextAttribute CHAR_REPLACEMENT

The CHAR_REPLACEMENT text attribute key.

FAMILY

Added in API level 1
TextAttribute FAMILY

The FAMILY text attribute key.

FONT

Added in API level 1
TextAttribute FONT

The FONT text attribute key.

FOREGROUND

Added in API level 1
TextAttribute FOREGROUND

The FOREGROUND text attribute key.

INPUT_METHOD_HIGHLIGHT

Added in API level 1
TextAttribute INPUT_METHOD_HIGHLIGHT

The INPUT_METHOD_HIGHLIGHT text attribute key.

INPUT_METHOD_UNDERLINE

Added in API level 1
TextAttribute INPUT_METHOD_UNDERLINE

The INPUT_METHOD_UNDERLINE text attribute key.

JUSTIFICATION

Added in API level 1
TextAttribute JUSTIFICATION

The JUSTIFICATION text attribute key.

JUSTIFICATION_FULL

Added in API level 1
Float JUSTIFICATION_FULL

The Constant JUSTIFICATION_indicates the full requested width.

JUSTIFICATION_NONE

Added in API level 1
Float JUSTIFICATION_NONE

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

KERNING

Added in API level 9
TextAttribute KERNING

The KERNING text attribute key.

KERNING_ON

Added in API level 9
Integer KERNING_ON

LIGATURES

Added in API level 9
TextAttribute LIGATURES

The LIGATURES text attribute key.

LIGATURES_ON

Added in API level 9
Integer LIGATURES_ON

NUMERIC_SHAPING

Added in API level 1
TextAttribute NUMERIC_SHAPING

The NUMERIC_SHAPING text attribute.

POSTURE

Added in API level 1
TextAttribute POSTURE

The POSTURE text attribute.

POSTURE_OBLIQUE

Added in API level 1
Float POSTURE_OBLIQUE

The Constant POSTURE_OBLIQUE indicates italic posture.

POSTURE_REGULAR

Added in API level 1
Float POSTURE_REGULAR

The Constant POSTURE_REGULAR indicates regular posture.

RUN_DIRECTION

Added in API level 1
TextAttribute RUN_DIRECTION

The RUN_DIRECTION text attribute.

RUN_DIRECTION_LTR

Added in API level 1
Boolean RUN_DIRECTION_LTR

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

RUN_DIRECTION_RTL

Added in API level 1
Boolean RUN_DIRECTION_RTL

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

SIZE

Added in API level 1
TextAttribute SIZE

The SIZE text attribute.

STRIKETHROUGH

Added in API level 1
TextAttribute STRIKETHROUGH

The STRIKETHROUGH text attribute.

STRIKETHROUGH_ON

Added in API level 1
Boolean STRIKETHROUGH_ON

The Constant STRIKETHROUGH_ON indicates a single strikethrough.

SUPERSCRIPT

Added in API level 1
TextAttribute SUPERSCRIPT

The SUPERSCRIPT text attribute.

SUPERSCRIPT_SUB

Added in API level 1
Integer SUPERSCRIPT_SUB

The Constant SUPERSCRIPT_SUB indicates a standard subscript.

SUPERSCRIPT_SUPER

Added in API level 1
Integer SUPERSCRIPT_SUPER

The Constant SUPERSCRIPT_SUPER indicates a standard superscript.

SWAP_COLORS

Added in API level 1
TextAttribute SWAP_COLORS

The SWAP_COLORS text attribute.

SWAP_COLORS_ON

Added in API level 1
Boolean SWAP_COLORS_ON

The Constant SWAP_COLORS_ON indicates a swap of foreground and background.

TRACKING

Added in API level 9
TextAttribute TRACKING

The TRACKING text attribute key.

TRACKING_LOOSE

Added in API level 9
Float TRACKING_LOOSE

TRACKING_TIGHT

Added in API level 9
Float TRACKING_TIGHT

TRANSFORM

Added in API level 1
TextAttribute TRANSFORM

The TRANSFORM text attribute.

UNDERLINE

Added in API level 1
TextAttribute UNDERLINE

The Constant UNDERLINE text attribute.

UNDERLINE_LOW_DASHED

Added in API level 1
Integer UNDERLINE_LOW_DASHED

The Constant UNDERLINE_LOW_DASHED indicates single pixel dashed low underline.

UNDERLINE_LOW_DOTTED

Added in API level 1
Integer UNDERLINE_LOW_DOTTED

The Constant UNDERLINE_LOW_DOTTED indicates a single pixel dotted low underline.

UNDERLINE_LOW_GRAY

Added in API level 1
Integer UNDERLINE_LOW_GRAY

The Constant UNDERLINE_LOW_GRAY indicates double pixel gray low underline.

UNDERLINE_LOW_ONE_PIXEL

Added in API level 1
Integer UNDERLINE_LOW_ONE_PIXEL

The Constant UNDERLINE_LOW_ONE_PIXEL indicates a single pixel solid low underline.

UNDERLINE_LOW_TWO_PIXEL

Added in API level 1
Integer UNDERLINE_LOW_TWO_PIXEL

The Constant UNDERLINE_LOW_TWO_PIXEL indicates a double pixel solid low underline.

UNDERLINE_ON

Added in API level 1
Integer UNDERLINE_ON

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

WEIGHT

Added in API level 1
TextAttribute WEIGHT

The WEIGHT text attribute.

WEIGHT_BOLD

Added in API level 1
Float WEIGHT_BOLD

The Constant WEIGHT_BOLD indicates the standard bold weight.

WEIGHT_DEMIBOLD

Added in API level 1
Float WEIGHT_DEMIBOLD

The Constant WEIGHT_DEMIBOLD indicates a lighter weight than BOLD.

WEIGHT_DEMILIGHT

Added in API level 1
Float WEIGHT_DEMILIGHT

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

WEIGHT_EXTRABOLD

Added in API level 1
Float WEIGHT_EXTRABOLD

The Constant WEIGHT_EXTRABOLD indicates an extra heavy weight.

WEIGHT_EXTRA_LIGHT

Added in API level 1
Float WEIGHT_EXTRA_LIGHT

The Constant WEIGHT_EXTRA_LIGHT indicates the lightest predefined weight.

WEIGHT_HEAVY

Added in API level 1
Float WEIGHT_HEAVY

The Constant WEIGHT_HEAVY indicates a heavier weight than BOLD.

WEIGHT_LIGHT

Added in API level 1
Float WEIGHT_LIGHT

The Constant WEIGHT_LIGHT indicates the standard light weight.

WEIGHT_MEDIUM

Added in API level 1
Float WEIGHT_MEDIUM

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

WEIGHT_REGULAR

Added in API level 1
Float WEIGHT_REGULAR

The Constant WEIGHT_REGULAR indicates the standart weight.

WEIGHT_SEMIBOLD

Added in API level 1
Float WEIGHT_SEMIBOLD

The Constant WEIGHT_SEMIBOLD indicates a semi weight of REGULAR.

WEIGHT_ULTRABOLD

Added in API level 1
Float WEIGHT_ULTRABOLD

The Constant WEIGHT_ULTRABOLD indicates the heaviest predefined weight.

WIDTH

Added in API level 1
TextAttribute WIDTH

The WIDTH text attribute.

WIDTH_CONDENSED

Added in API level 1
Float WIDTH_CONDENSED

The Constant WIDTH_CONDENSED indicates the most condensed predefined width.

WIDTH_EXTENDED

Added in API level 1
Float WIDTH_EXTENDED

The Constant WIDTH_EXTENDED indicates extended width.

WIDTH_REGULAR

Added in API level 1
Float WIDTH_REGULAR

The Constant WIDTH_REGULAR indicates the standard width.

WIDTH_SEMI_CONDENSED

Added in API level 1
Float WIDTH_SEMI_CONDENSED

The Constant WIDTH_SEMI_CONDENSED indicates a semi condensed width.

WIDTH_SEMI_EXTENDED

Added in API level 1
Float WIDTH_SEMI_EXTENDED

The Constant WIDTH_SEMI_EXTENDED indicates semi extended width.

Protected constructors

TextAttribute

Added in API level 1
TextAttribute (String name)

Instantiates a new TextAttribute with the specified name.

Parameters
name String: the name of TextAttribute.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.