Can't map determine family/bold/italic for dejavu sans

Bug #1077428 reported by Cristian Salamea
170
This bug affects 35 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Confirmed
Medium
OpenERP's Framework R&D

Bug Description

With latest revno:

server: 4549

Create a customer invoice enter the data then Validate.
Try to Send by email.

system crash https://gist.github.com/4051988

I am on mac OSX

affects: openobject-addons → openobject-server
Revision history for this message
Cristian Salamea (ovnicraft) wrote :

This bug is reproducible trying to print the invoice.

Changed in openobject-server:
status: New → Triaged
Revision history for this message
Sohail Khalid (sohailkhalid) wrote :

Same thing happened for Print as well for printing the invoices. I am on Windows 7 (64 bit)

Revision history for this message
David Deluria (dave-deluria) wrote :

I can reproduce this bug by going to Settings > Companies and previewing the header of any company in your data.

It's worse on Mac OS X even though I have already installed the fonts "port install dejavu-fonts" and it still shows the error.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
status: Triaged → Confirmed
Revision history for this message
Steven Segers (steven-segers) wrote :

I encountered this issue as well.

I first tried the workaround suggested in duplicate bug #1083774. This worked, but then I realized I could work around the issue much easier by just replacing the font-name in the header-template of the company.

Revision history for this message
Sylvain Plante (sylvain-plante) wrote :

I am running openerp-allinone-setup-7.0alpha-20130107-000101 on Windows server 2003. Is there any workaround? I can not access the Header/Footer template in Company. Are the Header/Footer code store in the database? If so where?

I have tried to change the Helvetica font in request_quotation.rml with arial font with no success. Instead of talking about dejavu font the message talk about Arial font.

Any help would be greatly appreciated.

Revision history for this message
Torvald Baade Bringsvor (torvald) wrote : Re: [Bug 1077428] Re: Can't map determine family/bold/italic for dejavu sans

I ended up changing
/usr/lib64/python2.7/site-packages/reportlab/lib/fonts.py

In the method ps2tt:

def ps2tt(psfn):
    'ps fontname to family name, bold, italic'
    psfn = psfn.lower()
    if psfn=='dejavu sans':
        return ('Helvetica', 0, 0)

    if psfn in _ps2tt_map:
        return _ps2tt_map[psfn]
    raise ValueError("Can't map determine family/bold/italic for %s" % psfn)

The two lines added are

    if psfn=='dejavu sans':
        return ('Helvetica', 0, 0)

This works for me now.

-Torvald

2013/1/14 Sylvain Plante <email address hidden>

> I am running openerp-allinone-setup-7.0alpha-20130107-000101 on Windows
> server 2003. Is there any workaround? I can not access the
> Header/Footer template in Company. Are the Header/Footer code store in
> the database? If so where?
>
> I have tried to change the Helvetica font in request_quotation.rml with
> arial font with no success. Instead of talking about dejavu font the
> message talk about Arial font.
>
> Any help would be greatly appreciated.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1083774).
> https://bugs.launchpad.net/bugs/1077428
>
> Title:
> Can't map determine family/bold/italic for dejavu sans
>
> Status in OpenERP Server:
> Confirmed
>
> Bug description:
> With latest revno:
>
> server: 4549
>
>
> Create a customer invoice enter the data then Validate.
> Try to Send by email.
>
> system crash https://gist.github.com/4051988
>
> I am on mac OSX
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/1077428/+subscriptions
>

--
Torvald Baade Bringsvor
Bringsvor Consulting AS - Utvikling og design av IT system.

Revision history for this message
Michael Tänzer (neoatnhng) wrote :

Easier solution: Just install the package ttf-dejavu-core

Proposed fix: add ttf-dajvu-core to the dependencies of the debian/ubuntu package.

Revision history for this message
Sylvain Plante (sylvain-plante) wrote :

Hello Michael

This is not a fix or workaround for windows installation.

Presently, I have two database, one installation. One database was created with v6.2 last october and then upgraded a couple weeks ago to the last version v7 (openerp-allinone-setup-7.0alpha-20130107-000101.exe). The other database was created with v7 from the start.

Printing problem is present in both database but the upgraded version from v6.2 has a tab for Header/Footer in Settings > Companies wich does not appears in the non upgraded database.

Revision history for this message
Sylvain Plante (sylvain-plante) wrote :

Hello mister Rathod,

I think that the importance level should be upped a notch. This problem render the system completly unusable under windows. I can not do anything that involve printing including looking at any reports. Everything that is dealing with PDF is also affected.

This is a show stopper for windows since nobody is able to point out to a workaround.

What can I do to help solve this bug on windows.

I tried to change the police in Header / Footer to Arial with no success. (I was not able to see the tab before because my user did not had the technical field selected in configuration).

Regards

Revision history for this message
Steven Segers (steven-segers) wrote :

Hello Sylvain

There are two workarounds described:
1) Modify the fonts.py script. (The windows distribution seems to have pyo-files so I downloaded fonts.py and replaced the pyo file to make that work)
2) (Easier) Modify the font in the header/footer of the company configuration. If you can't access the header/footer config that's a separate issue. One thing I observed is that your user needs to have the "techinacal features" flag switched on in order to have access to the header/footer config.

Nonetheless, I would agree that the priority should be high since this makes a standard installation work incorrectly.

Best regards

Steven

Revision history for this message
Carlos Pueyo (cpueyo) wrote :

Replace with this file in "C:\Program Files (x86)\OpenERP\Server\server\reportlab\lib"

Revision history for this message
Sylvain Plante (sylvain-plante) wrote :

Muchos Gratia Carlos!
Thank you Steven!

I did not know that you could replace a precompile python module (.pyo) with a non compile one (.py)

Now, I have a problem that arise in the next step. When OpenERP try to produce the PDF I got no error message but the PDF file containt this message:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
{"message": "OpenERP WebClient Error", "code": 300, "data": {"debug": "Client Traceback (most recent call last):\n File \"C:\\Program Files\\OpenERP 7.0alpha\\Server\\server\\openerp\\addons\\web\\http.py\", line 276, in dispatch\nTypeError: index() takes exactly 4 arguments (2 given)\n", "type": "client_exception"}}

Anybody encounter something similar?

Revision history for this message
ivan f gautama (ivanfgautama) wrote :

safe to say that this version 7 is too early to launch, i found many bugs lying around just right after installation.

@Carlos, the fonts.pyo still didnt work at my system

Revision history for this message
Carlos Pueyo (cpueyo) wrote :

@Ivan, this is the .py file, delete old fonts.pyo from the folder, and restart the server.
Openerp should compile it.

Revision history for this message
Steven Segers (steven-segers) wrote :

I found an easier workaround/solution: just install the fonts. You can download them from http://dejavu-fonts.org and put them in C:\Windows\Fonts. After restarting OpenERP, no more error.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.