Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenERP font-family: 'Free 3 of 9' for barcode is not working in report webkit

I have a problem with WebKit report .mako file. when I use:

<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>

in .mako file it is working but if I use

<html>
    <head>
        <style type="text/css">${css}</style>   
    </head>
    <body>
        % for o in objects:
            <p class="barcode39">${o.name}</p>
        % endfor
    </body>
</html>

and this class is declared in field "css" of data.xml in report_webkit

.barcode39 {
    font-family: 'Free 3 of 9';
    font-size: 36;
    color: red;
}

font-family: 'Free 3 of 9' does not work. If I use another font-family it is working. What could be the problem?

I have placed font in /usr/share/fonts/truetype and also run fc-cache -fv. Thanks in advance.

like image 965
Pooja Avatar asked Jul 25 '13 11:07

Pooja


1 Answers

I was facing the same problem and put the font name into single quotes solved my problem. For example:-

style="font-family:'Free 3 of 9';"
like image 136
Obe Danumata Avatar answered Oct 09 '22 06:10

Obe Danumata