Oecn_base_fonts 使用说明(解决v.7.0,v6.1,V6.0.x的PDF中文字体方框问题,支持CJK语言)
-
没有重启服务器 重启了电脑 就好了 以前一直忽略了重启服务器 潜意识里以为把浏览器关闭重启就相当于重启服务器了 不好意思添麻烦了
-
在做第三步修改cjk时,提示如下信息:Client Traceback (most recent call last):
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\common\http.py", line 180, in dispatch
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\controllers\main.py", line 1209, in load
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\controllers\main.py", line 1091, in fields_view_get
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\common\openerplib\main.py", line 250, in proxy
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\common\http.py", line 608, in send
Server Traceback (most recent call last):
File "C:\Program Files\OpenERP\Server\server\openerp\addons\web\common\http.py", line 593, in send
File "C:\Program Files\OpenERP\Server\server.\openerp\netsvc.py", line 360, in dispatch_rpc
File "C:\Program Files\OpenERP\Server\server.\openerp\service\web_services.py", line 586, in dispatch
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\osv.py", line 167, in execute_kw
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\osv.py", line 121, in wrapper
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\osv.py", line 176, in execute
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\osv.py", line 164, in execute_cr
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 2153, in fields_view_get
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 1793, in __view_look_dom_arch
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 1742, in __view_look_dom
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 1742, in __view_look_dom
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 1742, in __view_look_dom
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 1661, in __view_look_dom
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 1792, in __view_look_dom_arch
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\orm.py", line 3357, in fields_get
File "C:\Program Files\OpenERP\Server\server.\openerp\osv\fields.py", line 1587, in field_to_dict
File "C:\Program Files\OpenERP\Server\server\openerp\addons\oecn_base_fonts.zip\oecn_base_fonts\oecn_base_fonts_config.py", line 39, in __system_fonts_get
File "C:\Program Files\OpenERP\Server\server\openerp\addons\oecn_base_fonts.zip\oecn_base_fonts\oecn_base_fonts_config.py", line 59, in _system_fonts_get
File "reportlab\lib\fontfinder.pyo", line 242, in search
File "reportlab\lib\utils.pyo", line 477, in rl_getmtime
File "genericpath.pyo", line 54, in getmtime
WindowsError: [Error 123] : 'c:\windows\fonts\??1?-\xa1\xea?-\xa1\xea???\xa8\xa6????????.TTF'
这是为什么呢?谁能帮我看看,多谢 -
安装了oecn_base_fonts 模块后
字头置换成了中文,但是内容仍是方块。请Joshua 指教!(操作系统 OPenSUSE12.2, OPENERP6.1.2)
----------------------------------------------------------------------------------
并且每次替换至最后一种字体,会出现以下错误:
Client Traceback (most recent call last):
File "/opt/openerp-6.1-2/openerp/addons/web/common/http.py", line 180, in dispatch
response["result"] = method(controller, self, **self.params)
File "/opt/openerp-6.1-2/openerp/addons/web/controllers/main.py", line 1052, in call_button
action = self.call_common(req, model, method, args, domain_id, context_id)
File "/opt/openerp-6.1-2/openerp/addons/web/controllers/main.py", line 996, in call_common
return self._call_kw(req, model, method, args, {})
File "/opt/openerp-6.1-2/openerp/addons/web/controllers/main.py", line 1010, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/opt/openerp-6.1-2/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
args, kw)
File "/opt/openerp-6.1-2/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
result = self.connector.send(self.service_name, method, *args)
File "/opt/openerp-6.1-2/openerp/addons/web/common/http.py", line 608, in send
raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)
Server Traceback (most recent call last):
File "/opt/openerp-6.1-2/openerp/addons/web/common/http.py", line 593, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/openerp-6.1-2/openerp/netsvc.py", line 360, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp-6.1-2/openerp/service/web_services.py", line 586, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp-6.1-2/openerp/osv/osv.py", line 167, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/openerp-6.1-2/openerp/osv/osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/openerp-6.1-2/openerp/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp-6.1-2/openerp/osv/osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp-6.1-2/openerp/addons/base/res/res_config.py", line 120, in action_next
next = self.execute(cr, uid, ids, context=context)
File "/opt/openerp-6.1-2/openerp/addons/oecn_base_fonts/oecn_base_fonts_config.py", line 163, in execute
new_font_rml = '<setFont name="'+o.map_ids[0].name+'" '
IndexError: list index out of range
----------------------------------------------------------------------------------
最后安装了base_report_cn以后,报表内容从方块换成了中文字体 (重启openerp-server) -
配置字体规则的时候报错:
OpenERP Server Error
Client Traceback (most recent call last):
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 180, in dispatch
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1161, in load
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1043, in fields_view_get
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 250, in proxy
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 611, in send
Server Traceback (most recent call last):
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 592, in send
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\netsvc.py", line 360, in dispatch_rpc
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\service\web_services.py", line 572, in dispatch
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 167, in execute_kw
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 121, in wrapper
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 176, in execute
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 164, in execute_cr
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 2149, in fields_view_get
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1789, in __view_look_dom_arch
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1738, in __view_look_dom
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1738, in __view_look_dom
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1738, in __view_look_dom
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1661, in __view_look_dom
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 1788, in __view_look_dom_arch
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\orm.py", line 3322, in fields_get
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\fields.py", line 1590, in field_to_dict
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\oecn_base_fonts\oecn_base_fonts_config.py", line 39, in get_system_fonts
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\oecn_base_fonts\oecn_base_fonts_config.py", line 49, in _system_fonts_get
File "reportlab\lib\fontfinder.pyo", line 259, in search
File "reportlab\pdfbase\ttfonts.pyo", line 413, in init
File "reportlab\pdfbase\ttfonts.pyo", line 473, in extractInfo
ValueError: chr() arg not in range(256) -
oecn_base_fonts 无法找到字体的一种解决方案
环境:
Aliyun CentOS 6.3
Python 2.7.3 (源码编译安装)
reportlab 2.6 (源码默认编译安装)
查看reportlab模块路径
# python -c "import reportlab; print reportlab.file"
/opt/python2.7/lib/python2.7/site-packages/reportlab/init.pyc
# cd /opt/python2.7/lib/python2.7/site-packages/reportlab
创建目录,如有fonts目录则跳过
# mkdir fonts
复制字体文件
# cp wqy-zenhei.ttc ./fonts
重启 OE , done!