19
19
##############################################################################
20
20
import report.render.rml2pdf.customfonts as cfonts
21
from addons import get_module_resource
22
21
from reportlab.lib.styles import ParagraphStyle
24
this_module = 'pdf_report_zh'
26
simsun = get_module_resource(this_module, 'fonts', 'SimSun.ttf')
27
simhei = get_module_resource(this_module, 'fonts', 'SimHei.ttc')
28
if not (simsun and simhei):
29
raise OSError("SimSun.ttf and/or SimHei.ttf not in %s resources", this_module)
32
('Helvetica',"SimSun", simsun, 'normal'),
33
('Helvetica',"SimHei", simhei, 'bold'),
34
('Helvetica',"SimSun", simsun, 'italic'),
35
('Helvetica',"SimHei", simhei, 'bolditalic'),
36
('Times',"SimSun", simsun, 'normal'),
37
('Times',"SimHei", simhei, 'bold'),
38
('Times',"SimSun", simsun, 'italic'),
39
('Times',"SimHei", simhei, 'bolditalic'),
40
('Times-Roman',"SimSun", simsun, 'normal'),
41
('Times-Roman',"SimHei", simhei, 'bold'),
42
('Times-Roman',"SimSun", simsun, 'italic'),
43
('Times-Roman',"SimHei", simhei, 'bolditalic'),
44
('Courier',"SimSun", simsun, 'normal'),
45
('Courier',"SimHei", simhei, 'bold'),
46
('Courier',"SimSun", simsun, 'italic'),
47
('Courier',"SimHei", simhei, 'bolditalic'),
50
cfonts.CustomTTFonts=CustomTTFonts
51
ParagraphStyle.defaults['wordWrap'] = "CJK"
24
class oecn_base_fonts(osv.osv_memory):
25
_name = "oecn.base.fonts"
26
def __init__( self,pool,cr ):
27
config_obj = pool.get("ir.config_parameter")
28
map = config_obj.get_param(cr, 1, 'fonts_map')
31
CustomTTFonts = dict['maps']
32
cfonts.CustomTTFonts=CustomTTFonts
33
ParagraphStyle.defaults['wordWrap'] = dict['wrap']