Options
All
  • Public
  • Public/Protected
  • All
Menu

Module markup

Classes and functions that can be used to create markup boxes. A markup box is used to render component text in a rectangular area of a component face. The text is styled, and can include HTML-like markup to add styles, images, headings, and other features.

Include this library by adding useLibrary("markup") to your script. See the plug-in authoring kit for examples that use this library.

Index

Type aliases

BGCOLOR

BGCOLOR: BGPAINT

Synonym for BGPAINT.

BGCOLOUR

BGCOLOUR: BGPAINT

Synonym for BGPAINT.

BGPAINT

BGPAINT: any

A Paint instance (which includes colours) that specifies the background colour of text.

COLOR

COLOR: BGPAINT

Synonym for PAINT.

COLOUR

COLOUR: BGPAINT

Synonym for PAINT.

FAMILY

FAMILY: any

The value of this attribute is a string that names the font family to be used. The following "standard family names" are defined for convenience:

FAMILY_BODY the standard Strange Eons body text font, if the core fonts library is installed (and otherwise a stand-in font) FAMILY_SERIF a default serif family FAMILY_SANS_SERIF a default sans-serif family FAMILY_MONOSPACED a default monospace family

FONT_OBJECT

FONT_OBJECT: any

The value of this attribute is a java.awt.Font instance that specifies an exact font to use.

LIGATURES

LIGATURES: any

The value of this attribute controls whether ligature replacement is performed.

PAINT

PAINT: any

A Paint instance (which includes colours) that specifies the foreground colour of text.

POSTURE

POSTURE: any

The value of this attribute controls the text posture (such as italic).

SIZE

SIZE: any

The value of this attribute is a number controlling the point size of text.

STRIKETHROUGH

STRIKETHROUGH: any

The value of this attribute controls the text strikethrough effect.

SUPERSCRIPT

SUPERSCRIPT: any

The value of this attribute is an integer number indicating the number super- or subscript levels should be in effect. It is normally 0; positive numbers indicate superscript levels while negative numbers indicate subscript levels.

SWAP_COLORS

SWAP_COLORS: any

The value of this attribute controls whether foreground and background paint are swapped.

SWAP_COLOURS

SWAP_COLOURS: SWAP_COLORS

Synonym for SWAP_COLORS.

StyleKey

The possible style keys.

TRACKING

TRACKING: any

The value of this attribute is a number that controls tracking (spacing between letters). A value of 0 provides standard spacing; positive values increase inter-letter spacing, while negative values move letters closer together.

TextAttribute

UNDERLINE

UNDERLINE: any

The value of this attribute controls text underlining.

WEIGHT

WEIGHT: any

The value of this attribute controls the text weight.

Note: The effectiveness of this attribute relies on underlying support from the platform and JRE. Some weights may have no effect. (The regular and bold weights should always be available.)

WIDTH

WIDTH: any

The value of this attribute controls the text width.

Variables

Const FAMILY_BODY

FAMILY_BODY: any

A predefined value for the FAMILY style that results in the standard Strange Eons body text font.

Const FAMILY_MONOSPACED

FAMILY_MONOSPACED: any

A predefined value for the FAMILY style that results in a monospace/typewriter type font family

Const FAMILY_SANS_SERIF

FAMILY_SANS_SERIF: any

A predefined value for the FAMILY style that results in a sans serif font family.

Const FAMILY_SERIF

FAMILY_SERIF: any

A predefined value for the FAMILY style that results in a serif font family.

Const FIT_BOTH

FIT_BOTH: number

Fit text by shrinking it and reducing the space between lines.

Const FIT_NONE

FIT_NONE: number

Do not try to fit text that is too long to fit in the given region.

Const FIT_SCALE_TEXT

FIT_SCALE_TEXT: number

Fit long text by shrinking it down.

Const FIT_TIGHTEN_LINE_SPACING

FIT_TIGHTEN_LINE_SPACING: number

Fit long text by reducing line spacing.

Const LAYOUT_BOTTOM

LAYOUT_BOTTOM: number

Vertically align text to the bottom of the region.

Const LAYOUT_CENTER

LAYOUT_CENTER: number

Center lines of text.

Const LAYOUT_JUSTIFY

LAYOUT_JUSTIFY: number

Lines will be justified to fit the width of the region.

Const LAYOUT_LEFT

LAYOUT_LEFT: number

Left-align lines of text.

Const LAYOUT_MIDDLE

LAYOUT_MIDDLE: number

Vertically center text within the region.

Const LAYOUT_RIGHT

LAYOUT_RIGHT: number

