This question has been flagged
1 Reply
4444 Views

Some reports wich use DejaVuSans font couldn't be printed because of missing this font in system.

when i try to print a report, i got this error message :

openerp.report.render.rml2pdf.trml2pdf: Could not locate font DejaVuSans, substituting default: None

How can I fixed this error ?

Avatar
Discard
Best Answer

I got the same issue in Odoo 9 for handling custom fonts in RML reports. I have solved this problem by giving full font path in openerp/report/render/rml2pdf/customfonts.py. In the third element of tuple in CustomTTFonts in customfonts.py, rather than just to pass the name of the custom font use full path.  

THSarabun', "THSarabun", "/usr/share/fonts/truetype/THSarabun/THSarabun.ttf", 'normal')..

e,g

CustomTTFonts = [          ('Sun-ExtA',"Sun-ExtA", "/usr/share/fonts/truetype/Sun-ExtA.ttf", 'normal'),        ('THSarabun', "THSarabun", "/usr/share/fonts/truetype/THSarabun/THSarabun.ttf", 'normal'),        ('THSarabun Bold', "THSarabun Bold", "/usr/share/fonts/truetype/THSarabun/THSarabun_Bold.ttf", 'bold'),        ('THSarabun Italic', "THSarabun Italic", "/usr/share/fonts/truetype/THSarabun/THSarabun_Italic.ttf", 'italic'),        ('THSarabun BoldItalic', "THSarabun BoldItalic", "/usr/share/fonts/truetype/THSarabun/THSarabun_BoldItalic.ttf", 'bolditalic'),]

Hope this will work.

Avatar
Discard