问题
my html file loaded in webView but still without font
my font has Unicode characters
i work on android 2.2
mWebView.loadUrl("file:///android_asset/P_007.html");
my css:
<STYLE type="text/css">
@font-face {
font-family: AQF_P007_HA;
src: url("AQF_P007_HA.TTF");
}
body {
font-family: AQF_P007_HA;
font-style:normal;
font-weight: normal;
color: black;
font-size: medium;
mso-font-charset: 0
}
</STYLE>
回答1:
copy font to a directory in asset folder like "fonts" and use this instead:
<STYLE type="text/css">
@font-face {
font-family: AQF_P007_HA;
src: url('file:///android_asset/fonts/AQF_P007_HA.TTF');
}
body {
font-family: AQF_P007_HA;
font-style:normal;
font-weight: normal;
color: black;
font-size: medium;
mso-font-charset: 0
}
</STYLE>
来源:https://stackoverflow.com/questions/9859032/android-html-loaded-without-font