java - android webview 在线网页 如何加载本地字体库?
测试网页:
http://1.testmyhtml.applinzi....
网页源码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <code><html>
<head>
<meta charset= "utf-8" >
<title>
测试页面
</title>
<meta id= "viewport" name= "viewport" content= "width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" >
<meta name= "apple-mobile-web-app-capable" content= "yes" >
<meta name= "apple-mobile-web-app-status-bar-style" content= "black" >
<meta name= "format-detection" content= "telephone=no" >
<style>
@font-face {
font-family: 'MyCustomFont' ;
src: url( 'file:///android_asset/fonts/dfgb_k.ttf' );
}
p{
font-family: "MyCustomFont" ;
font-size: x-large;
}
body {
margin: 0;
}
</style>
</head>
<body>
<p>我是网页字体我是网页字体我是网页字体我是网页字体我是网页字体我是网页字体我是网页字体</p>
</body>
</html></code>
|
直接通过url('file:///android_asset/fonts/dfgb_k.ttf');这种方式加载是不可以
如果是本地网页是可以的,但是怎么解决在线网页呢?