The Font class is used to manage embedded fonts in SWF files. Embedded fonts are represented as a subclass of the Font class. The Font class is currently useful only to find out information about embedded fonts; you cannot alter a font by using this class. You cannot use the Font class to load external fonts, or to create an instance of a Font object by itself. Use the Font class as an abstract base class.

### Hierarchy

- Font

## Index

### Constructors

- constructor

### Properties

- fontName
- fontStyle
- fontType

### Methods

- get_fontName
- set_fontName
- enumerateFonts
- fromBytes
- fromFile
- loadFromBytes
- loadFromFile
- loadFromName
- registerFont

## Constructors

### constructor

- new Font(name?: string): Font

- - Defined in lib/openfl/text/Font.d.ts:39

  #### Parameters

  - ##### Optional name: string

  #### Returns Font

## Properties

### fontName

fontName: string

- Defined in lib/openfl/text/Font.d.ts:24

The name of an embedded font.

### fontStyle

fontStyle: FontStyle

- Defined in lib/openfl/text/Font.d.ts:33

The style of the font. This value can be any of the values defined in the FontStyle class.

### fontType

fontType: FontType

- Defined in lib/openfl/text/Font.d.ts:39

The type of the font. This value can be any of the constants defined in the FontType class.

## Methods

### Protected get_fontName

- get_fontName(): string

- - Defined in lib/openfl/text/Font.d.ts:26

  #### Returns string

### Protected set_fontName

- set_fontName(value: string): string

- - Defined in lib/openfl/text/Font.d.ts:27

  #### Parameters

  - ##### value: string

  #### Returns string

### Static enumerateFonts

- enumerateFonts(enumerateDeviceFonts?: boolean): Array<Font>

- - Defined in lib/openfl/text/Font.d.ts:58

  Specifies whether to provide a list of the currently available embedded fonts.

  #### Parameters

  - ##### Optional enumerateDeviceFonts: boolean

    Indicates whether you want to limit the list to only the currently available embedded fonts. If this is set to `true` then a list of all fonts, both device fonts and embedded fonts, is returned. If this is set to `false` then only a list of embedded fonts is returned.

  #### Returns Array<Font>

  A list of available fonts as an array of Font objects.

### Static fromBytes

- fromBytes(bytes: ByteArray): Font

- - Defined in lib/openfl/text/Font.d.ts:61

  #### Parameters

  - ##### bytes: ByteArray

  #### Returns Font

### Static fromFile

- fromFile(path: string): Font

- - Defined in lib/openfl/text/Font.d.ts:64

  #### Parameters

  - ##### path: string

  #### Returns Font

### Static loadFromBytes

- loadFromBytes(bytes: ByteArray): Future<Font>

- - Defined in lib/openfl/text/Font.d.ts:67

  #### Parameters

  - ##### bytes: ByteArray

  #### Returns Future<Font>

### Static loadFromFile

- loadFromFile(path: string): Future<Font>

- - Defined in lib/openfl/text/Font.d.ts:68

  #### Parameters

  - ##### path: string

  #### Returns Future<Font>

### Static loadFromName

- loadFromName(path: string): Future<Font>

- - Defined in lib/openfl/text/Font.d.ts:69

  #### Parameters

  - ##### path: string

  #### Returns Future<Font>

### Static registerFont

- registerFont(font: any): void

- - Defined in lib/openfl/text/Font.d.ts:81

  Registers a font class in the global font list.

  #### Parameters

  - ##### font: any

  #### Returns void

Generated using TypeDoc