This question has been flagged
4145 Views

I have not fonts : Helvetica Courier Times (-Roman) on my system with Fedora fc20 (fc14,15,16 ...)

I see font mapping in /report/render/rml2pdf/customfonts.py

    for family, font, filename, mode in CustomTTFonts:
    if os.path.isabs(filename) and os.path.exists(filename):
        rmldoc.setTTFontMapping(family, font, filename, mode)
        print "'", family,"', '", font,"', '", filename,"', '", mode, "'"     # my work
   print rmldoc.getAvailableFonts()                                           # my work

Bath this not work for windows fonts in Linux, and I see squares against cyrillic symbols in many reports.

I add mapping

    rmldoc.setTTFontMapping("Helvetica", "Helvetica", "/usr/share/fonts/dejavu/DejaVuSerifCondensed.ttf", "Book")
    rmldoc.setTTFontMapping("Helvetica", "Helvetica-Italic", "/usr/share/fonts/dejavu/DejaVuSerifCondensed-Italic.ttf", "Italic")
    rmldoc.setTTFontMapping("Helvetica", "Helvetica-Bold", "/usr/share/fonts/dejavu/DejaVuSerifCondensed-Bold.ttf", "Bold")
    rmldoc.setTTFontMapping("Helvetica", "Helvetica-BoldItalic", "/usr/share/fonts/dejavu/DejaVuSerifCondensed-BoldItalic.ttf", "Bold Italic")
    rmldoc.setTTFontMapping('Times', 'Times-Roman', '/usr/share/fonts/dejavu/DejaVuSans.ttf', 'Book')
    rmldoc.setTTFontMapping('Times', 'Times', '/usr/share/fonts/dejavu/DejaVuSans.ttf', 'Book')
    rmldoc.setTTFontMapping('Times', 'Times-Bold', '/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf', 'Bold')
    rmldoc.setTTFontMapping('Times', 'Times-BoldOblique', '/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf', 'Bold Oblique')
    rmldoc.setTTFontMapping('Times', 'Times-Oblique', '/usr/share/fonts/dejavu/DejaVuSans-Oblique.ttf', 'Oblique')
    rmldoc.setTTFontMapping('Courier', 'Courier', '/usr/share/fonts/dejavu/DejaVuSansMono.ttf', 'Book')
    rmldoc.setTTFontMapping('Courier', 'Courier-Bold', '/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf', 'Bold')
    rmldoc.setTTFontMapping('Courier', 'Courier-BoldOblique', '/usr/share/fonts/dejavu/DejaVuSansMono-BoldOblique.ttf', 'Bold Oblique')
    rmldoc.setTTFontMapping('Courier', 'Courier-Oblique', '/usr/share/fonts/dejavu/DejaVuSansMono-Oblique.ttf', 'Oblique')

After that i can see cyrillic symbols in all reports with windows fonts.

My question : If posible, check font maping for fonts which aren't set in OS.

This about openerp-8.0dev-20140116-000101.tar.gz , reportlab 2.5 | 3.0

Avatar
Discard