惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - KidYang

微信、支付宝个人收款码不能用于经营收款 - z 微信平台开发 微信小程序图表控件 微信小程序网络排查指引 小程序字体转换 - 转 小程序播放语音之wx.createInnerAudioContext() - 转 小程序隐藏scroll-view滚动条的实现 - 转 微信小程序scroll-view左右横向滑动 用vscode开发微信小程序,建议安装的插件 微信小程序wxs格式化日期 在 ios 端显示NaN问题及日期格式化工具 小程序涉及npm、vue的一些基础资料 visual studio 关于 Updates were rejected because the remote contains work that you do 大量Timer_MinBytesPerSecond,Timer_ConnectionIdle错误 - 转 微信小程序隐藏时动画效果 - 转载 System.Security.Cryptography.RSA.FromXmlString 系统找不到指定的文件和X509读取证书文件系统找不到指定的文件异常 - 转载 sqlserver 发送http请求 chrome浏览器直接打印 - z 解决webapi首次启动速度慢的问题 - z 使用第三方库(Senparc)完成小程序支付 - z
小程序使用字体相关
KidYang · 2020-05-05 · via 博客园 - KidYang

小程序提供  wx.loadFontFace  这个api

也可以在app.wss里写一个样式:

 @font-face {
  font-family: 'fangsong';
  src: url('https://xxxx/xxx/仿宋_GB2312.ttf');
 }

注意要使用https

另外需要注意的是,如果字体所在站点和小程序api不是同源的站点,那么需要开启跨域的支持,否则安卓下小程序字体没有改变。

打开IIS,找到“HTTP响应标头”点进去,

在右侧可以看到添加,然后添加如下标头即可

Access-Control-Allow-Headers:Content-Type, api_key, Authorization

Access-Control-Allow-Origin:*