rghost 0.6.6 → 0.7.0

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.
Files changed (39) hide show
  1. data/History.txt +1 -1
  2. data/Manifest.txt +42 -12
  3. data/lib/rghost/document.rb +11 -2
  4. data/lib/rghost/load.rb +3 -1
  5. data/lib/rghost/ps/AdobeExpert.enc +258 -0
  6. data/lib/rghost/ps/AdobeLatinEncoding.enc +258 -0
  7. data/lib/rghost/ps/Bengali.enc +386 -0
  8. data/lib/rghost/ps/CodePage1250.enc +258 -0
  9. data/lib/rghost/ps/CodePage1251.enc +258 -0
  10. data/lib/rghost/ps/CodePage1252.enc +258 -0
  11. data/lib/rghost/ps/CodePage1253.enc +258 -0
  12. data/lib/rghost/ps/CodePage1254.enc +258 -0
  13. data/lib/rghost/ps/CodePage1256.enc +258 -0
  14. data/lib/rghost/ps/CodePage1257.enc +258 -0
  15. data/lib/rghost/ps/CodePage1258.enc +258 -0
  16. data/lib/rghost/ps/CodePage874.enc +258 -0
  17. data/lib/rghost/ps/IsoLatin.enc +352 -0
  18. data/lib/rghost/ps/MacCentralEuropean.enc +258 -0
  19. data/lib/rghost/ps/MacCyrillice.enc +258 -0
  20. data/lib/rghost/ps/MacGreek.enc +258 -0
  21. data/lib/rghost/ps/MacHebrew.enc +258 -0
  22. data/lib/rghost/ps/TeX-CorkEncoding.enc +258 -0
  23. data/lib/rghost/ps/TeX-LGR-Greek.enc +258 -0
  24. data/lib/rghost/ps/TeX-T2AModified2Encoding.enc +258 -0
  25. data/lib/rghost/ps/TeX-T2BAdobeEncoding.enc +258 -0
  26. data/lib/rghost/ps/TeX-T2CAdobeEncoding.enc +258 -0
  27. data/lib/rghost/ps/TeX-X2AdobeEncoding.enc +258 -0
  28. data/lib/rghost/ps/TeX-XL2encoding.enc +258 -0
  29. data/lib/rghost/ps/TeXMathExtensionEncoding.enc +258 -0
  30. data/lib/rghost/ps/TeXMathItalicEncoding.enc +258 -0
  31. data/lib/rghost/ps/TeXMathSymbolEncoding.enc +258 -0
  32. data/lib/rghost/ps/US-ASCII.enc +258 -0
  33. data/lib/rghost/ps/UTF-8.enc +3 -0
  34. data/lib/rghost/ps/font.ps +1 -1
  35. data/lib/rghost/ruby_ghost_config.rb +4 -1
  36. data/lib/rghost/ruby_to_ps.rb +2 -0
  37. data/lib/rghost/version.rb +2 -2
  38. data/lib/rgteste.rb +46 -0
  39. metadata +44 -14
@@ -0,0 +1,3 @@
1
+ /UTF-8
2
+ [/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicoln /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.nodef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /exclamdown /cent /sterling /fraction /yen /florin /section /currency /quotesingle /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi /fl /.notdef /endash /dagger /daggerdbl /periodcentered /.notdef /paragraph /bullet /quotesinglbase /quotedblbase /quotedblright /guillemotright /ellipsis /perthousand /.notdef /questiondown /.notdef /grave /acute /circumflex /tilde /macron /breve /dotaccent /ieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /emdash /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /AE /.notdef /ordfeminine /.notdef /.notdef /.notdef /.notdef /Lslash /Oslash /OE /ordmasculine /.notdef /.notdef /.notdef /.notdef /.notdef /ae /.notdef /.notdef /.notdef /dotlessi /.notdef /.notdef /lslash /oslash /oe /germandbls /.notdef /.notdef /.notdef /.notdef]
3
+ def
@@ -1,5 +1,5 @@
1
1
  /fontsize 8 def
