obf 0.9.8.24 → 0.9.8.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/obf/pdf.rb +12 -11
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e6add0691a31359799dec36bf6c6e8233b853bd89a34395581a117be36a09051
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a3092d682f7e92f8b3718df3101b4c75c90747f720ff75779f12da36cce3b635
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 505f71a0513920346010ffc1195d1b50f6667098cf85775f274f594801f9785562cac336652e1eeb980354d1eb0ec49e368ae99612b16f015b7bd2cb879d27b0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 8a1df87595566010257673eecc64e88a741814bfe833d7a21f21e36728a6296ed322c2fac99875f7a210bd44d76227a54a55ecaf7a09e39bf6e715e9ab283bdc
         
     | 
    
        data/lib/obf/pdf.rb
    CHANGED
    
    | 
         @@ -44,25 +44,25 @@ module OBF::PDF 
     | 
|
| 
       44 
44 
     | 
    
         
             
                  }
         
     | 
| 
       45 
45 
     | 
    
         
             
                  pdf = Prawn::Document.new(doc_opts)
         
     | 
| 
       46 
46 
     | 
    
         
             
                  # remember: https://www.alphabet-type.com/tools/charset-checker/
         
     | 
| 
       47 
     | 
    
         
            -
                  pdf.font_families 
     | 
| 
      
 47 
     | 
    
         
            +
                  pdf.font_families.update('THFahKwangBold' => {
         
     | 
| 
       48 
48 
     | 
    
         
             
                    normal: {font: 'THFahKwangBold', file: File.expand_path('../../THFahKwangBold.ttf', __FILE__)}
         
     | 
| 
       49 
     | 
    
         
            -
                  }
         
     | 
| 
       50 
     | 
    
         
            -
                  pdf.font_families 
     | 
| 
      
 49 
     | 
    
         
            +
                  })
         
     | 
| 
      
 50 
     | 
    
         
            +
                  pdf.font_families.update('MiedingerBook' => {
         
     | 
| 
       51 
51 
     | 
    
         
             
                    normal: {font: 'MiedingerBook', file: File.expand_path('../../MiedingerBook.ttf', __FILE__)}
         
     | 
| 
       52 
     | 
    
         
            -
                  }
         
     | 
| 
       53 
     | 
    
         
            -
                  pdf.font_families 
     | 
| 
      
 52 
     | 
    
         
            +
                  })
         
     | 
| 
      
 53 
     | 
    
         
            +
                  pdf.font_families.update('TimesNewRoman' => {
         
     | 
| 
       54 
54 
     | 
    
         
             
                    normal: {font: 'TimesNewRoman', file: File.expand_path('../../TimesNewRoman.ttf', __FILE__)}
         
     | 
| 
       55 
     | 
    
         
            -
                  }
         
     | 
| 
       56 
     | 
    
         
            -
                  pdf.font_families 
     | 
| 
      
 55 
     | 
    
         
            +
                  })
         
     | 
| 
      
 56 
     | 
    
         
            +
                  pdf.font_families.update('Arial' => {
         
     | 
| 
       57 
57 
     | 
    
         
             
                    normal: {font: 'Arial', file: File.expand_path('../../Arial.ttf', __FILE__)}
         
     | 
| 
       58 
     | 
    
         
            -
                  }
         
     | 
| 
       59 
     | 
    
         
            -
                  pdf.fallback_fonts = [' 
     | 
| 
      
 58 
     | 
    
         
            +
                  })
         
     | 
| 
      
 59 
     | 
    
         
            +
                  pdf.fallback_fonts = ['Times-Roman', 'THFahKwangBold', 'MiedingerBook', 'Arial']
         
     | 
| 
       60 
60 
     | 
    
         | 
| 
       61 
61 
     | 
    
         
             
                  font = opts['font'] if opts['font'] && File.exists?(opts['font'])
         
     | 
| 
       62 
62 
     | 
    
         
             
                  if font && File.exists?(font)
         
     | 
| 
       63 
63 
     | 
    
         
             
                    pdf.font(font) 
         
     | 
| 
       64 
64 
     | 
    
         
             
                  else
         
     | 
| 
       65 
     | 
    
         
            -
                     
     | 
| 
      
 65 
     | 
    
         
            +
                    pdf.font('Arial')
         
     | 
| 
       66 
66 
     | 
    
         
             
                  end
         
     | 
| 
       67 
67 
     | 
    
         | 
| 
       68 
68 
     | 
    
         
             
                  multi_render_paths = []
         
     | 
| 
         @@ -133,6 +133,7 @@ module OBF::PDF 
     | 
|
| 
       133 
133 
     | 
    
         
             
                    })
         
     | 
| 
       134 
134 
     | 
    
         
             
                  end
         
     | 
| 
       135 
135 
     | 
    
         
             
                  if multi_render_paths.length > 0
         
     | 
| 
      
 136 
     | 
    
         
            +
                    # `cp #{multi_render_paths[0]} #{dest_path}`
         
     | 
| 
       136 
137 
     | 
    
         
             
                    `gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=#{dest_path} #{multi_render_paths.join(' ')}`
         
     | 
| 
       137 
138 
     | 
    
         
             
                  else
         
     | 
| 
       138 
139 
     | 
    
         
             
                    pdf.render_file(dest_path)
         
     | 
| 
         @@ -360,7 +361,7 @@ module OBF::PDF 
     | 
|
| 
       360 
361 
     | 
    
         
             
                            if font && File.exists?(font)
         
     | 
| 
       361 
362 
     | 
    
         
             
                              pdf.font(font) 
         
     | 
| 
       362 
363 
     | 
    
         
             
                            else
         
     | 
| 
       363 
     | 
    
         
            -
                              pdf.font(' 
     | 
| 
      
 364 
     | 
    
         
            +
                              pdf.font('Times-Roman')
         
     | 
| 
       364 
365 
     | 
    
         
             
                            end
         
     | 
| 
       365 
366 
     | 
    
         
             
                            direction = text.match(rtl_regex) ? :rtl : :ltr
         
     | 
| 
       366 
367 
     | 
    
         
             
                            if options['text_case'] == 'upper'
         
     |