2009-01-29 22:00:40 |
EdbO |
bug |
|
|
added bug |
2009-01-29 22:28:49 |
Fabien (Open ERP) |
openobject-server: status |
New |
Invalid |
|
2009-01-29 22:28:49 |
Fabien (Open ERP) |
openobject-server: statusexplanation |
|
We decided to create a addons-extra to manage unicode fonts using dejavu.
Wait for this module. |
|
2009-01-31 16:44:22 |
EdbO |
openobject-server: status |
Invalid |
New |
|
2009-01-31 16:44:22 |
EdbO |
openobject-server: statusexplanation |
We decided to create a addons-extra to manage unicode fonts using dejavu.
Wait for this module. |
Why creating a new module? The solution is so simple! I found the solution on the forum, suggested by Intersol ( http://openerp.com/forum/post15847.html#15847 ) .
#--- intersol DejaVu fornt patch for enabling UTF-8 support in normal reports
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 0
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
pdfmetrics.registerFont(TTFont('Times-Roman','DejaVuSerif.ttf'))
pdfmetrics.registerFont(TTFont('Times-BoldItalic','DejaVuSerifBoldItalic.ttf'))
pdfmetrics.registerFont(TTFont('Times-Bold','DejaVuSerifBold.ttf'))
pdfmetrics.registerFont(TTFont('Times-Italic','DejaVuSerifItalic.ttf'))
#pdfmetrics.registerFont(TTFont('Helvetica','DejaVuSans.ttf'))
# disabled: this one does give an error, should be investigated
pdfmetrics.registerFont(TTFont('Helvetica-BoldItalic','DejaVuSansBoldOblique.ttf'))
pdfmetrics.registerFont(TTFont('Helvetica-Bold','DejaVuSansBold.ttf'))
pdfmetrics.registerFont(TTFont('Helvetica-Italic','DejaVuSansOblique.ttf'))
pdfmetrics.registerFont(TTFont('Courier','DejaVuMonoSans.ttf'))
pdfmetrics.registerFont(TTFont('Courier-Bold','DejaVuMonoSansBold.ttf'))
#--- end of patch
I've added the above in bin/report/render/rml2pdf/trml2pdf.py starting at line 57 just below the import-section. Instead of the Dejavu-fonts I'm using the Arial-fonts, which I added to /usr/lib/python2.4/site-packages/reportlab/fonts
Got my Euro-sign back and the 'strange chars'.
Maybe there is a possibility to make a config-option for the fonttypes. |
|
2009-01-31 17:06:35 |
EdbO |
bug |
|
|
added attachment 'openerp_test_chars.pdf' (openerp_test_chars.pdf) |
2009-02-01 11:38:49 |
Fabien (Open ERP) |
openobject-server: status |
New |
Invalid |
|
2009-02-01 11:38:49 |
Fabien (Open ERP) |
openobject-server: statusexplanation |
Why creating a new module? The solution is so simple! I found the solution on the forum, suggested by Intersol ( http://openerp.com/forum/post15847.html#15847 ) .
#--- intersol DejaVu fornt patch for enabling UTF-8 support in normal reports
import reportlab.rl_config
reportlab.rl_config.warnOnMissingFontGlyphs = 0
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
pdfmetrics.registerFont(TTFont('Times-Roman','DejaVuSerif.ttf'))
pdfmetrics.registerFont(TTFont('Times-BoldItalic','DejaVuSerifBoldItalic.ttf'))
pdfmetrics.registerFont(TTFont('Times-Bold','DejaVuSerifBold.ttf'))
pdfmetrics.registerFont(TTFont('Times-Italic','DejaVuSerifItalic.ttf'))
#pdfmetrics.registerFont(TTFont('Helvetica','DejaVuSans.ttf'))
# disabled: this one does give an error, should be investigated
pdfmetrics.registerFont(TTFont('Helvetica-BoldItalic','DejaVuSansBoldOblique.ttf'))
pdfmetrics.registerFont(TTFont('Helvetica-Bold','DejaVuSansBold.ttf'))
pdfmetrics.registerFont(TTFont('Helvetica-Italic','DejaVuSansOblique.ttf'))
pdfmetrics.registerFont(TTFont('Courier','DejaVuMonoSans.ttf'))
pdfmetrics.registerFont(TTFont('Courier-Bold','DejaVuMonoSansBold.ttf'))
#--- end of patch
I've added the above in bin/report/render/rml2pdf/trml2pdf.py starting at line 57 just below the import-section. Instead of the Dejavu-fonts I'm using the Arial-fonts, which I added to /usr/lib/python2.4/site-packages/reportlab/fonts
Got my Euro-sign back and the 'strange chars'.
Maybe there is a possibility to make a config-option for the fonttypes. |
Because:
1. v5 is frozen, we can not add new feature now. Putting it as a module will allow to publish it in february.
2. DejaVU fonts are heavy (several Mbs), I don't want to include them in each report (or sever code) for those that do not need them. So, only companies that need to use unicode report will use it.
3. I am not sure this solution is the best, and we have no time to check this. V5 is the priority. |
|
2009-04-21 10:51:57 |
Dukai Gábor |
marked as duplicate |
|
319595 |
|