]> source.dussan.org Git - redmine.git/commitdiff
PDF: use DejaVuSans fonts in Vietnamese (#8566).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jun 2011 00:31:35 +0000 (00:31 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 10 Jun 2011 00:31:35 +0000 (00:31 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6035 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf.rb

index 97176a7f9e1873b3204ab5123305323cd8497468..7b50853b2d6e94687485eb46d6f74f23ab8054e2 100644 (file)
@@ -40,33 +40,39 @@ module Redmine
             @ic = Iconv.new(pdf_encoding, 'UTF-8')
           end
           super('P', 'mm', 'A4', (pdf_encoding == 'UTF-8'), pdf_encoding)
-          case pdf_encoding
-          when 'UTF-8'
-            @font_for_content = 'FreeSans'
-            @font_for_footer  = 'FreeSans'
-          when 'CP949'
-            extend(PDF_Korean)
-            AddUHCFont()
-            @font_for_content = 'UHC'
-            @font_for_footer  = 'UHC'
-          when 'CP932', 'SJIS', 'SHIFT_JIS'
-            extend(PDF_Japanese)
-            AddSJISFont()
-            @font_for_content = 'SJIS'
-            @font_for_footer  = 'SJIS'
-          when 'GB18030'
-            extend(PDF_Chinese)
-            AddGBFont()
-            @font_for_content = 'GB'
-            @font_for_footer  = 'GB'
-          when 'BIG5'
-            extend(PDF_Chinese)
-            AddBig5Font()
-            @font_for_content = 'Big5'
-            @font_for_footer  = 'Big5'
+          case current_language.to_s.downcase
+          when 'vi'
+            @font_for_content = 'DejaVuSans'
+            @font_for_footer  = 'DejaVuSans'
           else
-            @font_for_content = 'Arial'
-            @font_for_footer  = 'Helvetica'
+            case pdf_encoding
+            when 'UTF-8'
+              @font_for_content = 'FreeSans'
+              @font_for_footer  = 'FreeSans'
+            when 'CP949'
+              extend(PDF_Korean)
+              AddUHCFont()
+              @font_for_content = 'UHC'
+              @font_for_footer  = 'UHC'
+            when 'CP932', 'SJIS', 'SHIFT_JIS'
+              extend(PDF_Japanese)
+              AddSJISFont()
+              @font_for_content = 'SJIS'
+              @font_for_footer  = 'SJIS'
+            when 'GB18030'
+              extend(PDF_Chinese)
+              AddGBFont()
+              @font_for_content = 'GB'
+              @font_for_footer  = 'GB'
+            when 'BIG5'
+              extend(PDF_Chinese)
+              AddBig5Font()
+              @font_for_content = 'Big5'
+              @font_for_footer  = 'Big5'
+            else
+              @font_for_content = 'Arial'
+              @font_for_footer  = 'Helvetica'
+            end
           end
           SetCreator(Redmine::Info.app_name)
           SetFont(@font_for_content)