我对WebKit报告.mako文件有问题。当我使用:
<html>
<head>
<style type="text/css">${css}</style>
</head>
<body>
% for o in objects:
<p style="font-family:'Free 3 of 9';">${o.name}</p>
% endfor
</body>
</html>在.mako文件中,它是有效的,但如果我使用
<html>
<head>
<style type="text/css">${css}</style>
</head>
<body>
% for o in objects:
<p class="barcode39">${o.name}</p>
% endfor
</body>
</html>并且这个类是在report_webkit中data.xml的"css“字段中声明的
.barcode39 {
font-family: 'Free 3 of 9';
font-size: 36;
color: red;
}font-family: 'Free 3 of 9'不工作。如果我使用另一个font-family,它可以正常工作。可能的问题是什么?
我已经在/usr/share/fonts/truetype中放置了字体,也运行了fc-cache -fv。提前谢谢。
发布于 2021-05-04 02:07:14
我也遇到了同样的问题,并将字体名称放在单引号中解决了我的问题。例如:
style="font-family:'Free 3 of 9';"发布于 2018-11-21 13:19:01
尝试将字体规则添加到样式表中。类似于:
@font-face {
font-family: 'Free 3 of 9';
src: url(/usr/share/fonts/truetype/free_3_of_9.woff) format('woff');
}https://stackoverflow.com/questions/17856595
复制相似问题