OpenERP font-family:条形码中的“Free 3 of 9”在报告webkit中不起作用

时间:2013-07-25 11:22:44

标签: css webkit openerp mako

我的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。 提前谢谢。

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,将字体名称放在单引号中解决了我的问题。例如:-

style="font-family:'Free 3 of 9';"

答案 1 :(得分:0)

尝试将字体规则添加到样式表中。像这样:

@font-face {
    font-family: 'Free 3 of 9';
    src: url(/usr/share/fonts/truetype/free_3_of_9.woff) format('woff');
}