FontLoader

APIRendererFontLoader

Class used to load custom fonts.

You can override default fonts (sans-serif, sans and monospace).

The font weight and the style (italic or normal) is extracted from the font source path.

Access it with:

FontLoader {}

Example:

Item {
    Text {
        font.family: 'myFont'
        text: 'Cool font!'
    }
}
FontLoader {
    name: 'myFont'
    source: 'rsc:/static/fonts/myFont'
}

Source

FontLoader.New(options)

Parameters:
  • options — Objectoptional
Returns:
FontLoader

Source

FontLoader::name

Type:
String

Source

FontLoader::source

Type:
String

We recommend using WOFF format and TTF/OTF for the oldest Android browser.

Must contains one of:

Italic font filename must contains 'italic'.

Source

FontLoader::loaded

Type:
Boolean
Default value:
false
Read Only

Source

FontLoader::onLoadedChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal

Source

FontLoader::onLoad()

Type:
Signal

Source

FontLoader::onError(error)

Parameters:
  • error — Error
Type:
Signal

Source