]> source.dussan.org Git - redmine.git/commitdiff
pdf: remove styles of Arabic/Persian Italic and Thai Bold (#10681, #18586)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 8 Feb 2015 04:04:24 +0000 (04:04 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 8 Feb 2015 04:04:24 +0000 (04:04 +0000)
Contributed by Jun NAITOH.

git-svn-id: http://svn.redmine.org/redmine/trunk@13976 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/export/pdf.rb

index c29fa909d3afc85a7bbc62d76b929828bd48be2b..dd1616f9cc44051a7a40ee40ce3a2f6ca038cbc3 100644 (file)
@@ -33,7 +33,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)
@@ -46,10 +45,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