# Format

## Content

# Class: Format

Represents a text format.

## Extends

- [`ObjectBase`](ObjectBase)

## Constructors

### Constructor

```ts
new Format(formatProperties): Format;
```

Creates a new Format object with specified properties.

#### Parameters

##### formatProperties

[`FormatProperties`](../type-aliases/FormatProperties)

Text formatting attributes such as font, colors, decorations and so on.

#### Returns

`Format`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new Format(baseFormat, formatProperties): Format;
```

Creates a new Format based on properties of an existing Format.

#### Parameters

##### baseFormat

`Format`

The Format used as the base for the new Format.

##### formatProperties

[`FormatProperties`](../type-aliases/FormatProperties)

The settings overriding properties of the base Format.

#### Returns

`Format`

#### Overrides

```ts
ObjectBase.constructor
```

### Constructor

```ts
new Format(om, formatProperties): Format;
```

Creates a new Format object with specified properties.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

An object manager that controls the lifetime of the Format object.

##### formatProperties

[`FormatProperties`](../type-aliases/FormatProperties)

Text formatting attributes such as font, colors, decorations and so on.

#### Returns

`Format`

#### Overrides

```ts
ObjectBase.constructor
```

## Accessors

### allowFontSbits

#### Get Signature

```ts
get allowFontSbits(): boolean;
```

Gets a value indicating if the embedded bitmaps from the EBDT font table can be used.

##### Returns

`boolean`

***

### backColor

#### Get Signature

```ts
get backColor(): Color;
```

Gets the text background color.

##### Returns

[`Color`](../type-aliases/Color)

***

### bold

#### Get Signature

```ts
get bold(): boolean;
```

Gets a value indicating whether the font should be bolded.

##### Returns

`boolean`

***

### charWidthFactor

#### Get Signature

```ts
get charWidthFactor(): number;
```

Gets the character width scale factor. Values are between 0.1 and 10.0.

##### Returns

`number`

***

### doubleUnderline

#### Get Signature

```ts
get doubleUnderline(): boolean;
```

Gets a value indicating if the text is double underlined.

##### Returns

`boolean`

***

### fillBrush

#### Get Signature

```ts
get fillBrush(): Brush;
```

Gets the brush to fill the glyphs.

##### Returns

[`Brush`](Brush)

***

### font

#### Get Signature

```ts
get font(): Font;
```

Gets the [Font](Font) used by this Format.

##### Returns

[`Font`](Font)

***

### fontFamily

#### Get Signature

```ts
get fontFamily(): string;
```

Gets the font family name.

##### Returns

`string`

***

### fontFeatures

#### Get Signature

```ts
get fontFeatures(): FontFeature[];
```

Gets the array of assigned Microsoft OpenType typography properties.

##### Returns

[`FontFeature`](../type-aliases/FontFeature)[]

***

### fontSize

#### Get Signature

```ts
get fontSize(): number;
```

Gets the logical font size, in graphic units.

##### Returns

`number`

***

### foreColor

#### Get Signature

```ts
get foreColor(): Color;
```

Gets the text foreground color.

##### Returns

[`Color`](../type-aliases/Color)

***

### glyphAdvanceFactor

#### Get Signature

```ts
get glyphAdvanceFactor(): number;
```

Gets the scaling factor for the glyph advance value relative to font's Average Character Width. Values are from 0.5 up.

##### Returns

`number`

***

### glyphAdvanceOffset

#### Get Signature

```ts
get glyphAdvanceOffset(): number;
```

Gets the absolute increment (delta) for the glyph advance value, in graphic units.

##### Returns

`number`

***

### glyphWidths

#### Get Signature

```ts
get glyphWidths(): GlyphWidths;
```

Gets the preferred glyph widths (generally used in CJKV fonts).

##### Returns

[`GlyphWidths`](../enumerations/GlyphWidths)

***

### hollow

#### Get Signature

```ts
get hollow(): boolean;
```

Gets a value indicating if the glyphs are hollow (outlined), otherwise they are solid.

##### Returns

`boolean`

***

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ObjectBase`](ObjectBase).[`id`](ObjectBase#id)

***

### italic

#### Get Signature

```ts
get italic(): boolean;
```

Gets a value indicating whether the font should be italicized.

##### Returns

`boolean`

***

### language

#### Get Signature

```ts
get language(): string;
```

Gets the Neutral Culture string, if assigned.

##### Returns

`string`

***

### lineGap

#### Get Signature

```ts
get lineGap(): number;
```

Gets the explicit line gap (if not null), in graphic units.

##### Returns

`number`

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](ObjectBase#om)

***

### paletteIndex

#### Get Signature

```ts
get paletteIndex(): number;
```

Gets the index of a palette used for drawing color fonts.

##### Returns

`number`

***

### recalcFontSizeForFallbackFonts

#### Get Signature

```ts
get recalcFontSizeForFallbackFonts(): boolean;
```

Gets a value indicating whether the size of a fallback font should be coerced to the size of original font.

##### Returns

`boolean`

***

### sidewaysInVerticalText

#### Get Signature

```ts
get sidewaysInVerticalText(): boolean;
```

Gets a value indicating if all characters should appear as rotated 90 or -90 degrees in vertical text.

##### Returns

`boolean`

***

### skipNormalization

#### Get Signature

```ts
get skipNormalization(): boolean;
```

Gets a value indicating whether the canonical decomposition, reordering, and composition stages should be omitted.

##### Returns

`boolean`

***

### strictCanonicalDecomposition

#### Get Signature

```ts
get strictCanonicalDecomposition(): boolean;
```

Gets a value indicating whether to apply normalization to Singleton Decompositions and Post Composition Version precomposed characters.

##### Returns

`boolean`

***

### strikethrough

#### Get Signature

```ts
get strikethrough(): boolean;
```

Gets a value indicating if the strikethrough style is applied to the text.

##### Returns

`boolean`

***

### strokePen

#### Get Signature

```ts
get strokePen(): Pen;
```

Gets the pen to draw glyph outlines.

##### Returns

[`Pen`](Pen)

***

### subscript

#### Get Signature

```ts
get subscript(): boolean;
```

Gets a value indicating if the glyphs should be displayed as subscript.

##### Returns

`boolean`

***

### superscript

#### Get Signature

```ts
get superscript(): boolean;
```

Gets a value indicating if the glyphs should be displayed as superscript.

##### Returns

`boolean`

***

### textRunAsCluster

#### Get Signature

```ts
get textRunAsCluster(): boolean;
```

Gets a value indicating whether the whole text run should be considered as a single Grapheme Cluster.

##### Returns

`boolean`

***

### transformToFullWidth

#### Get Signature

```ts
get transformToFullWidth(): boolean;
```

Gets a value indicating if ASCII characters should be transformed into fullwidth characters.

##### Returns

`boolean`

***

### transverseOffset

#### Get Signature

```ts
get transverseOffset(): number;
```

Gets the offset of the text in the orthogonal direction, in graphic units.

##### Returns

`number`

***

### treatHyphenMinusAsHyphen

#### Get Signature

```ts
get treatHyphenMinusAsHyphen(): boolean;
```

Gets a value indicating whether the character 'HYPHEN-MINUS' (U+002D) is treated as the character 'HYPHEN' (U+2010) by the Unicode line breaking algorithm.

##### Returns

`boolean`

***

### underline

#### Get Signature

```ts
get underline(): boolean;
```

Gets a value indicating if the text is underlined.

##### Returns

`boolean`

***

### uprightInVerticalText

#### Get Signature

```ts
get uprightInVerticalText(): boolean;
```

Gets a value indicating if the normally sideways characters should be drawn upright in vertical text.

##### Returns

`boolean`

***

### useHorizontalMetricsForVerticalText

#### Get Signature

```ts
get useHorizontalMetricsForVerticalText(): boolean;
```

Gets a value indicating if the horizontal ascending, descending, and line gap settings should be applied to vertical text.

##### Returns

`boolean`

***

### useTypoMetrics

#### Get Signature

```ts
get useTypoMetrics(): boolean;
```

Gets a value indicating whether the typographical font metrics should be applied instead of Windows-specific and Apple-specific font metrics.

##### Returns

`boolean`

***

### useVerticalLineGapForSideways

#### Get Signature

```ts
get useVerticalLineGapForSideways(): boolean;
```

Gets a value indicating that for sideways text in vertical flow, line gap will be set according to [Font.verticalLineGap](Font#verticallinegap).
If false, line gap for lines containing sideways text is set according to [Font.horizontalLineGap](Font#horizontallinegap),
which can lead to different gaps between columns that contain sideways text runs and those that do not.

##### Returns

`boolean`

## Methods

### free()

```ts
free(): void;
```

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### rebind()

```ts
rebind(omTo): void;
```

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
