Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Could not locate font DejaVuSans

on 1/29/15, 11:24 AM 805 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 ?


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')..


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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 1/29/15, 11:24 AM
Seen: 805 times
Last updated: 2/22/16, 8:19 AM