Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    Oecn_base_fonts 使用说明(解决v.7.0,v6.1,V6.0.x的PDF中文字体方框问题,支持CJK语言)

    Odoo 中文翻译
    22
    61
    105662
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      siroh last edited by

      oecn_base_fonts_config.py文件中两段代码是无效的:

      &nbsp; &nbsp; &nbsp; &nbsp; env = {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;windir&#039;: os.environ.get(&#039;windir&#039;, os.getcwd()),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;home&#039;: os.environ.get(&#039;HOME&#039;, os.getcwd()),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; FontFolders = [<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;%(windir)s/Fonts&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;/usr/share/fonts&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;%(home)s/tmp/corefonts&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]<br />&nbsp; &nbsp; &nbsp; &nbsp; folders = [ s % env for s in FontFolders]<br />
      


      以及

      &nbsp; &nbsp; &nbsp; &nbsp; fontdirs = folders[:]<br />&nbsp; &nbsp; &nbsp; &nbsp; for ele in folders:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for root, dirs, files in os.walk(ele):<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for name in dirs:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fontdirs.append(os.path.join(root, name))<br />
      


      reportlab的字体搜索路径是由reportlab.rl_config中的T1SearchPath和TTFSearchPath定义的,这个两个变量根据reportlab/rl_config.py文件中的定义和处理在reportlab载入时自动检测得到有效的字体搜索路径。在这些搜索路径之外的字体,根本不能被搜索到。因此此处代码只需要如下形式即可:

      &nbsp; &nbsp; &nbsp; &nbsp; fontdirs = rl_config.T1SearchPath[:]<br />&nbsp; &nbsp; &nbsp; &nbsp; fontdirs.extend(rl_config.TTFSearchPath)<br />
      


      如果需要载入其他路径的字体,必须修改reportlab/rl_config.py中的定义。

      1 Reply Last reply Reply Quote 0
      • wjfonhand
        wjfonhand last edited by

        太好了,楼上的兄弟才是我们模块开源的动力。
        我们会继续测试和研究是否真如楼上所说,如属实,尽早修正。
        再谢!

        GoodERP -- Odoo China fork

        1 Reply Last reply Reply Quote 0
        • S
          siroh last edited by

          我是在FreeBSD上安装这个模块时发现的问题。
          reporlab/rl_config.py的源代码在处理字体搜索路径时是有问题的,对照linux发行版本的包,发现linux发行版本已经加以处理。FreeBSD对此并未处理,我针对大多数平台已经做了一个patch来修正这个问题,正打算提交给reportlab。作为临时措施,我已经向FreeBSD提交了ports修正。

          另外,请该模块作者在源代码包上标记版本号,以便于按照FreeBSD ports的要求自动化安装。谢谢。

          1 Reply Last reply Reply Quote 0
          • wjfonhand
            wjfonhand last edited by

            楼上请加入这个组
            <br / https://launchpad.net/~openerp-chinese-team br />
            不仅能参与讨论而且有权限共为维护这些本地化模块。

            GoodERP -- Odoo China fork

            1 Reply Last reply Reply Quote 0
            • S
              siroh last edited by

              已经申请加入电子邮件为chian.jin(AT)gmail.com,等待批准。

              1 Reply Last reply Reply Quote 0
              • C
                ccdos last edited by

                郁闷,在 阿里云 主机上面选择“ 替换为”字体出不来,可选项目是空的
                玩不转了

                1 Reply Last reply Reply Quote 0
                • Joshua
                  Joshua 管理员 last edited by

                  估计要找一下阿里云的提供商。问问系统字体的路径..

                  【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                  1 Reply Last reply Reply Quote 0
                  • C
                    ccdos last edited by

                    新装一个ubuntu 也是一样的效果,郁闷

                    1 Reply Last reply Reply Quote 0
                    • Joshua
                      Joshua 管理员 last edited by

                      本机上?ubuntu的什么版本呢?

                      【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                      1 Reply Last reply Reply Quote 0
                      • C
                        ccdos last edited by

                        本机 虚拟机 ,新装的 Ubuntu 10.04 LTS + oe6.1 源码运行

                        1 Reply Last reply Reply Quote 0
                        • C
                          ccdos last edited by

                          继续,
                          我想偷懒,能否 免配置? 或者一键设置,
                          其实每次配置的内容都一样的

                          1 Reply Last reply Reply Quote 0
                          • Joshua
                            Joshua 管理员 last edited by

                            已知道的bug:

                            当你登陆了已经安装过oecn_base_fonts的数据库,其他数据库不用配置也可以打印中文,但是页头打印会出现问题。所以建议最好先安装好oecn_base_fonts在打印

                            【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                            1 Reply Last reply Reply Quote 0
                            • Joshua
                              Joshua 管理员 last edited by

                              [quote author=ccdos link=topic=2791.msg11207#msg11207 date=1338355528]
                              继续,
                              我想偷懒,能否 免配置? 或者一键设置,
                              其实每次配置的内容都一样的
                              [/quote]
                              因为这里可以自定义字体,选一个字体还是必须的,不过应该可以简化,之选一次,然后配置全部字体。

                              【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                              1 Reply Last reply Reply Quote 0
                              • L
                                luzhuang1967 last edited by

                                [quote author=mrshelly link=topic=2791.msg9409#msg9409 date=1330838878]
                                不错....

                                要是把 中文字体名的问题一并解决了. 就完美了....
                                [/quote]



                                [size=12pt]我这里真是举步维艰,按照上面的方法试了一次,大功告成。这几天重装了一次,再做以上设置就不行了。设置是做了,也生效了。出来的字还是黑方块哦[/size]

                                1 Reply Last reply Reply Quote 0
                                • Joshua
                                  Joshua 管理员 last edited by

                                  楼上的是不是没有重启服务呢?

                                  【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    binbinxz last edited by

                                    在winxp上装上没效果,报表还是乱码

                                    1 Reply Last reply Reply Quote 0
                                    • Joshua
                                      Joshua 管理员 last edited by

                                      重启系统没?配置替换的字体是中文字体么?

                                      【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                                      1 Reply Last reply Reply Quote 0
                                      • B
                                        binbinxz last edited by

                                        重启过了,安装时并没有提示替换啊。

                                        1 Reply Last reply Reply Quote 0
                                        • L
                                          luzhuang1967 last edited by

                                          [quote author=大柘 link=topic=2791.msg11450#msg11450 date=1341040363]
                                          在winxp上装上没效果,报表还是乱码
                                          [/quote]

                                          重启也没有用  要把另一个addon——    base_report_cn  一起装上才行。  两个addons  缺一不可。

                                          1 Reply Last reply Reply Quote 0
                                          • Joshua
                                            Joshua 管理员 last edited by

                                            [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是使用你系统的字体(更灵活)。

                                            【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post