Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

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

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

Scheduled Pinned Locked Moved Odoo 中文翻译
61 Posts 22 Posters 161.7k Views 1 Watching
  • 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.
  • C Offline
    C Offline
    ccdos
    wrote on last edited by
    #5

    GTK 客户端退出后 那个错误 是什么原因 ?虽然不影响使用,但是给客户完全不能接受啊

    1 Reply Last reply
    0
    • JoshuaJ Offline
      JoshuaJ Offline
      Joshua
      管理员
      wrote on last edited by
      #6

      GTK 客户端退出错误的原因 和这个没多大关联,不过好像校长之前说解决办法很容易的,我们期待下....

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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        siroh
        wrote on last edited by
        #7

        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
        0
        • W Offline
          W Offline
          wjfonhand
          wrote on last edited by
          #8

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

          GoodERP -- Odoo China fork

          1 Reply Last reply
          0
          • S Offline
            S Offline
            siroh
            wrote on last edited by
            #9

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

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

            1 Reply Last reply
            0
            • W Offline
              W Offline
              wjfonhand
              wrote on last edited by
              #10

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

              GoodERP -- Odoo China fork

              1 Reply Last reply
              0
              • S Offline
                S Offline
                siroh
                wrote on last edited by
                #11

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

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  ccdos
                  wrote on last edited by
                  #12

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

                  1 Reply Last reply
                  0
                  • JoshuaJ Offline
                    JoshuaJ Offline
                    Joshua
                    管理员
                    wrote on last edited by
                    #13

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

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

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      ccdos
                      wrote on last edited by
                      #14

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

                      1 Reply Last reply
                      0
                      • JoshuaJ Offline
                        JoshuaJ Offline
                        Joshua
                        管理员
                        wrote on last edited by
                        #15

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

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

                        1 Reply Last reply
                        0
                        • C Offline
                          C Offline
                          ccdos
                          wrote on last edited by
                          #16

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

                          1 Reply Last reply
                          0
                          • C Offline
                            C Offline
                            ccdos
                            wrote on last edited by
                            #17

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

                            1 Reply Last reply
                            0
                            • JoshuaJ Offline
                              JoshuaJ Offline
                              Joshua
                              管理员
                              wrote on last edited by
                              #18

                              已知道的bug:

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

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

                              1 Reply Last reply
                              0
                              • JoshuaJ Offline
                                JoshuaJ Offline
                                Joshua
                                管理员
                                wrote on last edited by
                                #19

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

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

                                1 Reply Last reply
                                0
                                • L Offline
                                  L Offline
                                  luzhuang1967
                                  wrote on last edited by
                                  #20

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

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



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

                                  1 Reply Last reply
                                  0
                                  • JoshuaJ Offline
                                    JoshuaJ Offline
                                    Joshua
                                    管理员
                                    wrote on last edited by
                                    #21

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

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

                                    1 Reply Last reply
                                    0
                                    • B Offline
                                      B Offline
                                      binbinxz
                                      wrote on last edited by
                                      #22

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

                                      1 Reply Last reply
                                      0
                                      • JoshuaJ Offline
                                        JoshuaJ Offline
                                        Joshua
                                        管理员
                                        wrote on last edited by
                                        #23

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

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

                                        1 Reply Last reply
                                        0
                                        • B Offline
                                          B Offline
                                          binbinxz
                                          wrote on last edited by
                                          #24

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

                                          1 Reply Last reply
                                          0

                                          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
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups