Oecn_base_fonts 使用说明(解决v.7.0,v6.1,V6.0.x的PDF中文字体方框问题,支持CJK语言)
-
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] -
[quote author=大柘 link=topic=2791.msg11450#msg11450 date=1341040363]
在winxp上装上没效果,报表还是乱码
[/quote]
重启也没有用 要把另一个addon—— base_report_cn 一起装上才行。 两个addons 缺一不可。 -
[quote author=大柘 link=topic=2791.msg11460#msg11460 date=1341186896]
重启过了,安装时并没有提示替换啊。
[/quote]
是向导没弹出来?,请在 设置->设置向导 那里选择 “配置PDF替换规则”
[quote author=luzhuang1967 link=topic=2791.msg11500#msg11500 date=1341595071]
[quote author=大柘 link=topic=2791.msg11450#msg11450 date=1341040363]
在winxp上装上没效果,报表还是乱码
[/quote]
重启也没有用 要把另一个addon—— base_report_cn 一起装上才行。 两个addons 缺一不可。
[/quote]
不是的,这是两个不同的模块,base_report_cn是以前的版本,里面已经包含字体(有bug就是表头的字体不替换)。而oecn_base_font是使用你系统的字体(更灵活)。
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