summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2015-02-08 10:38:48 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2015-02-08 10:38:48 +0000
commit18927905ba1d0ff938cb2bfd8d61ee9755bc7048 (patch)
tree215f475bad506818840746c02e8ad3a4f990c418
parent8fbd102d76918488f45ebedd0e0a32f4771ac337 (diff)
downloadredmine-18927905ba1d0ff938cb2bfd8d61ee9755bc7048.tar.gz
redmine-18927905ba1d0ff938cb2bfd8d61ee9755bc7048.zip
Merged r13976 from trunk to 2.6-stable (#10681, #18586)
pdf: remove styles of Arabic/Persian Italic and Thai Bold. Contributed by Jun NAITOH. git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@13983 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/export/pdf.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/redmine/export/pdf.rb b/lib/redmine/export/pdf.rb
index 64089e0d5..7dbe85ccd 100644
--- a/lib/redmine/export/pdf.rb
+++ b/lib/redmine/export/pdf.rb
@@ -37,7 +37,6 @@ module Redmine
super(orientation, 'mm', 'A4')
set_print_header(false)
set_rtl(l(:direction) == 'rtl')
- set_temp_rtl(l(:direction) == 'rtl' ? 'R' : 'L')
@font_for_content = l(:general_pdf_fontname)
@font_for_footer = l(:general_pdf_fontname)
@@ -50,10 +49,16 @@ module Redmine
end
def SetFontStyle(style, size)
- style.delete!('B') if current_language.to_s.downcase == 'th' # FreeSerif Bold Thai font has problem.
set_font(@font_for_content, style, size)
end
+ def SetFont(family, style='', size=0, fontfile='')
+ style.delete!('B') if current_language.to_s.downcase == 'th' # FreeSerif Bold Thai font has problem.
+ style.delete!('I') if current_language.to_s.downcase =~ /^(fa|ar)$/ # DejaVuSans Italic Arabic and Persian font has problem.
+ super(family, style, size, fontfile)
+ end
+ alias_method :set_font, :SetFont
+
def fix_text_encoding(txt)
RDMPdfEncoding::rdm_from_utf8(txt, "UTF-8")
end