uni.loadFontFace({
family:fontFamily,
source:`url(/var/mobile/Containers/Data/Application/F36F399D-F596-4CDD-A522-79BC3B6E844E/Documents/Pandora/apps/HBuilder/www/"_doc/uniapp_temp_1725267368011/download/兵克侠客体.ttf")`,
//source:`url(${this.displayedFonts[i].localityUrl})`,
success:(res) => {
this.selectedLayer.style.fontFamily = fontFamily;
this.displayedFonts[i].loaded = true;
console.log(res)
this.displayedFonts[i].download = true;
this.setLayerText(this.selectedLayer, this.selectedLayer.srcText);
},
fail: (res)=> {
this.displayedFonts[i].download = false;
console.log(res)
},
})
报错:"errMsg": "loadFontFace:fail SyntaxError: The string did not match the expected pattern."
这个路径已经转成平台绝对路径了,求求大佬帮帮小白吧
1 个回复
2***@qq.com (作者) - 每天爱打游戏的快乐小菜比
我现在发现了一个问题uni.loadFontFace只能读取_www/static/文件夹下的,其他文件夹都不可以。这算是bug吗?