43,740
社区成员
发帖
与我相关
我的任务
分享@font-face {
font-family: "AHeitiStdR";
src: url("/file/font/AHeitiStdR.eot"); /* IE9 */
src: url("/file/font/AHeitiStdR.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("/file/font/AHeitiStdR.woff") format("woff"), /* chrome、firefox */
url("/file/font/AHeitiStdR.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
url("/file/font/AHeitiStdR.svg#AHeitiStdR") format("svg"); /* iOS 4.1- */
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: "msyhbd";
src: url("/file/font/msyhbd.eot"); /* IE9 */
src: url("/file/font/msyhbd.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("/file/font/msyhbd.woff") format("woff"), /* chrome、firefox */
url("/file/font/msyhbd.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
url("/file/font/msyhbd.svg#msyhbd") format("svg"); /* iOS 4.1- */
font-style: normal;
font-weight: normal;
} ctx.font = 'normal normal 700 28px AHeitiStdR';
ctx.fillStyle = '#C00';
ctx.fillText('(山东起重机网升级版)', 175, 105);


我又单独摘出来放到一个文件里测了一下,还是不行,,,,,,,,,,到底是怎么回事
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
@font-face {
font-family: "AHeitiStdR";
src: url("/file/font/AHeitiStdR.eot"); /* IE9 */
src: url("/file/font/AHeitiStdR.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("/file/font/AHeitiStdR.woff") format("woff"), /* chrome、firefox */
url("/file/font/AHeitiStdR.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
url("/file/font/AHeitiStdR.svg#AHeitiStdR") format("svg"); /* iOS 4.1- */
font-style: normal;
font-weight: normal;
}
</style>
</head>
<body>
<canvas id="testc" width="1160px" height="125px"></canvas>
</body>
</html>
<script>
var ctx = document.getElementById('testc').getContext("2d");
ctx.font = 'bold 28px AHeitiStdR';
ctx.fillStyle = '#C00';
ctx.fillText('(山东起重机网升级版)', 165, 110);
</script>