Oecn_base_fonts 使用说明(解决v.7.0,v6.1,V6.0.x的PDF中文字体方框问题,支持CJK语言)
-
----------------------------更新信息-------------------------------
[size=16pt][color=red]7.0[/color]更新的安装指南详情请看:[/size]<br / http://cn.openerp.cn/openerp_v7_oecn_base_fonts/ br />
模块 [检测到链接无效,已移除]
随着OpenERP V6.1 的推出,广大CJK编码用户还是遇到了以下字体的问题,报表的中文字体成了框框,怎么办呢?
[attachimg=1]
这个字体问题可以通过安装oecn_base_font来解决,下面我们一起来了解下安装的步骤。
1.先从这里下载最新版本<br / [检测到链接无效,已移除] br />2.然后安装模块
[attachimg=3]
[attachimg=9]
3.CJK warp是中文字体换行处理,默认勾选。Original Fonts是系统里面需要用到的字体(一共有6种,一般需要全部替换掉),Replace Fonts 是你想替换成的字体(取自于OpenERP Server的系统内)。
[attachimg=4]
4最后点击Apply,然后重启服务器。
[attachimg=5]
大功告成。
[attachimg=2]
如果感觉大家有什么提议,或者发现了bug可以直接在<br / https://bugs.launchpad.net/openerp-china/+filebug 提出,或者在这里回帖。谢谢
[检测到链接无效,已移除]
----------------------------常见问题-------------------------------
1.如果是ubuntu系统,请把字体复制到/usr/share/fonts/turetype/目录下
例如:sudo cp simsun.ttc /usr/share/fonts/turetype/ -
oecn_base_fonts_config.py文件中两段代码是无效的:
env = {<br /> 'windir': os.environ.get('windir', os.getcwd()),<br /> 'home': os.environ.get('HOME', os.getcwd()),<br /> }<br /> FontFolders = [<br /> '%(windir)s/Fonts',<br /> '/usr/share/fonts',<br /> '%(home)s/tmp/corefonts',<br /> ]<br /> folders = [ s % env for s in FontFolders]<br />
以及 fontdirs = folders[:]<br /> for ele in folders:<br /> for root, dirs, files in os.walk(ele):<br /> for name in dirs:<br /> fontdirs.append(os.path.join(root, name))<br />
reportlab的字体搜索路径是由reportlab.rl_config中的T1SearchPath和TTFSearchPath定义的,这个两个变量根据reportlab/rl_config.py文件中的定义和处理在reportlab载入时自动检测得到有效的字体搜索路径。在这些搜索路径之外的字体,根本不能被搜索到。因此此处代码只需要如下形式即可: fontdirs = rl_config.T1SearchPath[:]<br /> fontdirs.extend(rl_config.TTFSearchPath)<br />
如果需要载入其他路径的字体,必须修改reportlab/rl_config.py中的定义。 -
楼上请加入这个组
<br / https://launchpad.net/~openerp-chinese-team br />
不仅能参与讨论而且有权限共为维护这些本地化模块。 -
[quote author=mrshelly link=topic=2791.msg9409#msg9409 date=1330838878]
不错....
要是把 中文字体名的问题一并解决了. 就完美了....
[/quote]
[size=12pt]我这里真是举步维艰,按照上面的方法试了一次,大功告成。这几天重装了一次,再做以上设置就不行了。设置是做了,也生效了。出来的字还是黑方块哦[/size]
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login