2
- /encoding_font { findfont dup length dict begin { 1 index /FID ne { def } { pop pop } ifelse } bind forall /Encoding ISOLatin1Encoding def currentdict end } def
2
+ /encoding_font { findfont dup length dict begin { 1 index /FID ne { def } { pop pop } ifelse } bind forall /Encoding default_encoding def currentdict end } def
3
3
 
4
4
  /Helvetica encoding_font
5
5
  /Helvetica-encoding exch definefont pop
@@ -1,5 +1,5 @@
1
1
  require "ps_object"
2
-
2
+ require 'iconv'
3
3
 
4
4
  module RubyGhostConfig
5
5
  GS={
@@ -9,6 +9,9 @@ module RubyGhostConfig
9
9
  :pslibdir => File.dirname(__FILE__)+File::SEPARATOR+"ps",
10
10
  :default_params=> %w(gs -dNOPAUSE -dBATCH -dQUIET -dNOPAGEPROMPT),
11
11
  :stack_elements => 5000,
12
+ :font_encoding => :IsoLatin,
13
+ :charset_convert => nil, #lambda {|text| Iconv::iconv('latin1','utf8', text) },
14
+ :fontsize => 8,
12
15
  :unit => Units::Cm
13
16
  }
14
17
 
@@ -4,7 +4,9 @@ module RubyToPs
4
4
  #Converte uma string Ruby para string Postscript
5
5
  def to_string(value)
6
6
  #ps escape
7
+ value=RubyGhostConfig::GS[:charset_convert].call(value.to_s).to_s if RubyGhostConfig::GS[:charset_convert]
7
8
  ps_str=ps_escape(value)
9
+
8
10
  "(#{ps_str}) "
9
11
 
10
12
  end
@@ -1,8 +1,8 @@
1
1
  module Rghost #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 6
5
- TINY = 6
4
+ MINOR = 7
5
+ TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/rgteste.rb ADDED
@@ -0,0 +1,46 @@
1
+ require 'rubygems'
2
+ require 'active_record'
3
+ require 'rghost'
4
+
5
+ ActiveRecord::Base.establish_connection(
6
+ :adapter => 'postgresql',
7
+ :database => 'cdr',
8
+ :username => 'fonip',
9
+ :password => 'qwe123',
10
+ :host => 'panoramix'
11
+
12
+ )
13
+
14
+ class Zenite < ActiveRecord::Base
15
+ set_table_name 'bh_ivanet_zenite'
16
+ def Zenite.inheritance_column
17
+
18
+ end
19
+
20
+ end
21
+
22
+
23
+ z=Zenite.find(:all, :limit => 30)
24
+
25
+
26
+ g=DataGrid::RailsGrid.new :width => 3
27
+
28
+ g.col :simid, :title => "Sim id"
29
+ g.col :sinallevel, :title => "Sinal"
30
+ g.col :sim, :title => "Sim"
31
+ g.col :answer, :title => "Answer", :format => lambda {|v| (v)?"Sim":"Não éâ" }
32
+ g.data(z)
33
+
34
+
35
+
36
+ d=Document.new
37
+
38
+ d.set g
39
+
40
+
41
+ d.done
42
+ puts d.ps
43
+ out=d.render :pdf, :filename => "/tmp/teste.pdf"
44
+ puts out.errors
45
+
46
+
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: rghost
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.6
7
- date: 2007-06-11 00:00:00 -03:00
6
+ version: 0.7.0
7
+ date: 2007-06-13 00:00:00 -03:00
8
8
  summary: description of gem
9
9
  require_paths:
10
10
  - lib
@@ -87,30 +87,59 @@ files:
87
87
  - lib/rghost/rgengine.so
88
88
  - lib/rghost/constants.rb
89
89
  - lib/rghost/ps
90
- - lib/rghost/ps/horizontal_line.ps
90
+ - lib/rghost/ps/TeX-T2CAdobeEncoding.enc
91
+ - lib/rghost/ps/TeX-LGR-Greek.enc
92
+ - lib/rghost/ps/MacGreek.enc
91
93
  - lib/rghost/ps/rectangle.ps
