当前位置:网站首页>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;}
边栏推荐
- 16、注册中心-consul
- Likou Daily Question - Day 46 - 704. Binary Search
- Parameter introduction and selection points of wireless module
- Google官方控件ShapeableImageView使用
- 打印任务排序 js od华为
- TiDB 在长银五八消费金融核心系统适配经验分享
- Set the browser scrollbar style
- pycharm cannot run after renaming (error: can't open file...No such file or directory)
- 【Mysql】——索引的深度理解
- Centos 7.9 install PostgreSQL14.4 steps
猜你喜欢
进程间通信学习笔记
Kyushu cloud as cloud computing standardization excellent member unit
JS逆向之浏览器补环境(一)
【网络安全】文件上传靶场通关(1-11关)
仿牛客网项目总结
Bert usage and word prediction based on Keras_bert model
Mysql: Invalid default value for TIMESTAMP
Shell 脚本循环遍历日志文件中的值进行求和并计算平均值,最大值和最小值
【Map与Set】之LeetCode&牛客练习
JPEG Steganalysis of Digital Image Steganography
随机推荐
太阳能板最大面积 od js
简易表白小页面
C语言_结构体指针数组函数选票系统
934. 最短的桥
Interprocess communication study notes
PDF 拆分/合并
Centos 7.9 install PostgreSQL14.4 steps
Meta元宇宙部门第二季度亏损28亿 仍要继续押注?元宇宙发展尚未看到出路
如何在 go 程序中暴露 Prometheus 指标
case语句的综合结果,你究竟会了吗?【Verilog高级教程】
蓝牙mesh系统开发二 mesh节点开发
leetcode-1161:最大层内元素和
使用docker安装mysql
rpm install postgresql12
Overview of prometheus monitoring
Parameter introduction and selection points of wireless module
link与@import的区别
Mysql: Invalid default value for TIMESTAMP
TiDB 在长银五八消费金融核心系统适配经验分享
一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例