【发布时间】:2016-03-25 19:55:10
【问题描述】:
我已经花了 5 小时尝试了所有其他线程的每个解决方案,但仍然无法正常工作。
Custom Fonts in Android PhoneGap
Phonegap : Custom font is not working
How to add custom font in PhoneGap
以上所有这些都无济于事。自定义字体在我笔记本电脑上的浏览器上工作,但是当我将它打包到应用程序中时,它不起作用。 Phonegap 3.7,它不适用于任何设备,只能在笔记本电脑浏览器上运行。
@font-face {
font-family:'AppleMyungjo';
src: url("/font/AppleMyungjo.ttf");
src:url("/font/AppleMyungjo.ttf") format("truetype");
}
#open{
position:absolute;
margin-left:1%;
color:white;
top:10%;
font-size: 150%;
font-family: 'AppleMyungjo';
font-weight: lighter;
text-shadow: none;
}
我检查了日志我有一个错误file:///font/AppleMyungjo.ttf Failed to load resource: net::ERR_FILE_NOT_FOUND
但我确实有一个名为 font 的文件夹,其中包含 ttf。 ttf 喜欢这样吗?
我只是尝试引用所有这些仍然不起作用
@font-face {
font-family:'AppleMyungjo';
src: url("/font/AppleMyungjo.ttf");
src:url("/css/font/AppleMyungjo.ttf") format("opentype");
src:url("/css/font/AppleMyungjo.ttf") format("truetype");
src:url("../font/AppleMyungjo.ttf") format("opentype");
src:url("../font/AppleMyungjo.ttf") format("truetype");
src:url("../css/font/AppleMyungjo.ttf") format("opentype");
src:url("../css/font/AppleMyungjo.ttf") format("truetype"); }
解码下载的字体失败: 我该怎么办?
【问题讨论】:
-
现在我有错误无法解码下载的字体:
-
你把字体放在哪里了?
-
我设法找出了原因,tff 由于某种原因损坏了。感谢您的帮助
标签: cordova phonegap-plugins font-size