rghost 0.8.3 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rghost.rb +0 -0
- data/lib/rghost/callback.rb +0 -0
- data/lib/rghost/color.rb +11 -4
- data/lib/rghost/constants.rb +0 -0
- data/lib/rghost/convert.rb +0 -0
- data/lib/rghost/cursor.rb +0 -0
- data/lib/rghost/document.rb +128 -22
- data/lib/rghost/document_callback_facade.rb +0 -0
- data/lib/rghost/dsc_entry.rb +0 -0
- data/lib/rghost/dynamic_document_callback.rb +0 -0
- data/lib/rghost/eps.rb +0 -0
- data/lib/rghost/font.rb +0 -0
- data/lib/rghost/font_map.rb +15 -1
- data/lib/rghost/frame.rb +0 -0
- data/lib/rghost/function.rb +5 -1
- data/lib/rghost/gif.rb +1 -1
- data/lib/rghost/graphic.rb +0 -0
- data/lib/rghost/grid/base_grid.rb +1 -1
- data/lib/rghost/grid/csv_grid.rb +2 -1
- data/lib/rghost/grid/dynamic_callback.rb +0 -0
- data/lib/rghost/grid/field_format.rb +0 -0
- data/lib/rghost/grid/grid.rb +0 -0
- data/lib/rghost/grid/header.rb +0 -0
- data/lib/rghost/grid/matrix.rb +0 -0
- data/lib/rghost/grid/rails_grid.rb +0 -0
- data/lib/rghost/grid/static_callback.rb +0 -0
- data/lib/rghost/grid/style/border_lines.rb +0 -0
- data/lib/rghost/grid/style/bottom_lines.rb +0 -0
- data/lib/rghost/grid/style/old_forms.rb +0 -0
- data/lib/rghost/grid/style/style.rb +0 -0
- data/lib/rghost/gs_alone.rb +8 -2
- data/lib/rghost/helpers.rb +0 -0
- data/lib/rghost/horizontal_line.rb +0 -0
- data/lib/rghost/image.rb +0 -0
- data/lib/rghost/jpeg.rb +1 -1
- data/lib/rghost/line.rb +0 -0
- data/lib/rghost/line_width.rb +0 -0
- data/lib/rghost/load.rb +2 -0
- data/lib/rghost/newpath.rb +0 -0
- data/lib/rghost/paper.rb +0 -0
- data/lib/rghost/pdf_security.rb +36 -0
- data/lib/rghost/point.rb +0 -0
- data/lib/rghost/point_with_command.rb +0 -0
- data/lib/rghost/ps/AdobeExpert.enc +0 -0
- data/lib/rghost/ps/AdobeLatinEncoding.enc +0 -0
- data/lib/rghost/ps/Bengali.enc +0 -0
- data/lib/rghost/ps/CodePage1250.enc +0 -0
- data/lib/rghost/ps/CodePage1251.enc +0 -0
- data/lib/rghost/ps/CodePage1252.enc +0 -0
- data/lib/rghost/ps/CodePage1253.enc +0 -0
- data/lib/rghost/ps/CodePage1254.enc +0 -0
- data/lib/rghost/ps/CodePage1256.enc +0 -0
- data/lib/rghost/ps/CodePage1257.enc +0 -0
- data/lib/rghost/ps/CodePage1258.enc +0 -0
- data/lib/rghost/ps/CodePage874.enc +0 -0
- data/lib/rghost/ps/IsoLatin.enc +0 -0
- data/lib/rghost/ps/MacCentralEuropean.enc +0 -0
- data/lib/rghost/ps/MacCyrillice.desnc +0 -0
- data/lib/rghost/ps/MacGreek.enc +0 -0
- data/lib/rghost/ps/MacHebrew.enc +0 -0
- data/lib/rghost/ps/TeX-CorkEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-LGR-Greek.enc +0 -0
- data/lib/rghost/ps/TeX-T2AModified2Encoding.enc +0 -0
- data/lib/rghost/ps/TeX-T2BAdobeEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-T2CAdobeEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-X2AdobeEncoding.enc +0 -0
- data/lib/rghost/ps/TeX-XL2encoding.enc +0 -0
- data/lib/rghost/ps/TeXMathExtensionEncoding.enc +0 -0
- data/lib/rghost/ps/TeXMathItalicEncoding.enc +0 -0
- data/lib/rghost/ps/TeXMathSymbolEncoding.enc +0 -0
- data/lib/rghost/ps/US-ASCII.enc +0 -0
- data/lib/rghost/ps/UTF-8.enc +0 -0
- data/lib/rghost/ps/basic.ps +0 -0
- data/lib/rghost/ps/begin_document.ps +0 -0
- data/lib/rghost/ps/callbacks.ps +0 -0
- data/lib/rghost/ps/code128.font +0 -0
- data/lib/rghost/ps/code39.font +0 -0
- data/lib/rghost/ps/cursor.ps +0 -0
- data/lib/rghost/ps/datagrid.ps +0 -0
- data/lib/rghost/ps/developer.ps +0 -0
- data/lib/rghost/ps/ean.font +0 -0
- data/lib/rghost/ps/eps.ps +0 -0
- data/lib/rghost/ps/font.ps +0 -0
- data/lib/rghost/ps/frame.ps +0 -0
- data/lib/rghost/ps/gif.ps +0 -0
- data/lib/rghost/ps/horizontal_line.ps +0 -0
- data/lib/rghost/ps/i25.font +0 -0
- data/lib/rghost/ps/jpeg.ps +0 -0
- data/lib/rghost/ps/link.ps +22 -0
- data/lib/rghost/ps/paper.ps +0 -0
- data/lib/rghost/ps/rect_link.ps +17 -0
- data/lib/rghost/ps/rectangle.ps +0 -0
- data/lib/rghost/ps/rghost_default_template.eps +0 -0
- data/lib/rghost/ps/row.ps +0 -0
- data/lib/rghost/ps/show.ps +0 -0
- data/lib/rghost/ps/table_callbacks.ps +0 -0
- data/lib/rghost/ps/text.ps +0 -0
- data/lib/rghost/ps/textarea.ps +0 -0
- data/lib/rghost/ps/type.ps +0 -0
- data/lib/rghost/ps/unit.ps +0 -0
- data/lib/rghost/ps/vertical_line.ps +0 -0
- data/lib/rghost/ps_facade.rb +22 -4
- data/lib/rghost/ps_object.rb +0 -0
- data/lib/rghost/rectangle_link.rb +65 -0
- data/lib/rghost/rgengine.so +0 -0
- data/lib/rghost/ruby_ghost_config.rb +7 -4
- data/lib/rghost/ruby_ghost_engine.rb +3 -1
- data/lib/rghost/ruby_ghost_version.rb +2 -2
- data/lib/rghost/ruby_to_ps.rb +0 -0
- data/lib/rghost/scale.rb +0 -0
- data/lib/rghost/show.rb +0 -0
- data/lib/rghost/static_document_callback.rb +0 -0
- data/lib/rghost/text.rb +0 -0
- data/lib/rghost/text_in.rb +1 -1
- data/lib/rghost/text_link_in.rb +42 -0
- data/lib/rghost/textarea.rb +0 -0
- data/lib/rghost/units.rb +0 -0
- data/lib/rghost/variable.rb +0 -0
- data/lib/rghost/vertical_line.rb +0 -0
- metadata +140 -142
data/lib/rghost.rb
CHANGED
File without changes
|
data/lib/rghost/callback.rb
CHANGED
File without changes
|
data/lib/rghost/color.rb
CHANGED
@@ -79,17 +79,24 @@ class RGhost::RGB < RGhost::Color
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def ps
|
82
|
+
value=color_params
|
82
83
|
|
83
|
-
value
|
84
|
+
array_to_stack(value.map{|n| n > 1 ? n/100.0: n})+"setrgbcolor"
|
85
|
+
end
|
86
|
+
def stack_format
|
87
|
+
color_params
|
88
|
+
end
|
89
|
+
def color_params
|
90
|
+
case @color
|
84
91
|
when Hash: [@color[:red] || @color[:r],@color[:green] || @color[:g],@color[:blue] || @color[:b]]
|
85
92
|
when Array: @color
|
86
93
|
when String: hex_to_rgb(@color)
|
87
94
|
when NilClass: [0,0,1]
|
88
95
|
end
|
89
|
-
|
90
|
-
|
96
|
+
|
97
|
+
|
91
98
|
end
|
92
|
-
|
99
|
+
|
93
100
|
private
|
94
101
|
|
95
102
|
def hex_to_rgb(color="#FFFFFF")
|
data/lib/rghost/constants.rb
CHANGED
File without changes
|
data/lib/rghost/convert.rb
CHANGED
File without changes
|
data/lib/rghost/cursor.rb
CHANGED
File without changes
|
data/lib/rghost/document.rb
CHANGED
@@ -1,21 +1,41 @@
|
|
1
1
|
##
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
2
|
+
#Ruby Ghost Engine - Document Builder.
|
3
|
+
#http://rghost.rubyforge.org
|
4
|
+
#Author Shairon Toledo <shairon.toledo at gmail.com> http://www.hashcode.eti.br
|
5
|
+
#Brazil Jun/2007
|
6
6
|
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
7
|
+
#Copyright (c) 2007-2008 Shairon Toledo
|
8
|
+
#
|
9
|
+
#Permission is hereby granted, free of charge, to any person
|
10
|
+
#obtaining a copy of this software and associated documentation
|
11
|
+
#files (the "Software"), to deal in the Software without
|
12
|
+
#restriction, including without limitation the rights to use,
|
13
|
+
#copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
#copies of the Software, and to permit persons to whom the
|
15
|
+
#Software is furnished to do so, subject to the following
|
16
|
+
#conditions:
|
17
|
+
#
|
18
|
+
#The above copyright notice and this permission notice shall be
|
19
|
+
#included in all copies or substantial portions of the Software.
|
20
|
+
#
|
21
|
+
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
22
|
+
#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
23
|
+
#OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
24
|
+
#NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
25
|
+
#HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
26
|
+
#WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
27
|
+
#FROM, OUT OF OR IN CONNECTION WITH
|
10
28
|
|
11
29
|
require 'ps_object'
|
12
30
|
require 'ps_facade'
|
13
31
|
require 'document_callback_facade'
|
14
32
|
require 'virtual_pages'
|
15
33
|
require 'variable'
|
34
|
+
require 'pdf_security'
|
16
35
|
#The Document class child of PsFacade is used to join postscript objects to generate output file.
|
17
36
|
|
18
37
|
class RGhost::Document < RGhost::PsFacade
|
38
|
+
attr_reader :additional_params
|
19
39
|
include RGhost::DocumentCallbackFacade
|
20
40
|
include RGhost::RubyToPs
|
21
41
|
DISABLE_VIRTUAL_PAGE=RGhost::Variable.new(:has_vp?, false)
|
@@ -67,8 +87,10 @@ class RGhost::Document < RGhost::PsFacade
|
|
67
87
|
@done=false
|
68
88
|
@docinfo={:Producer => "Ruby Ghostscript - RGhost v#{RGhost::VERSION::STRING}" }
|
69
89
|
@defines=[]
|
90
|
+
@additional_params=[]
|
70
91
|
|
71
92
|
default_variables
|
93
|
+
|
72
94
|
end
|
73
95
|
|
74
96
|
def gs_paper #:nodoc:
|
@@ -92,6 +114,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
92
114
|
#* <tt>:size</tt> - Font size.
|
93
115
|
#* <tt>:color</tt> - Color.create facade
|
94
116
|
#* <tt>:encoding</tt> - If true the font will be encoding using de pattern :font_encoding of the document.
|
117
|
+
#* <tt>:from</tt> - Load True Type or Type1 font from file.
|
95
118
|
#===Examples
|
96
119
|
# d=Document.new :encoding => 'IsoLatin'
|
97
120
|
# d.define_tags do
|
@@ -101,6 +124,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
101
124
|
# tag :other_font, :name => 'NimbusMonL-Regu', :size => 10
|
102
125
|
# tag :arial, :name => 'Arial-ItalicMT', :color => '#ADAD66'
|
103
126
|
# tag :arial_bold, :name => 'NimbusSanL-BoldItal',:size => 12, :color => '#ADAD66'
|
127
|
+
# tag :monaco, :name => 'Monaco', :from => "/path/to/myfont.ttf", :size => 12
|
104
128
|
# end
|
105
129
|
#You can use :default_font tag for custom the default font.
|
106
130
|
#===Using tags
|
@@ -122,8 +146,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
122
146
|
def define_tags(&block)
|
123
147
|
RGhost::Config::FONTMAP.instance_eval(&block)
|
124
148
|
end
|
125
|
-
|
126
|
-
|
149
|
+
|
127
150
|
def ps #:nodoc:
|
128
151
|
done unless @done
|
129
152
|
|
@@ -150,7 +173,10 @@ class RGhost::Document < RGhost::PsFacade
|
|
150
173
|
|
151
174
|
|
152
175
|
end
|
153
|
-
|
176
|
+
# def link(label,options={:to => 'http://rghost.rubyforge.net'})
|
177
|
+
# raw "/:link_str #{to_string(label)} def /:link_uri #{to_string(options[:to])} def :link_make"
|
178
|
+
#
|
179
|
+
# end
|
154
180
|
#Facade to RubyGhostEngine.render
|
155
181
|
#Converts a document to an output format, such as :pdf, :png, :ps, :jpeg, :tiff etc
|
156
182
|
#The paramter device can be found at RGhost::Constants::Devices or at http://pages.cs.wisc.edu/~ghost/doc/cvs/Devices.htm
|
@@ -160,6 +186,12 @@ class RGhost::Document < RGhost::PsFacade
|
|
160
186
|
#* <tt>:logfile</tt> - Writes the converter's process into a file.
|
161
187
|
#* <tt>:multipage</tt> - Whether true the output will be one page per file posfixed by _0001.ext, for example, for one file name 'test.png' with two pages will create test_001.png and test_002.png
|
162
188
|
#* <tt>:resolution</tt> - Integer value to output resolution.
|
189
|
+
#* <tt>:quality</tt> - Presets the "distiller parameters" to one of four predefined settings:
|
190
|
+
# :screen - selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
|
191
|
+
# :ebook - selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
|
192
|
+
# :printer - selects output similar to the Acrobat Distiller "Print Optimized" setting.
|
193
|
+
# :prepress - selects output similar to Acrobat Distiller "Prepress Optimized" setting.
|
194
|
+
# :default - selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.
|
163
195
|
#* <tt>:size</tt> - Crops a single page using a string of dimension, example, '200x180', '140x90'.
|
164
196
|
#* <tt>:range</tt> - Specifies range of pages(PDF only)
|
165
197
|
#====Ghostscript interpreter options
|
@@ -176,6 +208,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
176
208
|
# #do something
|
177
209
|
#
|
178
210
|
# doc.render :pdf, :filename => 'foo.pdf # PDF output
|
211
|
+
# doc.render :pdf, :filename => 'foo.pdf, :quality => :ebook # PDF output
|
179
212
|
# doc.render :jpeg, :filename => 'foo.jpg' # JPEG output
|
180
213
|
# doc.render :png, :filename => 'foo.png', :multipage => true # PNG output one page per file
|
181
214
|
# doc.render :tiff, :filename => 'foo.tiff', :resolution => 300 # TIFF with 300dpi
|
@@ -236,7 +269,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
236
269
|
# #Repeting ten times the same code
|
237
270
|
# 10.times{ doc.call :piece }
|
238
271
|
def define(name,&block)
|
239
|
-
@defines << RGhost::Function.new(name,&block)
|
272
|
+
@defines << RGhost::Function.new("_#{name}",&block)
|
240
273
|
end
|
241
274
|
def define_variable(name,value)
|
242
275
|
set RGhost::Variable.new(name,value)
|
@@ -284,7 +317,52 @@ class RGhost::Document < RGhost::PsFacade
|
|
284
317
|
def virtual_pages(&block)
|
285
318
|
set RGhost::VirtualPages.new(&block)
|
286
319
|
end
|
320
|
+
{
|
321
|
+
:base => -4,
|
322
|
+
:print => -4,
|
323
|
+
:modify => -8,
|
324
|
+
:copy => -16,
|
325
|
+
:annotate => -32,
|
326
|
+
:interactive => -256,
|
327
|
+
:copy_access => -512,
|
328
|
+
:assemble => -1024,
|
329
|
+
:high_quality_print => -2048,
|
330
|
+
:all => -3904}
|
287
331
|
|
332
|
+
#Security disable the permissions and define passwords to PDF documents.
|
333
|
+
#The password just support set of \w .
|
334
|
+
#Always that use the block security should set owner and user password. By default the encryption is 3.
|
335
|
+
#Document Security can be set with the permissions flags
|
336
|
+
#===Disable options
|
337
|
+
#* <tt>:base or :print</tt> Print document (possibly not at the highest quality level).
|
338
|
+
#* <tt>:modify</tt>Modify contents of document, except as controlled by :annotate, :interective and :assemble.
|
339
|
+
#* <tt>:copy</tt>Copy text and graphics from document other than that controlled by :copy_access
|
340
|
+
#* <tt>:annotate</tt>Add or modify text annotations, fill in interactive form fields, and if :interective is set, create or modify interactive form fields
|
341
|
+
#* <tt>:interactive</tt>Fill in existing interacive form fields, even if :annotate is clear
|
342
|
+
#* <tt>:copy_access</tt>Extract text and graphics (in support of accessibility to disabled users or for other purposes).
|
343
|
+
#* <tt>:assemble</tt>Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even when :base is clear
|
344
|
+
#* <tt>:high_quality_print</tt>Add or modify text annotations
|
345
|
+
#* <tt>:all</tt>Disable all permissions.
|
346
|
+
#===Example 1
|
347
|
+
# doc.security do |sec|
|
348
|
+
# sec.owner_password ="owner" #password without space!
|
349
|
+
# sec.user_password ="user" #password without space!
|
350
|
+
# sec.key_length = 128
|
351
|
+
# sec.disable :print, :copy, :high_quality
|
352
|
+
# end
|
353
|
+
#===Example 2
|
354
|
+
#Disable all
|
355
|
+
# doc.security do |sec|
|
356
|
+
# sec.owner_password ="owner" #password without space!
|
357
|
+
# sec.user_password ="user" #password without space!
|
358
|
+
# sec.disable :all
|
359
|
+
# end
|
360
|
+
#
|
361
|
+
def security
|
362
|
+
sec=RGhost::PdfSecurity.new
|
363
|
+
yield sec
|
364
|
+
@additional_params << sec.gs_params
|
365
|
+
end
|
288
366
|
|
289
367
|
#Starts and Ends internal benckmark will write in bottom of page.
|
290
368
|
#===Example
|
@@ -388,15 +466,44 @@ class RGhost::Document < RGhost::PsFacade
|
|
388
466
|
set RGhost::Variable.new(:limit_right, 'source_limit_right')
|
389
467
|
|
390
468
|
end
|
391
|
-
|
392
|
-
|
469
|
+
|
470
|
+
#Configures properties about your document.
|
471
|
+
#The keys are supported :Creator, :Title, :Author, :Subject and :Keywords, or downcase as :title etc.
|
472
|
+
#Example:
|
473
|
+
# doc.properties :Autor => "Shairon Toledo", :Title => "Learning RGhost"
|
474
|
+
def info(docinfo={})
|
475
|
+
#puts docinfo.inspect
|
393
476
|
@docinfo.merge!(docinfo)
|
394
|
-
puts @docinfo.inspect
|
477
|
+
#puts @docinfo.inspect
|
395
478
|
end
|
396
|
-
|
397
|
-
#
|
398
|
-
|
399
|
-
|
479
|
+
|
480
|
+
#Creates Grid::Rails inside of the document. Facade to RGhost::Grid::Rails
|
481
|
+
def rails_grid(default_columns_options={})
|
482
|
+
|
483
|
+
grid=Grid::Rails.new(default_columns_options)
|
484
|
+
yield grid
|
485
|
+
grid.style(default_columns_options[:style]) if default_columns_options[:style]
|
486
|
+
grid.data(default_columns_options[:data]) if default_columns_options[:data]
|
487
|
+
set grid
|
488
|
+
|
489
|
+
end
|
490
|
+
#Creates Grid::CSV inside of the document. Facade to RGhost::Grid::CSV
|
491
|
+
def csv_grid(default_columns_options={})
|
492
|
+
grid=Grid::CSV.new(default_columns_options)
|
493
|
+
yield grid
|
494
|
+
grid.style(default_columns_options[:style]) if default_columns_options[:style]
|
495
|
+
grid.data(default_columns_options[:data]) if default_columns_options[:data]
|
496
|
+
set grid
|
497
|
+
end
|
498
|
+
#Creates Grid::Matrix inside of the document. Facade to RGhost::Grid::Matrix
|
499
|
+
def matrix_grid(default_columns_options={})
|
500
|
+
grid=Grid::Matrix.new(default_columns_options)
|
501
|
+
yield grid
|
502
|
+
grid.style(default_columns_options[:style]) if default_columns_options[:style]
|
503
|
+
set grid
|
504
|
+
end
|
505
|
+
|
506
|
+
|
400
507
|
private
|
401
508
|
|
402
509
|
def default_variables
|
@@ -419,13 +526,12 @@ class RGhost::Document < RGhost::PsFacade
|
|
419
526
|
d=["["]
|
420
527
|
|
421
528
|
@docinfo.each do |k,v|
|
422
|
-
puts "/#{k} (#{v}) "
|
423
529
|
d << "/#{k.to_s.capitalize}"
|
424
530
|
d << to_string(v)
|
425
531
|
end
|
426
|
-
|
427
|
-
|
428
|
-
|
532
|
+
d << "/DOCINFO"
|
533
|
+
d << "pdfmark "
|
534
|
+
d.join(" ")
|
429
535
|
end
|
430
536
|
|
431
537
|
end
|
File without changes
|
data/lib/rghost/dsc_entry.rb
CHANGED
File without changes
|
File without changes
|
data/lib/rghost/eps.rb
CHANGED
File without changes
|
data/lib/rghost/font.rb
CHANGED
File without changes
|
data/lib/rghost/font_map.rb
CHANGED
@@ -6,7 +6,7 @@ require 'function'
|
|
6
6
|
require 'color'
|
7
7
|
|
8
8
|
class RGhost::FontMap < RGhost::PsObject #:nodoc:
|
9
|
-
|
9
|
+
include RGhost::RubyToPs
|
10
10
|
def initialize(options={:font => "Helvetica", :size => 8},&block)
|
11
11
|
|
12
12
|
#options[:name]=options[:font]
|
@@ -24,11 +24,18 @@ class RGhost::FontMap < RGhost::PsObject #:nodoc:
|
|
24
24
|
new(name,options)
|
25
25
|
end
|
26
26
|
|
27
|
+
|
27
28
|
def ps
|
28
29
|
functions=[]
|
29
30
|
fonts=""
|
30
31
|
@fonts.each do |name,params|
|
31
32
|
options=@options
|
33
|
+
if params[:from]
|
34
|
+
[params[:from]].flatten.each do |font|
|
35
|
+
functions << format_custom_font(font)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
32
39
|
functions << RGhost::Function.new("_#{name}") do
|
33
40
|
raw RGhost::Font.new(options.dup.merge(params)).ps
|
34
41
|
raw( RGhost::Color.create(params[:color] || 0) )
|
@@ -36,5 +43,12 @@ class RGhost::FontMap < RGhost::PsObject #:nodoc:
|
|
36
43
|
end
|
37
44
|
functions.join
|
38
45
|
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def format_custom_font(font_path)
|
49
|
+
ps=RGhost::PsObject.new
|
50
|
+
ps.raw "#{to_string(font_path)} findfont pop"
|
51
|
+
ps
|
52
|
+
end
|
39
53
|
end
|
40
54
|
|
data/lib/rghost/frame.rb
CHANGED
File without changes
|
data/lib/rghost/function.rb
CHANGED
data/lib/rghost/gif.rb
CHANGED
data/lib/rghost/graphic.rb
CHANGED
File without changes
|
@@ -51,7 +51,7 @@ class RGhost::Grid::Base < RGhost::PsObject
|
|
51
51
|
#* <tt>:align</tt> - Align for all data(:left, :center and :right).
|
52
52
|
#* <tt>:title_align</tt> - Align for all the header's name(:left, :center and :right).
|
53
53
|
def initialize(options={})
|
54
|
-
|
54
|
+
|
55
55
|
@header=RGhost::Grid::Header.new( (options[:headings] == false)?false:true )
|
56
56
|
@header.default_options(options)
|
57
57
|
@callbacks=RGhost::PsObject.new
|
data/lib/rghost/grid/csv_grid.rb
CHANGED
@@ -32,7 +32,8 @@ class RGhost::Grid::CSV < RGhost::Grid::Base
|
|
32
32
|
if first
|
33
33
|
v=l.size-@header.titles.size
|
34
34
|
#v.times{@header.titles << "tt"}
|
35
|
-
l.each {|h| col(h)}
|
35
|
+
#l.each {|h| col(h)} if @header.titles.size == 0
|
36
|
+
l.each {|h| col("")} if @header.titles.size == 0
|
36
37
|
proc_line(l)
|
37
38
|
first=false
|
38
39
|
|
File without changes
|
File without changes
|
data/lib/rghost/grid/grid.rb
CHANGED
File without changes
|
data/lib/rghost/grid/header.rb
CHANGED
File without changes
|
data/lib/rghost/grid/matrix.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rghost/gs_alone.rb
CHANGED
@@ -8,6 +8,10 @@ class RGhost::GSAlone #:nodoc:
|
|
8
8
|
|
9
9
|
def run
|
10
10
|
cmd=@params.join(" ")
|
11
|
+
puts File.exists?(RGhost::Config::GS[:path].to_s)
|
12
|
+
unless File.exists?(RGhost::Config::GS[:path].to_s)
|
13
|
+
RGhost::Config.config_platform
|
14
|
+
end
|
11
15
|
r=system(RGhost::Config::GS[:path]+cmd)
|
12
16
|
|
13
17
|
puts RGhost::Config::GS[:path]+cmd if @debug
|
@@ -15,5 +19,7 @@ class RGhost::GSAlone #:nodoc:
|
|
15
19
|
r
|
16
20
|
end
|
17
21
|
|
18
|
-
|
19
|
-
|
22
|
+
|
23
|
+
|
24
|
+
end
|
25
|
+
|
data/lib/rghost/helpers.rb
CHANGED
File without changes
|
File without changes
|
data/lib/rghost/image.rb
CHANGED
File without changes
|