# wx.loadFontFace(Object object)

Start from base library version 2.1.0. Please remaining backward compatible.

Load network font dynamically. The file address must be of the download type. File addresses only in the https format are supported on iOS.

# Parameter

# Object object
property type default value optional description version
family string yes Defined font name
source string yes Font resource address. Suggested formats are TTF and WOFF. WOFF2 is not compatible with lower versions of iOS.
desc Object no Optional font descriptor
success function no 接口调用成功的回调函数
fail function no 接口调用失败的回调函数
complete function no 接口调用结束的回调函数(调用成功、失败都会执行)

object.desc 's valid value

property type default value optional description version
style string 'normal' no Font style. Values include normal, italic, and oblique
weight string 'normal' no Font weight. Values include normal, bold, 100, 200, ...900
variant string 'normal' no Set the font display text for small capital letters. Values include normal, small-caps, and inherit

# Example

wx.loadFontFace({
    family: 'Bitstream Vera Serif Bold',
    source: 'url("https://sungd.github.io/Pacifico.ttf")',
    success: console.log,
})