Merged r6035 from trunk.

PDF: use DejaVuSans fonts in Vietnamese.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.2-stable@6037 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-06-10 02:15:47 +00:00
parent 1701de9123
commit 22e143f0b3
1 changed files with 32 additions and 26 deletions

View File

@ -40,33 +40,39 @@ module Redmine
@ic = Iconv.new(pdf_encoding, 'UTF-8') @ic = Iconv.new(pdf_encoding, 'UTF-8')
end end
super('P', 'mm', 'A4', (pdf_encoding == 'UTF-8'), pdf_encoding) super('P', 'mm', 'A4', (pdf_encoding == 'UTF-8'), pdf_encoding)
case pdf_encoding case current_language.to_s.downcase
when 'UTF-8' when 'vi'
@font_for_content = 'FreeSans' @font_for_content = 'DejaVuSans'
@font_for_footer = 'FreeSans' @font_for_footer = 'DejaVuSans'
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 else
@font_for_content = 'Arial' case pdf_encoding
@font_for_footer = 'Helvetica' 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 end
SetCreator(Redmine::Info.app_name) SetCreator(Redmine::Info.app_name)
SetFont(@font_for_content) SetFont(@font_for_content)