]> source.dussan.org Git - redmine.git/commitdiff
Korean support for PDF export (#4639).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 7 Feb 2010 12:30:44 +0000 (12:30 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 7 Feb 2010 12:30:44 +0000 (12:30 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3389 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf.rb
vendor/plugins/rfpdf/lib/rfpdf/korean.rb

index c80880afa4094b1cbb7495174b2055a01738f112..c24921653db72cc1edd9a694c30d6347c0def40a 100644 (file)
@@ -35,6 +35,11 @@ module Redmine
           super()
           set_language_if_valid lang
           case current_language.to_s.downcase
+          when 'ko'
+            extend(PDF_Korean)
+            AddUHCFont()
+            @font_for_content = 'UHC'
+            @font_for_footer = 'UHC'
           when 'ja'
             extend(PDF_Japanese)
             AddSJISFont()
index 64131405ec96aaf5131f096c5db009741f7317f5..2b1f6de6ce7177a825bd11b1f6787cff658e00a8 100644 (file)
@@ -139,13 +139,13 @@ UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9
                        b2='LR'\r
                else\r
                        b2=''\r
-                       if(border.index('L').nil?)\r
+                       if(border.to_s.index('L').nil?)\r
                                b2+='L'\r
         end\r
-                       if(border.index('R').nil?)\r
+                       if(border.to_s.index('R').nil?)\r
                                b2+='R'\r
         end\r
-                       b=border.index('T').nil? ? b2+'T' : b2\r
+                       b=border.to_s.index('T').nil? ? b2+'T' : b2\r
                end\r
        end\r
        sep=-1\r
@@ -178,7 +178,7 @@ UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9
                        sep=i\r
                        ls=l\r
                end\r
-               l+=ascii ? cw[c.chr] : 1000\r
+               l+=(ascii ? cw[c.chr] : 1000) || 0\r
                if(l>wmax)\r
                        #Automatic line break\r
                        if(sep==-1 or i==j)\r
@@ -202,7 +202,7 @@ UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9
       end\r
        end\r
        #Last chunk\r
-       if(border and not border.index('B').nil?)\r
+       if(border and not border.to_s.index('B').nil?)\r
                b+='B'\r
     end\r
        Cell(w,h,s[j,i-j],b,2,align,fill)\r