Right-align lines of text.

Const LAYOUT_TOP

LAYOUT_TOP: number

Vertically align text to the top of the region.

Const LIGATURES_ON

LIGATURES_ON: any

A predefined value for the LIGATURES style that enables ligature replacement.

Const POSTURE_OBLIQUE

POSTURE_OBLIQUE: any

A predefined value for the POSTURE style. This is italic or slanted text.

Const POSTURE_REGULAR

POSTURE_REGULAR: any

A predefined value for the POSTURE style. This is standard upright text.

Const STRIKETHROUGH_ON

STRIKETHROUGH_ON: any

A predefined value for the STRIKETHROUGH style that enables strikethrough.

Const SUPERSCRIPT_SUB

SUPERSCRIPT_SUB: any

A predefined value for the SUPERSCRIPT style indicating one level of subscript.

Const SUPERSCRIPT_SUPER

SUPERSCRIPT_SUPER: any

A predefined value for the SUPERSCRIPT style indicating one level of superscript.

Const SWAP_COLORS_ON

SWAP_COLORS_ON: any

A predefined value for the SWAP_COLORS style that enables swapping.

Const SWAP_COLOURS_ON

SWAP_COLOURS_ON: any

Synonym for SWAP_COLORS_ON.

Const TRACKING_LOOSE

TRACKING_LOOSE: any

A predefined value for the TRACKING style that results in looser than normal tracking.

Const TRACKING_TIGHT

TRACKING_TIGHT: any

A predefined value for the TRACKING style that results in tighter than normal tracking.

Const UNDERLINE_ON

UNDERLINE_ON: any

A predefined value for the UNDERLINE style that enables an underline effect.

Const WEIGHT_BOLD

WEIGHT_BOLD: any

A predefined value for the WEIGHT style.

Const WEIGHT_DEMIBOLD

WEIGHT_DEMIBOLD: any

A predefined value for the WEIGHT style.

Const WEIGHT_DEMILIGHT

WEIGHT_DEMILIGHT: any

A predefined value for the WEIGHT style.

Const WEIGHT_EXTRABOLD

WEIGHT_EXTRABOLD: any

A predefined value for the WEIGHT style.

Const WEIGHT_EXTRALIGHT

WEIGHT_EXTRALIGHT: any

A predefined value for the WEIGHT style.

Const WEIGHT_HEAVY

WEIGHT_HEAVY: any

A predefined value for the WEIGHT style.

Const WEIGHT_LIGHT

WEIGHT_LIGHT: any

A predefined value for the WEIGHT style.

Const WEIGHT_MEDIUM

WEIGHT_MEDIUM: any

A predefined value for the WEIGHT style.

Const WEIGHT_REGULAR

WEIGHT_REGULAR: any

A predefined value for the WEIGHT style. This is the default weight.

Const WEIGHT_SEMIBOLD

WEIGHT_SEMIBOLD: any

A predefined value for the WEIGHT style.

Const WEIGHT_ULTRABOLD

WEIGHT_ULTRABOLD: any

A predefined value for the WEIGHT style.

Const WIDTH_CONDENSED

WIDTH_CONDENSED: any

A predefined value for the WIDTH style.

Const WIDTH_EXTENDED

WIDTH_EXTENDED: any

A predefined value for the WIDTH style.

Const WIDTH_REGULAR

WIDTH_REGULAR: any

A predefined value for the WIDTH style. This is the default width.

Const WIDTH_SEMICONDENSED

WIDTH_SEMICONDENSED: any

A predefined value for the WIDTH style.

Const WIDTH_SEMIEXTENDED

WIDTH_SEMIEXTENDED: any

A predefined value for the WIDTH style.

Functions

markupBox

  • Creates a new markup renderer that can lay out text marked up with Strange Eons tags. The renderer will be set up for use with a particular component sheet, typically a DIY card face.

    Parameters

    Returns MarkupBox | GenderMarkupBox

  • Creates a new markup renderer that is optimized to lay out text marked up with Strange Eons tags in a graphics context of the specified target resolution.

    Parameters

    • ppi: number

      the target resolution

    • Optional genderAware: boolean

      if true, a GenderMarkupBox is returned

    Returns MarkupBox | GenderMarkupBox

updateNameTags

  • Updates a box's <name>, <lastname>, and <fullname> tags using a component's current name. Call this at the start of your painting function before drawing a box's text if you want name tags to work properly. This function sets the name automatically using the text of the component's name property. For more complete control, use the Sheet class's setNamesForRenderer(markupBox, firstName, lastName, fullName) method.

    Parameters

    Returns void