diff --git a/pages/API/load-font-face/load-font-face.uvue b/pages/API/load-font-face/load-font-face.uvue
index aa7cbbfe27f7b2d0ad5632c255b6ebfe5efdea34..a5b4b38e3a6973b141c0c023bc64c2805e9d96af 100644
--- a/pages/API/load-font-face/load-font-face.uvue
+++ b/pages/API/load-font-face/load-font-face.uvue
@@ -13,7 +13,14 @@
}}
\ue101
- 非全局加载字体:
+ 非全局加载字体:
+ font-family: uni.ttf(base64格式)
+
+ {{
+ uniIcon3
+ }}
+ \ue102
+
font-family: 阿里妈妈刀隶体-ttf
(网络字体下载后生效)
font-family:
@@ -28,7 +35,8 @@
data() {
return {
uniIcon1: '\ue100',
- uniIcon2: '\ue101',
+ uniIcon2: '\ue101',
+ uniIcon3: '\ue102'
}
},
onLoad() {
@@ -42,6 +50,16 @@
fail(error) {
console.warn('global loadFontFace uni.ttf fail', error.errMsg)
},
+ })
+ uni.loadFontFace({
+ family: 'UniFontFamily2',
+ source: "url(data:font/ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMjpAVPQAAACsAAAAYGNtYXAADeKoAAABDAAAAUJnbHlmUL6yUwAAAlAAAAEYaGVhZBeGAMAAAANoAAAANmhoZWED3gOCAAADoAAAACRobXR4BCEAAAAAA8QAAAAGbG9jYQCMAAYAAAPMAAAABm1heHABEQBiAAAD1AAAACBuYW1le6YhIAAAA/QAAAMecG9zdNTj4UYAAAcUAAAAMAAEBAABkAAFAAACiQLMAAAAjwKJAswAAAHrADIBCAAAAgAFAwAAAAAAAAAAAAAQAAAAAAAAAAAAAABQZkVkAEDhAuECA4D/gABcA4AAgAAAAAEAAAAAAgACzQAAAAAAAAAAAAMAAAADAAAAHAABAAAAAAA8AAMAAQAAABwABAAgAAAABAAEAAEAAOEC//8AAOEC//8e/wABAAAAAAAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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YCGkNyZWF0ZWQgYnkgaWNvbmZvbnR1bmlpY29uc1JlZ3VsYXJ1bmlpY29uczpWZXJzaW9uIDEuMDB1bmlpY29uc1ZlcnNpb24gMS4wMDtKYW51YXJ5IDMsIDIwMjA7Rm9udENyZWF0b3IgMTIuMC4wLjI1MzUgNjQtYml0dW5paWNvbnNHZW5lcmF0ZWQgYnkgc3ZnMnR0ZiBmcm9tIEZvbnRlbGxvIHByb2plY3QuaHR0cDovL2ZvbnRlbGxvLmNvbQBDAHIAZQBhAHQAZQBkACAAYgB5ACAAaQBjAG8AbgBmAG8AbgB0AHUAbgBpAGkAYwBvAG4AcwBSAGUAZwB1AGwAYQByAHUAbgBpAGkAYwBvAG4AcwA6AFYAZQByAHMAaQBvAG4AIAAxAC4AMAAwAHUAbgBpAGkAYwBvAG4AcwBWAGUAcgBzAGkAbwBuACAAMQAuADAAMAA7AEoAYQBuAHUAYQByAHkAIAAzACwAIAAyADAAMgAwADsARgBvAG4AdABDAHIAZQBhAHQAbwByACAAMQAyAC4AMAAuADAALgAyADUAMwA1ACAANgA0AC0AYgBpAHQAdQBuAGkAaQBjAG8AbgBzAEcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAAcwB2AGcAMgB0AHQAZgAgAGYAcgBvAG0AIABGAG8AbgB0AGUAbABsAG8AIABwAHIAbwBqAGUAYwB0AC4AaAB0AHQAcAA6AC8ALwBmAG8AbgB0AGUAbABsAG8ALgBjAG8AbQAAAAIAAAAAAAAACgABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgAAAQIJcGVyc29uYWRk)",
+ success() {
+ console.log('loadFontFace uni.ttf(base64 format) success')
+ },
+ fail(error) {
+ console.warn('loadFontFace uni.ttf(base64 format) fail', error.errMsg)
+ },
})
uni.loadFontFace({
family: 'AlimamaDaoLiTiTTF',