92
- - lib/rghost/ps/gif.ps
93
- - lib/rghost/ps/font.ps
94
- - lib/rghost/ps/paper.ps
94
+ - lib/rghost/ps/IsoLatin.enc
95
95
  - lib/rghost/ps/row.ps
96
- - lib/rghost/ps/functions.ps
97
96
  - lib/rghost/ps/code39.font
98
- - lib/rghost/ps/cursor.ps
99
- - lib/rghost/ps/textarea.ps
100
- - lib/rghost/ps/datagrid.ps
97
+ - lib/rghost/ps/MacHebrew.enc
101
98
  - lib/rghost/ps/callbacks.ps
99
+ - lib/rghost/ps/datagrid.ps
102
100
  - lib/rghost/ps/unit.ps
103
- - lib/rghost/ps/show.ps
101
+ - lib/rghost/ps/begin_document.ps
104
102
  - lib/rghost/ps/vertical_line.ps
105
103
  - lib/rghost/ps/basic.ps
106
104
  - lib/rghost/ps/type.ps
107
- - lib/rghost/ps/begin_document.ps
108
- - lib/rghost/ps/i25.font
105
+ - lib/rghost/ps/AdobeExpert.enc
106
+ - lib/rghost/ps/Bengali.enc
107
+ - lib/rghost/ps/UTF-8.enc
109
108
  - lib/rghost/ps/jpeg.ps
109
+ - lib/rghost/ps/TeX-T2BAdobeEncoding.enc
110
110
  - lib/rghost/ps/table_callbacks.ps
111
111
  - lib/rghost/ps/eps.ps
112
- - lib/rghost/ps/ean.font
113
112
  - lib/rghost/ps/code128.font
113
+ - lib/rghost/ps/CodePage874.enc
114
+ - lib/rghost/ps/gif.ps
115
+ - lib/rghost/ps/TeXMathItalicEncoding.enc
116
+ - lib/rghost/ps/US-ASCII.enc
117
+ - lib/rghost/ps/horizontal_line.ps
118
+ - lib/rghost/ps/CodePage1250.enc
119
+ - lib/rghost/ps/font.ps
120
+ - lib/rghost/ps/TeXMathExtensionEncoding.enc
121
+ - lib/rghost/ps/TeX-T2AModified2Encoding.enc
122
+ - lib/rghost/ps/CodePage1251.enc
123
+ - lib/rghost/ps/CodePage1252.enc
124
+ - lib/rghost/ps/CodePage1253.enc
125
+ - lib/rghost/ps/CodePage1254.enc
126
+ - lib/rghost/ps/paper.ps
127
+ - lib/rghost/ps/CodePage1256.enc
128
+ - lib/rghost/ps/functions.ps
129
+ - lib/rghost/ps/CodePage1257.enc
130
+ - lib/rghost/ps/TeX-CorkEncoding.enc
131
+ - lib/rghost/ps/CodePage1258.enc
132
+ - lib/rghost/ps/cursor.ps
133
+ - lib/rghost/ps/show.ps
134
+ - lib/rghost/ps/TeX-X2AdobeEncoding.enc
135
+ - lib/rghost/ps/textarea.ps
136
+ - lib/rghost/ps/MacCyrillice.enc
137
+ - lib/rghost/ps/i25.font
138
+ - lib/rghost/ps/ean.font
139
+ - lib/rghost/ps/TeXMathSymbolEncoding.enc
140
+ - lib/rghost/ps/MacCentralEuropean.enc
141
+ - lib/rghost/ps/AdobeLatinEncoding.enc
142
+ - lib/rghost/ps/TeX-XL2encoding.enc
114
143
  - lib/rghost/cursor.rb
115
144
  - lib/rghost/textarea.rb
116
145
  - lib/rghost/variable.rb
@@ -128,6 +157,7 @@ files:
128
157
  - lib/rghost/ps_object.rb
129
158
  - lib/rghost/ruby_ghost_config.rb
130
159
  - lib/rghost/ruby_ghost_engine.rb
160
+ - lib/rgteste.rb
131
161
  test_files:
132
162
  - test/test_helper.rb
133
163
  - test/test_rghost.rb