当前位置:网站首页>uniapp uses 3rd party fonts
uniapp uses 3rd party fonts
2022-07-31 01:44:00 【900 million otaku's dream】
One, CSS remote loading
App.vue
@font-face{
font-family: font-name;
src:url('https://XXXXX/font.ttf');
}
in the WeChat appletIt is useful in developer tools, but (Android) real machine debugging is useless
Second, the introduction of local fonts, the program will not upload if the size is too large---the font.ttf file will be converted into base64 format
File conversion address--transfonter


Use
Three, use API uni.loadFontFace()
App.vue
onLaunch: function () {uni.loadFontFace({global: true, // whether to take effect globallyfamily: 'font-name', // Defined font namesource: 'url("https://xxx.com/font/font-name.ttf")', // The address of the font resource.The recommended formats are TTF and WOFF, WOFF2 will be incompatible on lower versions of iOS.success() {console.log('successful callback function')},fail(){console.log('Failed callback function')},complete(){console.log('The callback function at the end of the interface call (the call will be executed if the call succeeds or fails)')}})},
API description: uni.loadFontFace(Object object) | uni-app official website, the development documents of WeChat mini-programs also have corresponding methods. Special attention should be paid to:
Also note that in this discussion wx.loadFontFace loads fonts, Android real machine fails, simulator and ios real machine are normal | WeChat open community , mentioned by the small program technical specialist
Use font website to download-font world
Use.font-name {font-family: font-name;}边栏推荐
- .NET 跨平台应用开发动手教程 |用 Uno Platform 构建一个 Kanban-style Todo App
- GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
- TiCDC 架构和数据同步链路解析
- 蓝牙mesh系统开发二 mesh节点开发
- 解析云原生消息流系统 Apache Pulsar 能力及场景
- Ticmp - 更快的让应用从 MySQL 迁移到 TiDB
- TiDB 在长银五八消费金融核心系统适配经验分享
- Basic Parameters of RF Devices 2
- 【genius_platform软件平台开发】第七十四讲:window环境下的静态库和动态库的一些使用方法(VC环境)
- 斩获BAT、TMD技术专家Offer,我都经历了什么?
猜你喜欢

仿牛客网项目总结

数字图像隐写术之JPEG 隐写分析

【微信小程序】一文带你了解数据绑定、事件绑定以及事件传参、数据同步

汉诺塔问题

Kyushu cloud as cloud computing standardization excellent member unit

tensorflow与GPU版本对应安装问题

一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例

leetcode-1161:最大层内元素和

两个有序数组间相加和的Topk问题

GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
随机推荐
coldfusion8后台计划任务拿shell
打印任务排序 js od华为
Distributed. Idempotency
The sword refers to offer17---print the n digits from 1 to the largest
Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar
仿牛客网项目总结
leetcode-1161:最大层内元素和
使用PageHelper实现分页查询(详细)
MySql的安装配置超详细教程与简单的建库建表方法
tensorflow与GPU版本对应安装问题
聚簇索引和非聚簇索引到底有什么区别
想要写出好的测试用例,先要学会测试设计
蓝牙mesh系统开发二 mesh节点开发
两个有序数组间相加和的Topk问题
Xiaohei's leetcode journey: 117. Fill the next right node pointer of each node II
VSCode插件:嵌套注释
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
第一学年课程期末考试
Xiaohei's leetcode journey: 104. The maximum depth of a binary tree
《MySQL数据库进阶实战》读后感(SQL 小虚竹)