rghost 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTA2ZGRmNDM2NTVhZmViYmJmNmM5M2IwM2I4ZTIzY2I2ODliYmE3NA==
4
+ NmNjNjcxYWM5NDA0OTkyNmVhMDIwYzdkMWE1OTlmOThhMGM4MzVlOA==
5
5
  data.tar.gz: !binary |-
6
- MTE1ZTk0YTkwZmM3YzBlYjY5YjFlMmJlOWQ3YTVjYTE2NzFlMGU4Mw==
6
+ ZjAyMTgwMWY0NjM5YzgxOTVlYTAwYThhZDU5N2ViYWQxNTg5MzI5Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGRkNzM3MDgzY2I0YzI5ODkzNTFkMTJlMmYwMjFmY2VhNDEyMmJkMmVkNGU0
10
- MmVmMzA1MjA0NTM4ZTgzN2E4YjA5NzQ3Mjk3Y2YwNjcyYjMzYWM1ZTFmZTc4
11
- NGFmZjBmYTM4OTNiNWZjOTZkNGZhZWI2Y2NmZmJhYmZhZmM4YTc=
9
+ N2FhZmRkYzJhZWY5MmRlOGRiYzVkZWU0MjQxNjBlZjJjODM1ZjQ2ODkxNGQ3
10
+ ZGVmNGFlNWE0YmY4NGY0MmU3YjRhNGM3YjE5YjhkNTA3ZjBlNDNlMmE0ZTQw
11
+ ZDY0NWM0ZmI1ZTc1MjA2N2Q2MmU1ZDg3ODAxMDY5MzQ2NDEzMTE=
12
12
  data.tar.gz: !binary |-
13
- Njk5NjE0NTVmODU0NzFlM2NlYmRlNmZiMmM4MDI4YmFlMjljNDBkMTFmNDYx
14
- NDI5ZGU5NTNjYjExOTY3MDBjMjc2MGZjMjJkNjI1OGNlMTc3MmQzNzIyMWI0
15
- ZWE2YzdlNzEwYTFkMmM0ODk5NDg2NDQyYjU0Zjc3ZDRhNGNiNzg=
13
+ OTI1MTRmNDRmMmU5NDg2NDk1OTE4MjA0MjYwODczNWVjYTViMjYzYTY4NmZj
14
+ ZTJmMTM5ZTExYjJlN2U5MzE1MjA0N2QyMTUxZTI3YjJhMGU0MThjYzMwNjVj
15
+ YTY3Y2NhNjZmZGExZWI5N2FiOGM4MTdkZTFkNTJjOGU2NmRiYjA=
@@ -138,7 +138,7 @@ module RGhost::Constants
138
138
  DEVICES_ALIAS={
139
139
  :eps => :epswrite,
140
140
  :pdf => :pdfwrite,
141
- :ps => :pswrite,
141
+ :ps => :ps2write,
142
142
  :pcl => :pxlmono,
143
143
  :tif => :tiffcrle,
144
144
  :tiff => :tiffcrle,
@@ -70,15 +70,8 @@ module RGhost::Config
70
70
  :default_params=> %w(gs -dNOPAUSE -dBATCH -dQUIET -dNOPAGEPROMPT),
71
71
  :stack_elements => 5000,
72
72
  :font_encoding => :IsoLatin,
73
- :charset_convert => begin
74
- if RUBY_VERSION =~ /^1.8/
75
- require 'iconv'
76
- lambda { |text| Iconv::iconv('latin1','utf-8', text).join }
77
- else
78
- lambda { |text| text.encode('ISO-8859-1', 'UTF-8') }
79
- end
80
- end,
81
- :external_encoding => nil,
73
+ :external_encoding => 'ascii-8bit',
74
+ :charset_convert => nil,
82
75
  :fontsize => 8,
83
76
  :unit => RGhost::Units::Cm
84
77
  }
@@ -120,10 +113,28 @@ module RGhost::Config
120
113
  d.benchmark(:stop)
121
114
  d.done
122
115
  d
116
+ end
123
117
 
118
+ #Generate the UTF-8 encoding mapping
119
+ #
120
+ # RGhost::Config.utf8_encodings.render :pdf, :filename => "/tmp/encoding_map.pdf"
121
+ #
122
+ def self.utf8_encodings
123
+ doc = RGhost::Document.new :paper => [20,10], :margin_left => 2.3, :margin_bottom => 2.3
124
124
 
125
+ doc.virtual_pages do
126
+ 7.times do
127
+ new_page :width => 2, :margin_left => 1
128
+ end
129
+ end
125
130
 
131
+ RGhost::RubyToPs::UTF8_ENCODINGS.each do |k,v|
132
+ doc.show "#{k} = #{v}"
133
+ doc.next_row
134
+ end
135
+ doc
126
136
  end
137
+
127
138
  #This method is a helper to gets the best encoding.
128
139
  #
129
140
  #link:images/encode_test.png
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  #Converts Ruby types to Postscript types
2
3
  module RGhost::RubyToPs
3
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rghost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shairon Toledo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-26 00:00:00.000000000 Z
11
+ date: 2014-07-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby Ghostscript Engine is a document creation and conversion API, support(PDF,PS,GIF,TIF,PNG,JPG...).
14
14
  It uses the GhostScript framework for the format conversion, utilizes EPS templates