bl.loadBuiltInFontFace
以 Promise 风格 调用:不支持
功能描述
加载内置字体。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| global | boolean | false | 否 | <是否全局生效 |
| family | string | 是 | 定义的字体名称 | |
| source | string | 是 | 要加载的内置字体名字 | |
| 合法值说明WeChatSansSSWeChatSansSS 字体WeChatSansStdWeChatSansStd 字体 | ||||
| scopes | Array | 否 | 字体作用范围,可选值为 webview / native / skyline,默认全选,设置 native 可在 Canvas 2D 下使用 | |
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例代码
bl.loadBuiltInFontFace({
family: 'WeChatSansSS',
source: 'WeChatSansSS',
success: console.log
})