Project

General

Profile

Defect #61 » pdf_encoding.patch

Jun NAITOH, 2011-04-10 01:52

View differences:

lib/redmine/export/pdf.rb 2011-04-08 07:33:02.000000000 +0900 → lib/redmine/export/pdf.rb 2011-04-10 07:41:14.000000000 +0900
88 88
        def initialize(lang)
89 89
          super()
90 90
          set_language_if_valid lang
91
          case current_language.to_s.downcase
92
          when 'ko'
91
          case l(:general_pdf_encoding).upcase
92
          when 'CP949'
93 93
            extend(PDF_Korean)
94 94
            AddUHCFont()
95 95
            @font_for_content = 'UHC'
96 96
            @font_for_footer  = 'UHC'
97
          when 'ja'
97
          when 'CP932'
98 98
            extend(PDF_Japanese)
99 99
            AddSJISFont()
100 100
            @font_for_content = 'SJIS'
101 101
            @font_for_footer = 'SJIS'
102
          when 'zh'
102
          when 'GB18030'
103 103
            extend(PDF_Chinese)
104 104
            AddGBFont()
105 105
            @font_for_content = 'GB'
106 106
            @font_for_footer = 'GB'
107
          when 'zh-tw'
107
          when 'BIG5'
108 108
            extend(PDF_Chinese)
109 109
            AddBig5Font()
110 110
            @font_for_content = 'Big5'
......
189 189

  
190 190
      # Returns a PDF string of a list of issues
191 191
      def issues_to_pdf(issues, project, query)
192
        if ( current_language.to_s.downcase == 'ko'    ||
193
             current_language.to_s.downcase == 'ja'    ||
194
             current_language.to_s.downcase == 'zh'    ||
195
             current_language.to_s.downcase == 'zh-tw' ||
196
             current_language.to_s.downcase == 'th'    )
192
        if l(:general_pdf_encoding).upcase != 'UTF-8'
197 193
          pdf = IFPDF.new(current_language)
198 194
        else
199 195
          pdf = ITCPDF.new(current_language)
......
269 265

  
270 266
      # Returns a PDF string of a single issue
271 267
      def issue_to_pdf(issue)
272
        if ( current_language.to_s.downcase == 'ko'    ||
273
             current_language.to_s.downcase == 'ja'    ||
274
             current_language.to_s.downcase == 'zh'    ||
275
             current_language.to_s.downcase == 'zh-tw' ||
276
             current_language.to_s.downcase == 'th'    )
268
        if l(:general_pdf_encoding).upcase != 'UTF-8'
277 269
          pdf = IFPDF.new(current_language)
278 270
        else
279 271
          pdf = ITCPDF.new(current_language)
lib/redmine/helpers/gantt.rb 2011-04-08 07:44:23.000000000 +0900 → lib/redmine/helpers/gantt.rb 2011-04-10 07:40:31.000000000 +0900
507 507
      end if Object.const_defined?(:Magick)
508 508

  
509 509
      def to_pdf
510
        if ( current_language.to_s.downcase == 'ko'    ||
511
             current_language.to_s.downcase == 'ja'    ||
512
             current_language.to_s.downcase == 'zh'    ||
513
             current_language.to_s.downcase == 'zh-tw' ||
514
             current_language.to_s.downcase == 'th'    )
510
        if l(:general_pdf_encoding).upcase != 'UTF-8'
515 511
          pdf = ::Redmine::Export::PDF::IFPDF.new(current_language)
516 512
        else
517 513
          pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language)
(43-43/46)