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
def initialize(lang)
super()
set_language_if_valid lang
case current_language.to_s.downcase
when 'ko'
case l(:general_pdf_encoding).upcase
when 'CP949'
extend(PDF_Korean)
AddUHCFont()
@font_for_content = 'UHC'
@font_for_footer = 'UHC'
when 'ja'
when 'CP932'
extend(PDF_Japanese)
AddSJISFont()
@font_for_content = 'SJIS'
@font_for_footer = 'SJIS'
when 'zh'
when 'GB18030'
extend(PDF_Chinese)
AddGBFont()
@font_for_content = 'GB'
@font_for_footer = 'GB'
when 'zh-tw'
when 'BIG5'
extend(PDF_Chinese)
AddBig5Font()
@font_for_content = 'Big5'
......
# Returns a PDF string of a list of issues
def issues_to_pdf(issues, project, query)
if ( current_language.to_s.downcase == 'ko' ||
current_language.to_s.downcase == 'ja' ||
current_language.to_s.downcase == 'zh' ||
current_language.to_s.downcase == 'zh-tw' ||
current_language.to_s.downcase == 'th' )
if l(:general_pdf_encoding).upcase != 'UTF-8'
pdf = IFPDF.new(current_language)
else
pdf = ITCPDF.new(current_language)
......
# Returns a PDF string of a single issue
def issue_to_pdf(issue)
if ( current_language.to_s.downcase == 'ko' ||
current_language.to_s.downcase == 'ja' ||
current_language.to_s.downcase == 'zh' ||
current_language.to_s.downcase == 'zh-tw' ||
current_language.to_s.downcase == 'th' )
if l(:general_pdf_encoding).upcase != 'UTF-8'
pdf = IFPDF.new(current_language)
else
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
end if Object.const_defined?(:Magick)
def to_pdf
if ( current_language.to_s.downcase == 'ko' ||
current_language.to_s.downcase == 'ja' ||
current_language.to_s.downcase == 'zh' ||
current_language.to_s.downcase == 'zh-tw' ||
current_language.to_s.downcase == 'th' )
if l(:general_pdf_encoding).upcase != 'UTF-8'
pdf = ::Redmine::Export::PDF::IFPDF.new(current_language)
else
pdf = ::Redmine::Export::PDF::ITCPDF.new(current_language)
(43-43/46)