The TextFormat object represents character formatting information. Use the TextFormat object to create specific text formatting for text fields. You can apply text formatting to both static and dynamic text fields. The properties of the TextFormat object apply to device and embedded fonts. 

You must use the constructor "new" TextFormat() to create a TextFormat object before setting its properties. When you apply a TextFormat object to a text field using the TextField.defaultTextFormat property or the TextField.setTextFormat() method, only its defined properties are applied. Use the TextField.defaultTextFormat property to apply formatting BEFORE you add text to the TextField, and the setTextFormat() method to add formatting AFTER you add text to the TextField. The TextFormat properties are nil by default because if you don't provide values for the properties, application uses its own default formatting.


Can be created with method new:

Lib.Media.Text.TextFormat.new(font, size, color, bold, italic, underline)

Creates a TextFormat object with the specified properties.

font - (default = nil) - The name of a font for text as a string.

size - (default = nil) - An integer that indicates the size in pixels.

color - (default = nil) - The color of text using this text format. A number containing three 8-bit RGB components; for example, 0xFF0000 is red, and 0x00FF00 is green.

bold - (default = nil) - A Boolean value that indicates whether the text is boldface.

italic - (default = nil) - A Boolean value that indicates whether the text is italicized.

underline - (default = nil) - A Boolean value that indicates whether the text is underlined.


Created TextFormat object has properties:

align

Indicates the alignment of the paragraph. (TextFormatAlign)

blockIndent

Indicates the block indentation in pixels.

bold

Specifies whether the text is boldface.

bullet

Indicates that the text is part of a bulleted list. (not supported)

color

Indicates the color of the text.

font

The name of the font for text in this text format, as a string.

indent

Indicates the indentation from the left margin to the first character in the paragraph.

italic

Indicates whether text in this text format is italicized.

kerning

A Boolean value that indicates whether kerning is enabled (true) or disabled (false).

leading

An integer representing the amount of vertical space (called leading) between lines.

leftMargin

The left margin of the paragraph, in pixels.

letterSpacing

A number representing the amount of space that is uniformly distributed between all characters.

outline

Number. The border radius. This generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the 'outside' borders of the stroke.

This can be useful to generate 'bordered' glyph, i.e., glyphs displayed with anti-aliased border around their shape.

outlineFlags

Available flags:

Lib.Media.Text.TextFormat.OUTLINE_END_SQUARE - The end of lines is rendered as a square around the last point (by default half-circle around the last point)

Lib.Media.Text.TextFormat.OUTLINE_EDGE_BEVEL - Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke.

Lib.Media.Text.TextFormat.OUTLINE_EDGE_MITER - Used to render mitered line joins, with variable bevels if the miter limit is exceeded. The intersection of the strokes is clipped at a line perpendicular to the bisector of the angle between the strokes, at the distance from the intersection of the segments equal to the product of the miter limit value and the border radius. This prevents long spikes being created.


If outline edge flags not specified then rounded joins used by default. Circular arcs are used to join two lines smoothly.

outlineMiterLimit

Number. The miter limit for the mitter line join styles

rightMargin

The right margin of the paragraph, in pixels.

size

The size in pixels of text in this text format.

tabStops

Specifies custom tab stops as an array of non-negative integers.

target

Indicates the target window where the hyperlink is displayed. (not supported)

underline

Indicates whether the text that uses this text format is underlined (true) or not (false).

url

Indicates the target URL for the text in this text format.

lineThrough

strikethrough (horizontal line) over text. true/false

baselineShift

String value, can be "superscript" or "subscript". Superscript text appears above the normal line, and rendered in a smaller font. Subscript text appears below the normal line, and rendered in a smaller font


Created with the Personal Edition of HelpNDoc: Easily create Qt Help files