rghost-ruby1.9-beta 0.8.7.2
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.
- data/lib/rghost.rb +18 -0
- data/lib/rghost/border.rb +44 -0
- data/lib/rghost/callback.rb +58 -0
- data/lib/rghost/circle.rb +102 -0
- data/lib/rghost/color.rb +175 -0
- data/lib/rghost/constants.rb +626 -0
- data/lib/rghost/convert.rb +43 -0
- data/lib/rghost/cursor.rb +124 -0
- data/lib/rghost/dash.rb +59 -0
- data/lib/rghost/document.rb +546 -0
- data/lib/rghost/document_callback_facade.rb +64 -0
- data/lib/rghost/dsc_entry.rb +20 -0
- data/lib/rghost/dynamic_document_callback.rb +15 -0
- data/lib/rghost/eps.rb +31 -0
- data/lib/rghost/font.rb +48 -0
- data/lib/rghost/font_map.rb +54 -0
- data/lib/rghost/frame.rb +105 -0
- data/lib/rghost/function.rb +38 -0
- data/lib/rghost/gif.rb +41 -0
- data/lib/rghost/graphic.rb +26 -0
- data/lib/rghost/grid/base_grid.rb +228 -0
- data/lib/rghost/grid/callback_facade.rb +136 -0
- data/lib/rghost/grid/csv_grid.rb +51 -0
- data/lib/rghost/grid/dynamic_callback.rb +12 -0
- data/lib/rghost/grid/field_format.rb +43 -0
- data/lib/rghost/grid/grid.rb +15 -0
- data/lib/rghost/grid/header.rb +120 -0
- data/lib/rghost/grid/matrix.rb +10 -0
- data/lib/rghost/grid/rails_grid.rb +74 -0
- data/lib/rghost/grid/static_callback.rb +13 -0
- data/lib/rghost/grid/style/border_lines.rb +44 -0
- data/lib/rghost/grid/style/bottom_lines.rb +28 -0
- data/lib/rghost/grid/style/old_forms.rb +28 -0
- data/lib/rghost/grid/style/style.rb +8 -0
- data/lib/rghost/gs_alone.rb +25 -0
- data/lib/rghost/helpers.rb +13 -0
- data/lib/rghost/horizontal_line.rb +45 -0
- data/lib/rghost/how_to.rb +75 -0
- data/lib/rghost/image.rb +26 -0
- data/lib/rghost/jpeg.rb +39 -0
- data/lib/rghost/line.rb +89 -0
- data/lib/rghost/line_width.rb +28 -0
- data/lib/rghost/load.rb +43 -0
- data/lib/rghost/newpath.rb +19 -0
- data/lib/rghost/paper.rb +147 -0
- data/lib/rghost/parse_text.rb +53 -0
- data/lib/rghost/pdf_security.rb +36 -0
- data/lib/rghost/point.rb +23 -0
- data/lib/rghost/point_with_command.rb +17 -0
- data/lib/rghost/polygon.rb +75 -0
- data/lib/rghost/ps/AdobeExpert.enc +258 -0
- data/lib/rghost/ps/AdobeLatinEncoding.enc +258 -0
- data/lib/rghost/ps/Bengali.enc +386 -0
- data/lib/rghost/ps/CodePage1250.enc +258 -0
- data/lib/rghost/ps/CodePage1251.enc +258 -0
- data/lib/rghost/ps/CodePage1252.enc +258 -0
- data/lib/rghost/ps/CodePage1253.enc +258 -0
- data/lib/rghost/ps/CodePage1254.enc +258 -0
- data/lib/rghost/ps/CodePage1256.enc +258 -0
- data/lib/rghost/ps/CodePage1257.enc +258 -0
- data/lib/rghost/ps/CodePage1258.enc +258 -0
- data/lib/rghost/ps/CodePage874.enc +258 -0
- data/lib/rghost/ps/Fontmap +5 -0
- data/lib/rghost/ps/IsoLatin.enc +352 -0
- data/lib/rghost/ps/MacCentralEuropean.enc +258 -0
- data/lib/rghost/ps/MacCyrillice.desnc +258 -0
- data/lib/rghost/ps/MacGreek.enc +258 -0
- data/lib/rghost/ps/MacHebrew.enc +258 -0
- data/lib/rghost/ps/TeX-CorkEncoding.enc +258 -0
- data/lib/rghost/ps/TeX-LGR-Greek.enc +258 -0
- data/lib/rghost/ps/TeX-T2AModified2Encoding.enc +258 -0
- data/lib/rghost/ps/TeX-T2BAdobeEncoding.enc +258 -0
- data/lib/rghost/ps/TeX-T2CAdobeEncoding.enc +258 -0
- data/lib/rghost/ps/TeX-X2AdobeEncoding.enc +258 -0
- data/lib/rghost/ps/TeX-XL2encoding.enc +258 -0
- data/lib/rghost/ps/TeXMathExtensionEncoding.enc +258 -0
- data/lib/rghost/ps/TeXMathItalicEncoding.enc +258 -0
- data/lib/rghost/ps/TeXMathSymbolEncoding.enc +258 -0
- data/lib/rghost/ps/US-ASCII.enc +258 -0
- data/lib/rghost/ps/UTF-8.enc +3 -0
- data/lib/rghost/ps/_cusor.ps +46 -0
- data/lib/rghost/ps/basic.ps +25 -0
- data/lib/rghost/ps/begin_document.ps +8 -0
- data/lib/rghost/ps/callbacks.ps +175 -0
- data/lib/rghost/ps/code128.font +344 -0
- data/lib/rghost/ps/code39.font +195 -0
- data/lib/rghost/ps/cursor.ps +106 -0
- data/lib/rghost/ps/datagrid.ps +55 -0
- data/lib/rghost/ps/developer.ps +237 -0
- data/lib/rghost/ps/ean.font +150 -0
- data/lib/rghost/ps/eps.ps +42 -0
- data/lib/rghost/ps/font.ps +38 -0
- data/lib/rghost/ps/frame.ps +16 -0
- data/lib/rghost/ps/gif.ps +150 -0
- data/lib/rghost/ps/horizontal_line.ps +4 -0
- data/lib/rghost/ps/i25.font +103 -0
- data/lib/rghost/ps/jpeg.ps +122 -0
- data/lib/rghost/ps/link.ps +22 -0
- data/lib/rghost/ps/paper.ps +8 -0
- data/lib/rghost/ps/rect_link.ps +17 -0
- data/lib/rghost/ps/rectangle.ps +5 -0
- data/lib/rghost/ps/rghost_default_template.eps +1532 -0
- data/lib/rghost/ps/row.ps +4 -0
- data/lib/rghost/ps/show.ps +21 -0
- data/lib/rghost/ps/table_callbacks.ps +96 -0
- data/lib/rghost/ps/text.ps +63 -0
- data/lib/rghost/ps/textarea.ps +11 -0
- data/lib/rghost/ps/type.ps +1 -0
- data/lib/rghost/ps/unit.ps +3 -0
- data/lib/rghost/ps/vertical_line.ps +12 -0
- data/lib/rghost/ps/virtual_pages.ps +55 -0
- data/lib/rghost/ps_facade.rb +253 -0
- data/lib/rghost/ps_object.rb +55 -0
- data/lib/rghost/rectangle_link.rb +65 -0
- data/lib/rghost/rgengine.so +0 -0
- data/lib/rghost/ruby_ghost_config.rb +243 -0
- data/lib/rghost/ruby_ghost_engine.rb +156 -0
- data/lib/rghost/ruby_ghost_version.rb +8 -0
- data/lib/rghost/ruby_to_ps.rb +78 -0
- data/lib/rghost/scale.rb +29 -0
- data/lib/rghost/shape_content.rb +23 -0
- data/lib/rghost/show.rb +88 -0
- data/lib/rghost/static_document_callback.rb +18 -0
- data/lib/rghost/text.rb +44 -0
- data/lib/rghost/text_in.rb +51 -0
- data/lib/rghost/text_link_in.rb +42 -0
- data/lib/rghost/textarea.rb +88 -0
- data/lib/rghost/units.rb +82 -0
- data/lib/rghost/variable.rb +12 -0
- data/lib/rghost/vertical_line.rb +37 -0
- data/lib/rghost/virtual_pages.rb +42 -0
- metadata +185 -0
data/lib/rghost.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
$LOAD_PATH << File.dirname(__FILE__)+File::SEPARATOR+"rghost"
|
|
2
|
+
require 'fileutils'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
module RGhost
|
|
6
|
+
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
require 'rghost/ruby_ghost_version'
|
|
10
|
+
require 'rghost/ps_object'
|
|
11
|
+
require 'rghost/variable'
|
|
12
|
+
require 'rghost/ps_facade'
|
|
13
|
+
require 'rghost/function'
|
|
14
|
+
require 'rghost/document'
|
|
15
|
+
require 'rghost/grid/grid'
|
|
16
|
+
RGhost::Config::GS[:PATH]="/opt/local/bin/gs"
|
|
17
|
+
|
|
18
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#Border object render a border around of vector shapes. Its sketch can be a combination of color, dashes, line joins and line caps.
|
|
2
|
+
#Usually its use inside of object facades, such as, Document, CallbackFacade and PsFacade as parameter :border, for example:
|
|
3
|
+
# d=Document.new
|
|
4
|
+
# d.horizontal_line :middle, :border => { :color => '#058412', :dash => [1,0,2] }
|
|
5
|
+
#You can use it as a new instance of Border and set inside of Document by method set, example:
|
|
6
|
+
# d=Document.new
|
|
7
|
+
# b=Border.new :color => '#058412', :dash => [1,0,2]
|
|
8
|
+
# d.set b
|
|
9
|
+
# d.lineto :x => 2.5, :y => 5
|
|
10
|
+
#===Options
|
|
11
|
+
#* <tt>:color</tt> - Facade to Color using the same parameter.
|
|
12
|
+
#* <tt>:dash</tt> - Facade to Dash using the same parameter.
|
|
13
|
+
#* <tt>:width</tt> - Facade to LineWidth using the same parameter.
|
|
14
|
+
#* <tt>:linejoin</tt> - Sets the line join parameter in the graphics state to int, which must be one of the integers 0, 1, or 2.
|
|
15
|
+
#====:linejoin examples
|
|
16
|
+
#* <tt>Miter join</tt> link:images/linejoin0.png <tt> :linejoin => 0 </tt>
|
|
17
|
+
#* <tt>Round join</tt> link:images/linejoin1.png <tt> :linejoin => 1 </tt>
|
|
18
|
+
#* <tt>Bevel join</tt> link:images/linejoin2.png <tt> :linejoin => 2 </tt>
|
|
19
|
+
#* <tt>:linecap</tt> - Sets the line cap parameter in the graphics state to int, which must be one of the integers 0, 1, or 2
|
|
20
|
+
#====:linecap examples
|
|
21
|
+
#* <tt><tt>Butt cap</tt></tt> link:images/linecap0.png <tt> :linecap => 0 </tt>
|
|
22
|
+
#* <tt>Round cap</tt> link:images/linecap1.png <tt> :linecap => 1 </tt>
|
|
23
|
+
#* <tt>Projecting square cap</tt> link:images/linecap2.png <tt> :linecap => 2 </tt>
|
|
24
|
+
class RGhost::Border < RGhost::PsObject
|
|
25
|
+
|
|
26
|
+
DEFAULT_OPTIONS = {:color => '#49AAFA', :dash => false, :width => 0.5, :linejoin => 0, :linecap => 0 }
|
|
27
|
+
# aqui tem documentação
|
|
28
|
+
def initialize(options={})
|
|
29
|
+
super(""){}
|
|
30
|
+
@options = DEFAULT_OPTIONS.dup.merge(options)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def ps #:nodoc:
|
|
34
|
+
p=RGhost::PsObject.new
|
|
35
|
+
p.set RGhost::LineWidth.new(@options[:width]) if @options[:width]
|
|
36
|
+
p.raw "#{@options[:linejoin]} setlinejoin"
|
|
37
|
+
p.raw "#{@options[:linecap]} setlinecap"
|
|
38
|
+
p.set RGhost::Dash.new(@options[:dash]) if @options[:dash]
|
|
39
|
+
p.set RGhost::Color.create(@options[:color]) if @options[:color]
|
|
40
|
+
p
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require "rghost/ps_object"
|
|
2
|
+
require "rghost/ruby_to_ps"
|
|
3
|
+
|
|
4
|
+
# Callbacks are custom code blocks defined inside of Document.
|
|
5
|
+
# All callbacks received implicitly a instance of PsFacade can be creates any PsObject.
|
|
6
|
+
# The callbacks's execution depend of the algorithims predefined in Postscript core library.
|
|
7
|
+
# There are two kind of callbacks, Statics and Dynamics callbacks.
|
|
8
|
+
# A Static callback there aren't parameters to control of the inclusion and exception on current scope, usually
|
|
9
|
+
# applied for events which happen one time, for example after_document_create, "after document create" always will execute one time for each document.
|
|
10
|
+
# Otherwise Dynamic callbacks there is control of scope using conditional :only or :except, this is only difference in relation the static callbacks.
|
|
11
|
+
# The parameters of a Dynamic callbak must be one integer or one array of integer. Example:
|
|
12
|
+
# For all pages except page 3
|
|
13
|
+
# doc.before_page_create :except => 3 do |b|
|
|
14
|
+
# # do something
|
|
15
|
+
# end
|
|
16
|
+
#
|
|
17
|
+
# For just 2 and 4 pages
|
|
18
|
+
# doc.before_page_create :only => [2,4] do |b|
|
|
19
|
+
# # do something
|
|
20
|
+
# end
|
|
21
|
+
#
|
|
22
|
+
# The most of callbacks are defined in facades such as DocumentCallbackFacade and Grid::CallbackFacade
|
|
23
|
+
class RGhost::Callback < RGhost::PsObject
|
|
24
|
+
attr_accessor :only, :except, :name
|
|
25
|
+
include RGhost::RubyToPs
|
|
26
|
+
|
|
27
|
+
def initialize(name,options={},&block)
|
|
28
|
+
|
|
29
|
+
super(""){}
|
|
30
|
+
set RGhost::PsFacade.new(&block) if block
|
|
31
|
+
@name=name
|
|
32
|
+
@options=options
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def ps
|
|
37
|
+
|
|
38
|
+
@only=num_to_array(@options[:only])
|
|
39
|
+
@except=num_to_array(@options[:except])
|
|
40
|
+
|
|
41
|
+
"\n/#{@name} 3 dict def #{@name} begin \n/proc { #{super} } bind def \n/except #{to_array(@except)} def \n/only #{to_array(@only)} def \nend "
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
private
|
|
46
|
+
def num_to_array(value)
|
|
47
|
+
case value
|
|
48
|
+
when Fixnum then
|
|
49
|
+
a=[]
|
|
50
|
+
a << value
|
|
51
|
+
when NilClass then []
|
|
52
|
+
else
|
|
53
|
+
value
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
require "rghost/ps_object"
|
|
2
|
+
require "rghost/units"
|
|
3
|
+
#Draw a circle to the current path(or current row by default).
|
|
4
|
+
#===Options
|
|
5
|
+
#
|
|
6
|
+
#* <tt>:x and :y</tt> - as center of the circle.
|
|
7
|
+
#* <tt>:radius</tt> - as radius(in points).
|
|
8
|
+
#* <tt>:ang1</tt> - the angle of a vector from (:x , :y ) of length :radius to the first endpoint of the circle.
|
|
9
|
+
#* <tt>:ang2</tt> - the angle of a vector from (:x, :y) of length :radius to the second endpoint of the circle.
|
|
10
|
+
#* <tt>:content</tt> - facade to ShapeContent with same parameters.
|
|
11
|
+
#* <tt>:border</tt> - facade to Border with same parameters.
|
|
12
|
+
#* <tt>:use</tt> - <b>:arc</b> draw counterclockwise and <b>:arcn</b> (arc negative) clockwise direction.
|
|
13
|
+
#===Examples using facade circle method inside of Document
|
|
14
|
+
# d=Document.new
|
|
15
|
+
# d.circle :x => 5, :y => 2.5 , :radius => 40
|
|
16
|
+
#
|
|
17
|
+
#link:images/circle01.png
|
|
18
|
+
# d=Document.new
|
|
19
|
+
# d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:fill => false}
|
|
20
|
+
#
|
|
21
|
+
#link:images/circle02.png
|
|
22
|
+
#
|
|
23
|
+
# d=Document.new
|
|
24
|
+
# d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => "#FF0000"}
|
|
25
|
+
#
|
|
26
|
+
#link:images/circle03.png
|
|
27
|
+
#
|
|
28
|
+
# d=Document.new
|
|
29
|
+
# d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => "#FF0000"} ,:border => {:color => "#FFFFFF"}
|
|
30
|
+
#
|
|
31
|
+
#link:images/circle04.png
|
|
32
|
+
#
|
|
33
|
+
# d=Document.new
|
|
34
|
+
# d.circle :x => 5, :y => 2.5 , :radius => 40, :content => {:color => :yellow} ,:border => {:color => :orange, :dash => [1,2,1,2], :width => 20}
|
|
35
|
+
#
|
|
36
|
+
#link:images/circle05.png
|
|
37
|
+
#
|
|
38
|
+
# d=Document.new
|
|
39
|
+
# colors=%w[#98AE09 #AFE099 #A971FF #CC1010 #FF7201 #34FEE1]
|
|
40
|
+
# 6.downto(1) do |v|
|
|
41
|
+
# d.circle :x => 5, :y => 2.5 , :radius => v*10, :content =>{:color => colors[v]}
|
|
42
|
+
# end
|
|
43
|
+
#
|
|
44
|
+
#link:images/circle06.png
|
|
45
|
+
# d=Document.new
|
|
46
|
+
# d.circle :x => 5, :y => 2.5 , :ang1 => 90, :radius => 50, :content => {:fill => false }
|
|
47
|
+
#
|
|
48
|
+
#link:images/circle07.png
|
|
49
|
+
#
|
|
50
|
+
# d=Document.new
|
|
51
|
+
# d.circle :x => 5, :y => 2.5 , :ang2 => 90, :radius => 50, :content => {:fill => false }
|
|
52
|
+
#
|
|
53
|
+
#link:images/circle08.png
|
|
54
|
+
#
|
|
55
|
+
# d=Document.new
|
|
56
|
+
# d.circle :x => 5, :y => 2.5 , :ang2 => 90, :radius => 50, :content =>{:color => :green}
|
|
57
|
+
#
|
|
58
|
+
#link:images/circle09.png
|
|
59
|
+
#
|
|
60
|
+
# d=Document.new
|
|
61
|
+
# d.circle :x => 5, :y => 2.5 , :ang2 => 90, :use => :arcn, :radius => 50, :content =>{:color => :green}
|
|
62
|
+
#
|
|
63
|
+
#link:images/circle10.png
|
|
64
|
+
#
|
|
65
|
+
#===Examples using Circle class
|
|
66
|
+
# d=Document.new
|
|
67
|
+
# d.scale(3,1)
|
|
68
|
+
# d.set Circle.new(:x => 1.5, :y => 1.5 , :ang2 => 180, :radius => 25)
|
|
69
|
+
#
|
|
70
|
+
#link:images/circle11.png
|
|
71
|
+
class RGhost::Circle < RGhost::PsObject
|
|
72
|
+
DEFAULT_OPTIONS={
|
|
73
|
+
:x => :limit_left,
|
|
74
|
+
:y=> :current_row,
|
|
75
|
+
:radius => 50,
|
|
76
|
+
:ang1 => 0,
|
|
77
|
+
:ang2 => 360 ,
|
|
78
|
+
:use => :arc,
|
|
79
|
+
:content => RGhost::ShapeContent::DEFAULT_OPTIONS,
|
|
80
|
+
:border => RGhost::Border::DEFAULT_OPTIONS
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
def initialize(options={})
|
|
84
|
+
super(''){}
|
|
85
|
+
@options=DEFAULT_OPTIONS.dup.merge(options)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def ps
|
|
89
|
+
|
|
90
|
+
x,y= RGhost::Units::parse(@options[:x]), RGhost::Units::parse(@options[:y]) #with parse
|
|
91
|
+
|
|
92
|
+
graph=RGhost::Graphic.new
|
|
93
|
+
graph.raw :newpath
|
|
94
|
+
graph.set RGhost::Border.new(@options[:border]) if @options[:border]
|
|
95
|
+
graph.raw "#{x} #{y} #{@options[:radius]} #{@options[:ang1]} #{@options[:ang2]} #{@options[:use]} "
|
|
96
|
+
graph.set RGhost::ShapeContent.new(@options[:content]) if @options[:content]
|
|
97
|
+
graph.raw :stroke
|
|
98
|
+
graph
|
|
99
|
+
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
data/lib/rghost/color.rb
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
require "rghost/ps_object"
|
|
2
|
+
require "rghost/constants"
|
|
3
|
+
require "rghost/ruby_to_ps" #array_to_stack
|
|
4
|
+
|
|
5
|
+
#Creates color for postscript components
|
|
6
|
+
class RGhost::Color < RGhost::PsObject
|
|
7
|
+
|
|
8
|
+
include RGhost::RubyToPs
|
|
9
|
+
#The method create is a color factory depends when parameter is used. The parameter variate between 0 and 1, if value greatet that 1 will be divided by 100.0 .
|
|
10
|
+
#===Examples
|
|
11
|
+
#====Creating RGB color
|
|
12
|
+
#String HTML color converter
|
|
13
|
+
# Color.create '#FFAA33'
|
|
14
|
+
#As Symbol will be find in RGhost::Constants::Colors::RGB
|
|
15
|
+
# Color.create :red
|
|
16
|
+
#As Array with 3 elements
|
|
17
|
+
# Color.create [0.5, 0.3, 0.5]
|
|
18
|
+
#Hash with 3 pair of key/value. Valids keys :red, :green and :blue
|
|
19
|
+
# Color.create :red => 0.5, :green => 0.3, :blue => 0.5
|
|
20
|
+
#Hash with 3 pair of key/value. Valids keys :r, :g and :b
|
|
21
|
+
# Color.create :r => 0.5, :g => 0.3, :b => 0.5
|
|
22
|
+
#====Creating CMYK color
|
|
23
|
+
#Hash with 4 pair of key/value. Valids keys :cyan, :magenta, :yellow and :black
|
|
24
|
+
# Color.create :cyan=> 1 ,:magenta => 0.3, :yellow => 0, :black => 0
|
|
25
|
+
#Hash with 4 pair of key/value. Valids keys :c, :m, :y and :b
|
|
26
|
+
# Color.create :c=> 1 ,:m => 0.3, :y => 0, :b => 0
|
|
27
|
+
#====Creating CMYK Spot color
|
|
28
|
+
#Hash with 5 pair of key/value. Valids keys :cyan, :magenta, :yellow, :black, and :name
|
|
29
|
+
# Color.create :cyan=> 0, :magenta => 100, :yellow => 63, :black => 12, :name => 'Pantone 200 C'
|
|
30
|
+
#====Creating Gray color
|
|
31
|
+
#A single Numeric
|
|
32
|
+
# Color.create 0.5
|
|
33
|
+
#50 percent of black will be divided by 100.0
|
|
34
|
+
# Color.create 50
|
|
35
|
+
def self.create(color="FFAA99")
|
|
36
|
+
|
|
37
|
+
return case color
|
|
38
|
+
when String then RGhost::RGB.new(color)
|
|
39
|
+
when Symbol then
|
|
40
|
+
c=RGhost::Constants::Colors::RGB[color]
|
|
41
|
+
raise ArgumentError.new("#{color}##{color.class}") unless c
|
|
42
|
+
self.create c
|
|
43
|
+
|
|
44
|
+
when Array, Hash then
|
|
45
|
+
if color.size == 3
|
|
46
|
+
RGhost::RGB.new(color)
|
|
47
|
+
elsif color.size == 4
|
|
48
|
+
RGhost::CMYK.new(color)
|
|
49
|
+
elsif color.size == 5
|
|
50
|
+
RGhost::CMYKSpot.new(color)
|
|
51
|
+
else
|
|
52
|
+
raise ArgumentError.new("#{color}##{color.class}")
|
|
53
|
+
end
|
|
54
|
+
when Numeric then RGhost::Gray.new(color)
|
|
55
|
+
else
|
|
56
|
+
raise ArgumentError.new("#{color}##{color.class}")
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
#Creates RGB color
|
|
65
|
+
class RGhost::RGB < RGhost::Color
|
|
66
|
+
attr_accessor :red, :green, :blue
|
|
67
|
+
CONSTANTS=RGhost::Constants::Colors::RGB
|
|
68
|
+
DEFAULT_RGB={:red => 0, :green => 0, :blue => 0}
|
|
69
|
+
#String HTML color converter
|
|
70
|
+
# Color.create '#FFAA33'
|
|
71
|
+
#As Symbol will be find in RGhost::Constants::Colors::RGB
|
|
72
|
+
# Color.create :red
|
|
73
|
+
#As Array with 3 elements
|
|
74
|
+
# Color.create [0.5, 0.3, 0.5]
|
|
75
|
+
#Hash with 3 pair of key/value. Valids keys :red, :green and :blue
|
|
76
|
+
# Color.create :red => 0.5, :green => 0.3, :blue => 0.5
|
|
77
|
+
#Hash with 3 pair of key/value. Valids keys :r, :g and :b
|
|
78
|
+
# Color.create :r => 0.5, :g => 0.3, :b => 0.5
|
|
79
|
+
def initialize(color_or_red=nil,green=nil,blue=nil)
|
|
80
|
+
@color=color_or_red
|
|
81
|
+
@color=[color_or_red.to_f,green.to_f,blue.to_f] if color_or_red.is_a? Numeric
|
|
82
|
+
@color=DEFAULT_RGB.merge(color_or_red) if color_or_red.is_a? Hash
|
|
83
|
+
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def ps
|
|
87
|
+
value=color_params
|
|
88
|
+
|
|
89
|
+
array_to_stack(value.map{|n| n > 1 ? n/100.0: n})+"setrgbcolor"
|
|
90
|
+
end
|
|
91
|
+
def stack_format
|
|
92
|
+
color_params
|
|
93
|
+
end
|
|
94
|
+
def color_params
|
|
95
|
+
case @color
|
|
96
|
+
when Hash then [@color[:red] || @color[:r],@color[:green] || @color[:g],@color[:blue] || @color[:b]]
|
|
97
|
+
when Array then @color
|
|
98
|
+
when String then hex_to_rgb(@color)
|
|
99
|
+
when NilClass then [0,0,1]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
private
|
|
106
|
+
|
|
107
|
+
def hex_to_rgb(color="#FFFFFF")
|
|
108
|
+
|
|
109
|
+
color.gsub(/#/,'').scan(/[\dA-F]{2}/).map{|h| h.hex / 255.0}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
#Creates CMYK color space
|
|
115
|
+
class RGhost::CMYK < RGhost::Color
|
|
116
|
+
attr_accessor :cyan ,:magenta, :yellow, :black
|
|
117
|
+
CONSTANTS=RGhost::Constants::Colors::CMYK
|
|
118
|
+
|
|
119
|
+
#Hash with 4 pair of key/value. Valids keys :cyan, :magenta, :yellow and :black
|
|
120
|
+
# Color.create :cyan=> 1 ,:magenta => 0.3, :yellow => 0, :black => 0
|
|
121
|
+
#Hash with 4 pair of key/value. Valids keys :c, :m, :y and :b
|
|
122
|
+
# Color.create :c=> 1 ,:m => 0.3, :y => 0, :b => 0
|
|
123
|
+
def initialize(color={:cyan=> 1 ,:magenta => 0, :yellow => 0, :black => 0})
|
|
124
|
+
@color=color
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def ps
|
|
128
|
+
value=case @color
|
|
129
|
+
when Hash then [@color[:cyan] || @color[:c],@color[:magenta] || @color[:m],@color[:yellow] || @color[:y],@color[:black] || @color[:k]]
|
|
130
|
+
when Array then @color
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
array_to_stack(value.map{|n| n > 1 ? n/100.0: n})+"setcmykcolor"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
#Creates CMYK Spot color space
|
|
139
|
+
class RGhost::CMYKSpot < RGhost::Color
|
|
140
|
+
attr_accessor :cyan ,:magenta, :yellow, :black, :name
|
|
141
|
+
|
|
142
|
+
def initialize(color={:name => 'spot', :cyan=> 1 ,:magenta => 0, :yellow => 0, :black => 0})
|
|
143
|
+
@name = color[:name]
|
|
144
|
+
color.delete(:name)
|
|
145
|
+
@color = color
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def ps
|
|
149
|
+
value=case @color
|
|
150
|
+
when Hash then [@color[:cyan] || @color[:c],@color[:magenta] || @color[:m],@color[:yellow] || @color[:y],@color[:black] || @color[:k]]
|
|
151
|
+
when Array then @color
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
array_to_stack(value.map{|n| n > 1 ? n/100.0: n}) + "(#{@name.to_s}) findcmykcustomcolor \n/#{@name.to_s.gsub(' ', '_')} exch def\n\n#{@name.to_s.gsub(' ', '_')} 1 setcustomcolor"
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
#Creates Gray color
|
|
159
|
+
class RGhost::Gray < RGhost::Color
|
|
160
|
+
attr_accessor :gray
|
|
161
|
+
|
|
162
|
+
#A single Numeric
|
|
163
|
+
# Color.create 0.5
|
|
164
|
+
#50 percent of black will be divided by 100.0
|
|
165
|
+
# Color.create 50
|
|
166
|
+
def initialize(gray=0.8)
|
|
167
|
+
@gray=gray
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def ps #:nodoc:
|
|
171
|
+
@gray = @gray/100.0 if @gray > 1
|
|
172
|
+
"#{@gray} setgray"
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
end
|
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
require "rghost/helpers"
|
|
2
|
+
|
|
3
|
+
module RGhost::Constants
|
|
4
|
+
module HashKeyMethod #:nodoc:
|
|
5
|
+
def method_missing(method, *args)
|
|
6
|
+
self[method.to_sym]
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
class HashKeyMethodClass < Hash #:nodoc:
|
|
10
|
+
include RGhost::Constants::HashKeyMethod
|
|
11
|
+
end
|
|
12
|
+
module Devices
|
|
13
|
+
#Standard Devices
|
|
14
|
+
STANDARD=RGhost::Constants::HashKeyMethodClass[
|
|
15
|
+
#-- MS-DOS displays",
|
|
16
|
+
:ega => "EGA (640x350, 16-color)",
|
|
17
|
+
:vga => "VGA (640x480, 16-color)",
|
|
18
|
+
#-- Ms Windows => "",
|
|
19
|
+
:ali => "SuperVGA using Avance Logic Inc. chipset, 256-color modes",
|
|
20
|
+
:atiw => "ATI Wonder SuperVGA, 256-color modes",
|
|
21
|
+
:cirr => "SuperVGA using Cirrus Logic CL-GD54XX chips, 256-color modes",
|
|
22
|
+
:s3vga => "SuperVGA using S3 86C911 chip (e.g., Diamond Stealth board)",
|
|
23
|
+
:svga16 => "Generic SuperVGA in 800x600, 16-color mode",
|
|
24
|
+
:tseng => "SuperVGA using Tseng Labs ET3000/4000 chips, 256-color modes",
|
|
25
|
+
:vesa => "SuperVGA with VESA standard API driver",
|
|
26
|
+
:mswindll => "Microsoft Windows 3.1 DLL => [MS Windows only]",
|
|
27
|
+
:mswinprn => "Microsoft Windows 3.0, 3.1 DDB printer => [MS Windows only]",
|
|
28
|
+
:mswinpr2 => "Microsoft Windows 3.0, 3.1 DIB printer => [MS Windows only]",
|
|
29
|
+
#-- Others Displays",
|
|
30
|
+
:os2pm => "OS/2 Presentation Manager => [OS/2 only]",
|
|
31
|
+
:os2dll => "OS/2 DLL bitmap::[OS/2 only]",
|
|
32
|
+
:os2prn => "OS/2 printer:: => [OS/2 only]",
|
|
33
|
+
#-- Unix Displays",
|
|
34
|
+
:lvga256 => "Linux vgalib, 256-color VGA modes => [Linux only]",
|
|
35
|
+
:vgalib => "Linux vgalib, 16-color VGA modes => [Linux only]",
|
|
36
|
+
:x11 => "X Windows version 11, release >=4 => [Unix and VMS only]",
|
|
37
|
+
:x11alpha => "X Windows masquerading as a device with alpha capability",
|
|
38
|
+
:x11cmyk => "X Windows masquerading as a 1-bit-per-plane CMYK device",
|
|
39
|
+
:x11cmyk2 => "X Windows as a 2-bit-per-plane CMYK device",
|
|
40
|
+
:x11cmyk4 => "X Windows as a 4-bit-per-plane CMYK device",
|
|
41
|
+
:x11cmyk8 => "X Windows as an 8-bit-per-plane CMYK device",
|
|
42
|
+
:x11gray2 => "X Windows as a 2-bit gray-scale device",
|
|
43
|
+
:x11gray4 => "X Windows as a 4-bit gray-scale device",
|
|
44
|
+
:x11mono => "X Windows masquerading as a black-and-white device",
|
|
45
|
+
:x11rg16x => "X Windows with G5/B5/R6 pixel layout for testing.",
|
|
46
|
+
:x11rg32x => "X Windows with G11/B10/R11 pixel layout for testing.",
|
|
47
|
+
#-- Printers",
|
|
48
|
+
:epson => "Epson-compatible dot matrix printers (9- or 24-pin)",
|
|
49
|
+
:eps9mid => "Epson-compatible 9-pin, interleaved lines (intermediate resolution)",
|
|
50
|
+
:eps9high => "Epson-compatible 9-pin, interleaved lines (triple resolution)",
|
|
51
|
+
:atx23 => "Practical Automation ATX-23 label printer",
|
|
52
|
+
:atx24 => "Practical Automation ATX-24 label printer",
|
|
53
|
+
:atx38 => "Practical Automation ATX-38 label printer",
|
|
54
|
+
:deskjet => "H-P DeskJet and DeskJet Plus",
|
|
55
|
+
:djet500 => "H-P DeskJet 500; use -r600 for DJ 600 series",
|
|
56
|
+
:fs600 => "Kyocera FS-600 (600 dpi)",
|
|
57
|
+
:laserjet => "H-P LaserJet",
|
|
58
|
+
:ljet2p => "H-P LaserJet IId/IIp/III* with TIFF compression",
|
|
59
|
+
:ljet3 => "H-P LaserJet III* with Delta Row compression",
|
|
60
|
+
:ljet3d => "H-P LaserJet IIID with duplex capability",
|
|
61
|
+
:ljet4 => "H-P LaserJet 4 (defaults to 600 dpi)",
|
|
62
|
+
:ljet4d => "H-P LaserJet 4 (defaults to 600 dpi) with duplex",
|
|
63
|
+
:ljetplus => "H-P LaserJet Plus",
|
|
64
|
+
:lj5mono => "H-P LaserJet 5 & 6 family (PCL XL), bitmap:",
|
|
65
|
+
:lj5gray => "H-P LaserJet 5 & 6 family, gray-scale bitmap;",
|
|
66
|
+
:lp2563 => "H-P 2563B line printer",
|
|
67
|
+
:oce9050 => "OCE 9050 printe",
|
|
68
|
+
:pxlmono => "H-P black-and-white PCL XL printers (LaserJet 5 and 6 family)",
|
|
69
|
+
:pxlcolor => "H-P color PCL XL printers (e.g. Color LaserJet 4500)",
|
|
70
|
+
#-- Fax file format",
|
|
71
|
+
:faxg3 => "Group 3 fax, with EOLs but no header or EOD",
|
|
72
|
+
:faxg32d => "Group 3 2-D fax, with EOLs but no header or EOD",
|
|
73
|
+
:faxg4 => "Group 4 fax, with EOLs but no header or EOD",
|
|
74
|
+
:tiffcrle => "TIFF CCITT RLE 1-dim (= Group 3 fax with no EOLs)",
|
|
75
|
+
:tiffg3 => "TIFF Group 3 fax (with EOLs)",
|
|
76
|
+
:tiffg32d => "TIFF Group 3 2-D fax",
|
|
77
|
+
:tiffg4 => "TIFF Group 4 fax",
|
|
78
|
+
#-- High-level (vector) file formats",
|
|
79
|
+
:epswrite => "EPS output (like PostScript Distillery)",
|
|
80
|
+
:pdfwrite => "PDF output (like Adobe Acrobat Distiller)",
|
|
81
|
+
:pswrite => "PostScript output (like PostScript Distillery)",
|
|
82
|
+
:pxlmono => "Black-and-white PCL XL",
|
|
83
|
+
:pxlcolor => "Color PCL XL",
|
|
84
|
+
#-- Raster file formats and devices",
|
|
85
|
+
:bit => "Plain bits, monochrome",
|
|
86
|
+
:bitrgb => "Plain bits, RGB",
|
|
87
|
+
:bitcmyk => "Plain bits, CMYK",
|
|
88
|
+
:bmpmono => "Monochrome MS Windows .BMP file format",
|
|
89
|
+
:bmpgray => "8-bit gray .BMP file format",
|
|
90
|
+
:bmpsep1 => "Separated 1-bit CMYK .BMP file format, primarily for testing",
|
|
91
|
+
:bmpsep8 =>"Separated 8-bit CMYK .BMP file format, primarily for testing",
|
|
92
|
+
:bmp16 => "4-bit (EGA/VGA) .BMP file format",
|
|
93
|
+
:bmp256 => "8-bit (256-color) .BMP file format",
|
|
94
|
+
:bmp16m => "24-bit .BMP file format",
|
|
95
|
+
:bmp32b => "32-bit pseudo-.BMP file format",
|
|
96
|
+
:cgmmono => "Monochrome (black-and-white) CGM -- LOW LEVEL OUTPUT ONLY",
|
|
97
|
+
:cgm8 => "8-bit (256-color) CGM -- DITTO",
|
|
98
|
+
:cgm24 => "24-bit color CGM -- DITTO",
|
|
99
|
+
:jpeg => "JPEG format, RGB output",
|
|
100
|
+
:jpeggray => "JPEG format, gray output",
|
|
101
|
+
:miff24 => "ImageMagick MIFF format, 24-bit direct color, RLE compressed",
|
|
102
|
+
:pcxmono=> "PCX file format, monochrome (1-bit black and white)",
|
|
103
|
+
:pcxgray=> "PCX file format, 8-bit gray scale",
|
|
104
|
+
:pcx16 => "PCX file format, 4-bit planar (EGA/VGA) color",
|
|
105
|
+
:pcx256 => "PCX file format, 8-bit chunky color",
|
|
106
|
+
:pcx24b => "PCX file format, 24-bit color (3 8-bit planes)",
|
|
107
|
+
:pcxcmyk => "PCX file format, 4-bit chunky CMYK color",
|
|
108
|
+
:pbm => "Portable Bitmap (plain format)",
|
|
109
|
+
:pbmraw => "Portable Bitmap (raw format)",
|
|
110
|
+
:pgm => "Portable Graymap (plain format)",
|
|
111
|
+
:pgmraw => "Portable Graymap (raw format)",
|
|
112
|
+
:pgnm => "Portable Graymap (plain format), optimizing to PBM if possible",
|
|
113
|
+
:pgnmraw => "Portable Graymap (raw format), optimizing to PBM if possible",
|
|
114
|
+
:pnm => "Portable Pixmap (plain format) (RGB), optimizing to PGM or PBM",
|
|
115
|
+
:pnmraw => "Portable Pixmap (raw format) (RGB), optimizing to PGM or PBM",
|
|
116
|
+
:ppm => "Portable Pixmap (plain format) (RGB)",
|
|
117
|
+
:ppmraw => "Portable Pixmap (raw format) (RGB)",
|
|
118
|
+
:pkm => "Portable inKmap (plain format) (4-bit CMYK => RGB)",
|
|
119
|
+
:pkmraw => "Portable inKmap (raw format) (4-bit CMYK => RGB)",
|
|
120
|
+
:pksm => "Portable Separated map (plain format) (4-bit CMYK => 4 pages)",
|
|
121
|
+
:pksmraw => "Portable Separated map (raw format) (4-bit CMYK => 4 pages)",
|
|
122
|
+
:plan9bm => "Plan 9 bitmap format",
|
|
123
|
+
:pngmono => "Monochrome Portable Network Graphics (PNG)",
|
|
124
|
+
:pnggray => "8-bit gray Portable Network Graphics (PNG)",
|
|
125
|
+
:png16 => "4-bit color Portable Network Graphics (PNG)",
|
|
126
|
+
:png256 => "8-bit color Portable Network Graphics (PNG)",
|
|
127
|
+
:png16m => "24-bit color Portable Network Graphics (PNG)",
|
|
128
|
+
:psmono => "PostScript (Level 1) monochrome image",
|
|
129
|
+
:psgray => "PostScript (Level 1) 8-bit gray image",
|
|
130
|
+
:psrgb => "PostScript (Level 2) 24-bit color image",
|
|
131
|
+
:tiff12nc => "TIFF 12-bit RGB, no compression",
|
|
132
|
+
:tiff24nc => "TIFF 24-bit RGB, no compression (NeXT standard format)",
|
|
133
|
+
:tifflzw => "TIFF LZW (tag = 5) (monochrome)",
|
|
134
|
+
:tiffpack => "TIFF PackBits (tag = 32773) (monochrome)"
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
]
|
|
138
|
+
DEVICES_ALIAS={
|
|
139
|
+
:eps => :epswrite,
|
|
140
|
+
:pdf => :pdfwrite,
|
|
141
|
+
:ps => :pswrite,
|
|
142
|
+
:pcl => :pxlmono,
|
|
143
|
+
:tif => :tiffcrle,
|
|
144
|
+
:tiff => :tiffcrle,
|
|
145
|
+
:jpg => :jpeg,
|
|
146
|
+
:png => :png16m
|
|
147
|
+
}
|
|
148
|
+
#Load device by alias
|
|
149
|
+
def device_for(dev)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
return DEVICES_ALIAS[dev] if DEVICES_ALIAS.key? dev
|
|
153
|
+
return dev if STANDARD.key? dev
|
|
154
|
+
raise "Undefined device: #{dev}"
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
module Fonts
|
|
160
|
+
#Standard Encodings
|
|
161
|
+
ENCODINGS=['ISOLatin1Encoding', 'StandardEncoding ']
|
|
162
|
+
#Standard Fonts
|
|
163
|
+
STANDARD={
|
|
164
|
+
'AvantGarde-Book' => "Adobe-ITC Avant Garde Gothic-Book-R-Normal--*",
|
|
165
|
+
'AvantGarde-BookOblique' => "Adobe-ITC Avant Garde Gothic-Book-O-Normal--*",
|
|
166
|
+
'AvantGarde-Demi' => "Adobe-ITC Avant Garde Gothic-Demi-R-Normal--*",
|
|
167
|
+
'AvantGarde-DemiOblique' => "Adobe-ITC Avant Garde Gothic-Demi-O-Normal--*",
|
|
168
|
+
'Bookman-Demi' => "Adobe-ITC Bookman-Demi-R-Normal--*",
|
|
169
|
+
'Bookman-DemiItalic' => "Adobe-ITC Bookman-Demi-I-Normal--*",
|
|
170
|
+
'Bookman-Light' => "Adobe-ITC Bookman-Light-R-Normal--*",
|
|
171
|
+
'Bookman-LightItalic' => "Adobe-ITC Bookman-Light-I-Normal--*",
|
|
172
|
+
:Courier => "Adobe-Courier-Medium-R-Normal--*",
|
|
173
|
+
'Courier-Bold' => "Adobe-Courier-Bold-R-Normal--*",
|
|
174
|
+
'Courier-BoldOblique' => "Adobe-Courier-Bold-O-Normal--*",
|
|
175
|
+
'Courier-Oblique' => "Adobe-Courier-Medium-O-Normal--*",
|
|
176
|
+
:Helvetica => "Adobe-Helvetica-Medium-R-Normal--*",
|
|
177
|
+
'Helvetica-Bold' => "Adobe-Helvetica-Bold-R-Normal--*",
|
|
178
|
+
'Helvetica-BoldOblique' => "Adobe-Helvetica-Bold-O-Normal--*",
|
|
179
|
+
'Helvetica-Narrow' => "Adobe-Helvetica-Medium-R-Narrow--*",
|
|
180
|
+
'Helvetica-Narrow-Bold' => "Adobe-Helvetica-Bold-R-Narrow--*",
|
|
181
|
+
'Helvetica-Narrow-BoldOblique' =>"Adobe-Helvetica-Bold-O-Narrow--*",
|
|
182
|
+
'Helvetica-Narrow-Oblique' => "Adobe-Helvetica-Medium-O-Narrow--*",
|
|
183
|
+
'Helvetica-Oblique' => "Adobe-Helvetica-Medium-O-Normal--*",
|
|
184
|
+
'NewCenturySchlbk-Bold' => "Adobe-New Century Schoolbook-Bold-R-Normal--*",
|
|
185
|
+
'NewCenturySchlbk-BoldItalic' => "Adobe-New Century Schoolbook-Bold-I-Normal--*",
|
|
186
|
+
'NewCenturySchlbk-Italic' => "Adobe-New Century Schoolbook-Medium-I-Normal--*",
|
|
187
|
+
'NewCenturySchlbk-Roman' => "Adobe-New Century Schoolbook-Medium-R-Normal--*",
|
|
188
|
+
'Palatino-Bold' => "Adobe-Palatino-Bold-R-Normal--*",
|
|
189
|
+
'Palatino-BoldItalic' => "Adobe-Palatino-Bold-I-Normal--*",
|
|
190
|
+
'Palatino-Italic' => "Adobe-Palatino-Medium-I-Normal--*",
|
|
191
|
+
'Palatino-Roman' => "Adobe-Palatino-Medium-R-Normal--*",
|
|
192
|
+
:Times => "Adobe-Times-Normal--*",
|
|
193
|
+
'Times-Bold' => "Adobe-Times-Bold-R-Normal--*",
|
|
194
|
+
'Times-BoldItalic' => "Adobe-Times-Bold-I-Normal--*",
|
|
195
|
+
'Times-Italic' => "Adobe-Times-Medium-I-Normal--*",
|
|
196
|
+
'Times-Roman' => "Adobe-Times-Medium-R-Normal--*",
|
|
197
|
+
'ZapfChancery-MediumItalic' => "Adobe-ITC Zapf Chancery-Medium-I-Normal--",
|
|
198
|
+
:Symbol => "Adobe-Symbol-Medium-R-Normal--",
|
|
199
|
+
:ZapfDingbats => "Adobe-ITC Zapf Dingbats-Medium-R-Normal--"
|
|
200
|
+
}
|
|
201
|
+
SUNS={
|
|
202
|
+
'AvantGarde-Book' => "-itc-avantgarde-book-r-normal--*",
|
|
203
|
+
'AvantGarde-BookOblique' => "-itc-avantgarde-book-o-normal--*",
|
|
204
|
+
'AvantGarde-Demi' => "-itc-avantgarde-demi-r-normal--*",
|
|
205
|
+
'AvantGarde-DemiOblique' => "-itc-avantgarde-demi-o-normal--*",
|
|
206
|
+
'Bembo' => "-monotype-bembo-medium-r-normal--*",
|
|
207
|
+
'Bembo-Bold' => "-monotype-bembo-bold-r-normal--*",
|
|
208
|
+
'Bembo-BoldItalic' => "-monotype-bembo-bold-i-normal--*",
|
|
209
|
+
'Bembo-Italic' => "-monotype-bembo-medium-i-normal--*",
|
|
210
|
+
'Bookman-Demi' => "-itc-bookman-demi-r-normal--*",
|
|
211
|
+
'Bookman-DemiItalic' => "-itc-bookman-demi-i-normal--*",
|
|
212
|
+
'Bookman-Light' => "-itc-bookman-light-r-normal--*",
|
|
213
|
+
'Bookman-LightItalic' => "-itc-bookman-light-i-normal--*",
|
|
214
|
+
'Courier' => "-itc-courier-medium-r-normal--*",
|
|
215
|
+
'Courier-Bold' => "-itc-courier-bold-r-normal--*",
|
|
216
|
+
'Courier-BoldOblique' => "-itc-courier-bold-o-normal--*",
|
|
217
|
+
'Courier-Oblique' => "-itc-courier-medium-o-normal--*",
|
|
218
|
+
'GillSans' => "-monotype-gill-medium-r-normal-sans-*",
|
|
219
|
+
'GillSans-Bold' => "-monotype-gill-bold-r-normal-sans-*",
|
|
220
|
+
'GillSans-BoldItalic' => "-monotype-gill-bold-i-normal-sans-*",
|
|
221
|
+
'GillSans-Italic' => "-monotype-gill-normal-i-normal-sans-*",
|
|
222
|
+
'Helvetica' => "-linotype-helvetica-medium-r-normal--*",
|
|
223
|
+
'Helvetica-Bold' => "-linotype-helvetica-bold-r-normal--*",
|
|
224
|
+
'Helvetica-BoldOblique' => "-linotype-helvetica-bold-o-normal--*",
|
|
225
|
+
'Helvetica-Narrow' => "-linotype-helvetica-medium-r-narrow--*",
|
|
226
|
+
'Helvetica-Narrow-Bold' => "-linotype-helvetica-bold-r-narrow--*",
|
|
227
|
+
'Helvetica-Narrow-BoldOblique' => "-linotype-helvetica-bold-o-narrow--*",
|
|
228
|
+
'Helvetica-Narrow-Oblique' => "-linotype-helvetica-medium-o-narrow--*",
|
|
229
|
+
'Helvetica-Oblique' => "-linotype-helvetica-medium-o-normal--*",
|
|
230
|
+
'LucidaBright' => "-b&h-lucidabright-medium-r-normal--*",
|
|
231
|
+
'LucidaBright-Demi' => "-b&h-lucidabright-demibold-r-normal--*",
|
|
232
|
+
'LucidaBright-DemiItalic' => "-b&h-lucidabright-demibold-i-normal--*",
|
|
233
|
+
'LucidaBright-Italic' => "-b&h-lucidabright-medium-i-normal--*",
|
|
234
|
+
'LucidaSans' => "-b&h-lucida-medium-r-normal-sans-*",
|
|
235
|
+
'LucidaSans-Bold' => "-b&h-lucida-bold-r-normal-sans-*",
|
|
236
|
+
'LucidaSans-BoldItalic' => "-b&h-lucida-bold-i-normal-sans-*",
|
|
237
|
+
'LucidaSans-Italic' => "-b&h-lucida-medium-i-normal-sans-*",
|
|
238
|
+
'LucidaSans-Typewriter' => "-b&h-lucidatypewriter-medium-r-normal-sans-*",
|
|
239
|
+
'LucidaSans-TypewriterBold' => "-b&h-lucidatypewriter-bold-r-normal-sans-*",
|
|
240
|
+
'NewCenturySchlbk-BoldItalic' => "-linotype-new century schoolbook-bold-i-normal--*",
|
|
241
|
+
'NewCenturySchlbk-Bold' => "-linotype-new century schoolbook-bold-r-normal--*",
|
|
242
|
+
'NewCenturySchlbk-Italic' => "-linotype-new century schoolbook-medium-i-normal--*",
|
|
243
|
+
'NewCenturySchlbk-Roman' => "-linotype-new century schoolbook-medium-r-normal--*",
|
|
244
|
+
'Palatino-Bold' => "-linotype-palatino-bold-r-normal--*",
|
|
245
|
+
'Palatino-BoldItalic' => "-linotype-palatino-bold-i-normal--*",
|
|
246
|
+
'Palatino-Italic' => "-linotype-palatino-medium-i-normal--*",
|
|
247
|
+
'Palatino-Roman' => "-linotype-palatino-medium-r-normal--*",
|
|
248
|
+
'Rockwell' => "-monotype-rockwell-medium-r-normal--*",
|
|
249
|
+
'Rockwell-Bold' => "-monotype-rockwell-bold-r-normal--*",
|
|
250
|
+
'Rockwell-BoldItalic' => "-monotype-rockwell-bold-i-normal--*",
|
|
251
|
+
'Rockwell-Italic' => "-monotype-rockwell-medium-i-normal--*",
|
|
252
|
+
'Times-Bold' => "-linotype-times-bold-r-normal--*",
|
|
253
|
+
'Times-BoldItalic' => "-linotype-times-bold-i-normal--*",
|
|
254
|
+
'Times-Italic' => "-linotype-times-medium-i-normal--*",
|
|
255
|
+
'Times-Roman' => "-linotype-times-medium-r-normal--*",
|
|
256
|
+
'Utopia-Bold' => "-adobe-utopia-bold-r-normal--*",
|
|
257
|
+
'Utopia-BoldItalic' => "-adobe-utopia-bold-i-normal--*",
|
|
258
|
+
'Utopia-Italic' => "-adobe-utopia-regular-i-normal--*",
|
|
259
|
+
'Utopia-Regular' => "-adobe-utopia-regular-r-normal--*",
|
|
260
|
+
'ZapfChancery-MediumItalic' => "-itc-zapfchancery-medium-i-normal--",
|
|
261
|
+
'ZapfDingbats' => "-itc-zapfdingbats-medium-r-normal--",
|
|
262
|
+
'Symbol' => "--symbol-medium-r-normal--"
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
end
|
|
266
|
+
#Color map
|
|
267
|
+
module Colors
|
|
268
|
+
RGB=RGhost::Constants::HashKeyMethodClass[
|
|
269
|
+
:aliceBlue => [0.941176470588235,0.972549019607843,1.0],
|
|
270
|
+
:antiqueWhite => [0.980392156862745,0.92156862745098,0.843137254901961],
|
|
271
|
+
:aqua => [0.0,1.0,1.0],
|
|
272
|
+
:aquamarine => [0.498039215686275,1.0,0.831372549019608],
|
|
273
|
+
:azure => [0.941176470588235,1.0,1.0],
|
|
274
|
+
:beige => [0.96078431372549,0.96078431372549,0.862745098039216],
|
|
275
|
+
:bisque => [1.0,0.894117647058824,0.768627450980392],
|
|
276
|
+
:black => [0.0,0.0,0.0],
|
|
277
|
+
:blanchedAlmond => [1.0,0.92156862745098,0.803921568627451],
|
|
278
|
+
:blue => [0.0,0.0,1.0],
|
|
279
|
+
:blueViolet => [0.541176470588235,0.168627450980392,0.886274509803922],
|
|
280
|
+
:brown => [0.647058823529412,0.164705882352941,0.164705882352941],
|
|
281
|
+
:burlyWood => [0.870588235294118,0.72156862745098,0.529411764705882],
|
|
282
|
+
:cadetBlue => [0.372549019607843,0.619607843137255,0.627450980392157],
|
|
283
|
+
:chartreuse => [0.498039215686275,1.0,0.0],
|
|
284
|
+
:chocolate => [0.823529411764706,0.411764705882353,0.117647058823529],
|
|
285
|
+
:coral => [1.0,0.498039215686275,0.313725490196078],
|
|
286
|
+
:cornflowerBlue => [0.392156862745098,0.584313725490196,0.929411764705882],
|
|
287
|
+
:cornsilk => [1.0,0.972549019607843,0.862745098039216],
|
|
288
|
+
:crimson => [0.862745098039216,0.0784313725490196,0.235294117647059],
|
|
289
|
+
:cyan => [0.0,1.0,1.0],
|
|
290
|
+
:darkBlue => [0.0,0.0,0.545098039215686],
|
|
291
|
+
:darkCyan => [0.0,0.545098039215686,0.545098039215686],
|
|
292
|
+
:darkGoldenRod => [0.72156862745098,0.525490196078431,0.0431372549019608],
|
|
293
|
+
:darkGray => [0.662745098039216,0.662745098039216,0.662745098039216],
|
|
294
|
+
:darkGreen => [0.0,0.392156862745098,0.0],
|
|
295
|
+
:darkGrey => [0.662745098039216,0.662745098039216,0.662745098039216],
|
|
296
|
+
:darkKhaki => [0.741176470588235,0.717647058823529,0.419607843137255],
|
|
297
|
+
:darkMagenta => [0.545098039215686,0.0,0.545098039215686],
|
|
298
|
+
:darkOliveGreen => [0.333333333333333,0.419607843137255,0.184313725490196],
|
|
299
|
+
:darkOrchid => [0.6,0.196078431372549,0.8],
|
|
300
|
+
:darkRed => [0.545098039215686,0.0,0.0],
|
|
301
|
+
:darkSalmon => [0.913725490196078,0.588235294117647,0.47843137254902],
|
|
302
|
+
:darkSeaGreen => [0.56078431372549,0.737254901960784,0.56078431372549],
|
|
303
|
+
:darkSlateBlue => [0.282352941176471,0.23921568627451,0.545098039215686],
|
|
304
|
+
:darkSlateGray => [0.184313725490196,0.309803921568627,0.309803921568627],
|
|
305
|
+
:darkSlateGrey => [0.184313725490196,0.309803921568627,0.309803921568627],
|
|
306
|
+
:darkTurquoise => [0.0,0.807843137254902,0.819607843137255],
|
|
307
|
+
:darkViolet => [0.580392156862745,0.0,0.827450980392157],
|
|
308
|
+
:darkorange => [1.0,0.549019607843137,0.0],
|
|
309
|
+
:deepPink => [1.0,0.0784313725490196,0.576470588235294],
|
|
310
|
+
:deepSkyBlue => [0.0,0.749019607843137,1.0],
|
|
311
|
+
:dimGray => [0.411764705882353,0.411764705882353,0.411764705882353],
|
|
312
|
+
:dimGrey => [0.411764705882353,0.411764705882353,0.411764705882353],
|
|
313
|
+
:dodgerBlue => [0.117647058823529,0.564705882352941,1.0],
|
|
314
|
+
:direBrick => [0.698039215686274,0.133333333333333,0.133333333333333],
|
|
315
|
+
:dloralWhite => [1.0,0.980392156862745,0.941176470588235],
|
|
316
|
+
:dorestGreen => [0.133333333333333,0.545098039215686,0.133333333333333],
|
|
317
|
+
:duchsia => [1.0,0.0,1.0],
|
|
318
|
+
:gainsboro => [0.862745098039216,0.862745098039216,0.862745098039216],
|
|
319
|
+
:ghostWhite => [0.972549019607843,0.972549019607843,1.0],
|
|
320
|
+
:gold => [1.0,0.843137254901961,0.0],
|
|
321
|
+
:goldenRod => [0.854901960784314,0.647058823529412,0.125490196078431],
|
|
322
|
+
:gray => [0.501960784313725,0.501960784313725,0.501960784313725],
|
|
323
|
+
:green => [0.0,0.501960784313725,0.0],
|
|
324
|
+
:greenYellow => [0.67843137254902,1.0,0.184313725490196],
|
|
325
|
+
:grey => [0.501960784313725,0.501960784313725,0.501960784313725],
|
|
326
|
+
:honeyDew => [0.941176470588235,1.0,0.941176470588235],
|
|
327
|
+
:hotPink => [1.0,0.411764705882353,0.705882352941177],
|
|
328
|
+
:indianRed => [0.803921568627451,0.36078431372549,0.36078431372549],
|
|
329
|
+
:indigo => [0.294117647058824,0.0,0.509803921568627],
|
|
330
|
+
:ivory => [1.0,1.0,0.941176470588235],
|
|
331
|
+
:khaki => [0.941176470588235,0.901960784313726,0.549019607843137],
|
|
332
|
+
:lavenderBlush => [1.0,0.941176470588235,0.96078431372549],
|
|
333
|
+
:lavender => [0.901960784313726,0.901960784313726,0.980392156862745],
|
|
334
|
+
:lawnGreen => [0.486274509803922,0.988235294117647,0.0],
|
|
335
|
+
:lemonChiffon => [1.0,0.980392156862745,0.803921568627451],
|
|
336
|
+
:lightBlue => [0.67843137254902,0.847058823529412,0.901960784313726],
|
|
337
|
+
:lightCoral => [0.941176470588235,0.501960784313725,0.501960784313725],
|
|
338
|
+
:lightCyan => [0.87843137254902,1.0,1.0],
|
|
339
|
+
:lightGoldenRodYellow => [0.980392156862745,0.980392156862745,0.823529411764706],
|
|
340
|
+
:lightGray => [0.827450980392157,0.827450980392157,0.827450980392157],
|
|
341
|
+
:lightGreen => [0.564705882352941,0.933333333333333,0.564705882352941],
|
|
342
|
+
:lightGrey => [0.827450980392157,0.827450980392157,0.827450980392157],
|
|
343
|
+
:lightPink => [1.0,0.713725490196078,0.756862745098039],
|
|
344
|
+
:lightSalmon => [1.0,0.627450980392157,0.47843137254902],
|
|
345
|
+
:lightSeaGreen => [0.125490196078431,0.698039215686274,0.666666666666667],
|
|
346
|
+
:lightSkyBlue => [0.529411764705882,0.807843137254902,0.980392156862745],
|
|
347
|
+
:lightSlateGray => [0.466666666666667,0.533333333333333,0.6],
|
|
348
|
+
:lightSlateGrey => [0.466666666666667,0.533333333333333,0.6],
|
|
349
|
+
:lightSteelBlue => [0.690196078431373,0.768627450980392,0.870588235294118],
|
|
350
|
+
:lightYellow => [1.0,1.0,0.87843137254902],
|
|
351
|
+
:lime => [0.0,1.0,0.0],
|
|
352
|
+
:limeGreen => [0.196078431372549,0.803921568627451,0.196078431372549],
|
|
353
|
+
:linen => [0.980392156862745,0.941176470588235,0.901960784313726],
|
|
354
|
+
:magenta => [1.0,0.0,1.0],
|
|
355
|
+
:maroon => [0.501960784313725,0.0,0.0],
|
|
356
|
+
:mediumAquaMarine => [0.4,0.803921568627451,0.666666666666667],
|
|
357
|
+
:mediumBlue => [0.0,0.0,0.803921568627451],
|
|
358
|
+
:mediumOrchid => [0.729411764705882,0.333333333333333,0.827450980392157],
|
|
359
|
+
:mediumPurple => [0.576470588235294,0.43921568627451,0.847058823529412],
|
|
360
|
+
:mediumSeaGreen => [0.235294117647059,0.701960784313725,0.443137254901961],
|
|
361
|
+
:mediumSlateBlue => [0.482352941176471,0.407843137254902,0.933333333333333],
|
|
362
|
+
:mediumSpringGreen => [0.0,0.980392156862745,0.603921568627451],
|
|
363
|
+
:mediumTurquoise => [0.282352941176471,0.819607843137255,0.8],
|
|
364
|
+
:mediumVioletRed => [0.780392156862745,0.0823529411764706,0.52156862745098],
|
|
365
|
+
:midnightBlue => [0.0980392156862745,0.0980392156862745,0.43921568627451],
|
|
366
|
+
:mintCream => [0.96078431372549,1.0,0.980392156862745],
|
|
367
|
+
:mistyRose => [1.0,0.894117647058824,0.882352941176471],
|
|
368
|
+
:moccasin => [1.0,0.894117647058824,0.709803921568627],
|
|
369
|
+
:navajoWhite => [1.0,0.870588235294118,0.67843137254902],
|
|
370
|
+
:navy => [0.0,0.0,0.501960784313725],
|
|
371
|
+
:oldLace => [0.992156862745098,0.96078431372549,0.901960784313726],
|
|
372
|
+
:olive => [0.501960784313725,0.501960784313725,0.0],
|
|
373
|
+
:oliveDrab => [0.419607843137255,0.556862745098039,0.137254901960784],
|
|
374
|
+
:orange => [1.0,0.647058823529412,0.0],
|
|
375
|
+
:orangeRed => [1.0,0.270588235294118,0.0],
|
|
376
|
+
:orchid => [0.854901960784314,0.43921568627451,0.83921568627451],
|
|
377
|
+
:paleGoldenRod => [0.933333333333333,0.909803921568627,0.666666666666667],
|
|
378
|
+
:paleGreen => [0.596078431372549,0.984313725490196,0.596078431372549],
|
|
379
|
+
:paleTurquoise => [0.686274509803922,0.933333333333333,0.933333333333333],
|
|
380
|
+
:paleVioletRed => [0.847058823529412,0.43921568627451,0.576470588235294],
|
|
381
|
+
:papayaWhip => [1.0,0.937254901960784,0.835294117647059],
|
|
382
|
+
:peachPuff => [1.0,0.854901960784314,0.725490196078431],
|
|
383
|
+
:peru => [0.803921568627451,0.52156862745098,0.247058823529412],
|
|
384
|
+
:pink => [1.0,0.752941176470588,0.796078431372549],
|
|
385
|
+
:plum => [0.866666666666667,0.627450980392157,0.866666666666667],
|
|
386
|
+
:powderBlue => [0.690196078431373,0.87843137254902,0.901960784313726],
|
|
387
|
+
:purple => [0.501960784313725,0.0,0.501960784313725],
|
|
388
|
+
:red => [1.0,0.0,0.0],
|
|
389
|
+
:rosyBrown => [0.737254901960784,0.56078431372549,0.56078431372549],
|
|
390
|
+
:royalBlue => [0.254901960784314,0.411764705882353,0.882352941176471],
|
|
391
|
+
:saddleBrown => [0.545098039215686,0.270588235294118,0.0745098039215686],
|
|
392
|
+
:salmon => [0.980392156862745,0.501960784313725,0.447058823529412],
|
|
393
|
+
:sandyBrown => [0.956862745098039,0.643137254901961,0.376470588235294],
|
|
394
|
+
:seaGreen => [0.180392156862745,0.545098039215686,0.341176470588235],
|
|
395
|
+
:seaShell => [1.0,0.96078431372549,0.933333333333333],
|
|
396
|
+
:sienna => [0.627450980392157,0.32156862745098,0.176470588235294],
|
|
397
|
+
:silver => [0.752941176470588,0.752941176470588,0.752941176470588],
|
|
398
|
+
:skyBlue => [0.529411764705882,0.807843137254902,0.92156862745098],
|
|
399
|
+
:slateBlue => [0.415686274509804,0.352941176470588,0.803921568627451],
|
|
400
|
+
:slateGray => [0.43921568627451,0.501960784313725,0.564705882352941],
|
|
401
|
+
:slateGrey => [0.43921568627451,0.501960784313725,0.564705882352941],
|
|
402
|
+
:snow => [1.0,0.980392156862745,0.980392156862745],
|
|
403
|
+
:springGreen => [0.0,1.0,0.498039215686275],
|
|
404
|
+
:steelBlue => [0.274509803921569,0.509803921568627,0.705882352941177],
|
|
405
|
+
:tan => [0.823529411764706,0.705882352941177,0.549019607843137],
|
|
406
|
+
:teal => [0.0,0.501960784313725,0.501960784313725],
|
|
407
|
+
:thistle => [0.847058823529412,0.749019607843137,0.847058823529412],
|
|
408
|
+
:tomato => [1.0,0.388235294117647,0.27843137254902],
|
|
409
|
+
:turquoise => [0.250980392156863,0.87843137254902,0.815686274509804],
|
|
410
|
+
:violet => [0.933333333333333,0.509803921568627,0.933333333333333],
|
|
411
|
+
:wheat => [0.96078431372549,0.870588235294118,0.701960784313725],
|
|
412
|
+
:white => [1.0,1.0,1.0],
|
|
413
|
+
:whiteSmoke => [0.96078431372549,0.96078431372549,0.96078431372549],
|
|
414
|
+
:yellow => [1.0,1.0,0.0],
|
|
415
|
+
:yellowGreen => [0.603921568627451,0.803921568627451,0.196078431372549]
|
|
416
|
+
]
|
|
417
|
+
|
|
418
|
+
CMYK=RGhost::Constants::HashKeyMethodClass[
|
|
419
|
+
:AliceBlue => [0.0588235294117647,0.0274509803921569,0.0,0.0],
|
|
420
|
+
:AntiqueWhite => [0.0,0.06,0.14,0.0196078431372549],
|
|
421
|
+
:Aqua => [1.0,0.0,0.0,0.0],
|
|
422
|
+
:Aquamarine => [0.501960784313725,0.0,0.168627450980392,0.0],
|
|
423
|
+
:Azure => [0.0588235294117647,0.0,0.0,0.0],
|
|
424
|
+
:Beige => [0.0,0.0,0.102040816326531,0.0392156862745098],
|
|
425
|
+
:Bisque => [0.0,0.105882352941176,0.231372549019608,0.0],
|
|
426
|
+
:Black => [0.0,0.0,0.0,1.0],
|
|
427
|
+
:BlanchedAlmond => [0.0,0.0784313725490197,0.196078431372549,0.0],
|
|
428
|
+
:Blue => [1.0,1.0,0.0,0.0],
|
|
429
|
+
:BlueViolet => [0.389380530973451,0.809734513274336,0.0,0.113725490196078],
|
|
430
|
+
:Brown => [0.0,0.745454545454545,0.745454545454545,0.352941176470588],
|
|
431
|
+
:BurlyWood => [0.0,0.171171171171171,0.391891891891892,0.129411764705882],
|
|
432
|
+
:CadetBlue => [0.40625,0.0125,0.0,0.372549019607843],
|
|
433
|
+
:Chartreuse => [0.501960784313725,0.0,1.0,0.0],
|
|
434
|
+
:Chocolate => [0.0,0.5,0.857142857142857,0.176470588235294],
|
|
435
|
+
:Coral => [0.0,0.501960784313725,0.686274509803922,0.0],
|
|
436
|
+
:CornflowerBlue => [0.578059071729958,0.371308016877637,0.0,0.0705882352941176],
|
|
437
|
+
:Cornsilk => [0.0,0.0274509803921569,0.137254901960784,0.0],
|
|
438
|
+
:Crimson => [0.0,0.909090909090909,0.727272727272727,0.137254901960784],
|
|
439
|
+
:Cyan => [1.0,0.0,0.0,0.0],
|
|
440
|
+
:DarkBlue => [1.0,1.0,0.0,0.454901960784314],
|
|
441
|
+
:DarkCyan => [1.0,0.0,0.0,0.454901960784314],
|
|
442
|
+
:DarkGoldenRod => [0.0,0.271739130434783,0.940217391304348,0.27843137254902],
|
|
443
|
+
:DarkGray => [0.0,0.0,0.0,0.337254901960784],
|
|
444
|
+
:DarkGreen => [1.0,0.0,1.0,0.607843137254902],
|
|
445
|
+
:DarkGrey => [0.0,0.0,0.0,0.337254901960784],
|
|
446
|
+
:DarkKhaki => [0.0,0.0317460317460318,0.433862433862434,0.258823529411765],
|
|
447
|
+
:DarkMagenta => [0.0,1.0,0.0,0.454901960784314],
|
|
448
|
+
:DarkOliveGreen => [0.205607476635514,0.0,0.560747663551402,0.580392156862745],
|
|
449
|
+
:DarkOrchid => [0.25,0.754901960784314,0.0,0.2],
|
|
450
|
+
:DarkRed => [0.0,1.0,1.0,0.454901960784314],
|
|
451
|
+
:DarkSalmon => [0.0,0.356223175965665,0.476394849785408,0.0862745098039216],
|
|
452
|
+
:DarkSeaGreen => [0.23936170212766,0.0,0.23936170212766,0.262745098039216],
|
|
453
|
+
:DarkSlateBlue => [0.482014388489209,0.56115107913669,0.0,0.454901960784314],
|
|
454
|
+
:DarkSlateGray => [0.405063291139241,0.0,0.0,0.690196078431373],
|
|
455
|
+
:DarkSlateGrey => [0.405063291139241,0.0,0.0,0.690196078431373],
|
|
456
|
+
:DarkTurquoise => [1.0,0.0143540669856459,0.0,0.180392156862745],
|
|
457
|
+
:DarkViolet => [0.298578199052133,1.0,0.0,0.172549019607843],
|
|
458
|
+
:Darkorange => [0.0,0.450980392156863,1.0,0.0],
|
|
459
|
+
:DeepPink => [0.0,0.92156862745098,0.423529411764706,0.0],
|
|
460
|
+
:DeepSkyBlue => [1.0,0.250980392156863,0.0,0.0],
|
|
461
|
+
:DimGray => [0.0,0.0,0.0,0.588235294117647],
|
|
462
|
+
:DimGrey => [0.0,0.0,0.0,0.588235294117647],
|
|
463
|
+
:DodgerBlue => [0.882352941176471,0.435294117647059,0.0,0.0],
|
|
464
|
+
:FireBrick => [0.0,0.808988764044944,0.808988764044944,0.301960784313726],
|
|
465
|
+
:FloralWhite => [0.0,0.0196078431372549,0.0588235294117647,0.0],
|
|
466
|
+
:ForestGreen => [0.755395683453237,0.0,0.755395683453237,0.454901960784314],
|
|
467
|
+
:Fuchsia => [0.0,1.0,0.0,0.0],
|
|
468
|
+
:Gainsboro => [0.0,0.0,0.0,0.137254901960784],
|
|
469
|
+
:GhostWhite => [0.0274509803921569,0.0274509803921569,0.0,0.0],
|
|
470
|
+
:Gold => [0.0,0.156862745098039,1.0,0.0],
|
|
471
|
+
:GoldenRod => [0.0,0.243119266055046,0.853211009174312,0.145098039215686],
|
|
472
|
+
:Gray => [0.0,0.0,0.0,0.498039215686275],
|
|
473
|
+
:Green => [1.0,0.0,1.0,0.498039215686275],
|
|
474
|
+
:GreenYellow => [0.32156862745098,0.0,0.815686274509804,0.0],
|
|
475
|
+
:Grey => [0.0,0.0,0.0,0.498039215686275],
|
|
476
|
+
:HoneyDew => [0.0588235294117647,0.0,0.0588235294117647,0.0],
|
|
477
|
+
:HotPink => [0.0,0.588235294117647,0.294117647058823,0.0],
|
|
478
|
+
:IndianRed => [0.0,0.551219512195122,0.551219512195122,0.196078431372549],
|
|
479
|
+
:Indigo => [0.423076923076923,1.0,0.0,0.490196078431373],
|
|
480
|
+
:Ivory => [0.0,0.0,0.0588235294117647,0.0],
|
|
481
|
+
:Khaki => [0.0,0.0416666666666666,0.416666666666667,0.0588235294117647],
|
|
482
|
+
:LavenderBlush => [0.0,0.0588235294117647,0.0392156862745098,0.0],
|
|
483
|
+
:Lavender => [0.0799999999999999,0.0799999999999999,0.0,0.0196078431372549],
|
|
484
|
+
:LawnGreen => [0.507936507936508,0.0,1.0,0.0117647058823529],
|
|
485
|
+
:LemonChiffon => [0.0,0.0196078431372549,0.196078431372549,0.0],
|
|
486
|
+
:LightBlue => [0.247826086956522,0.0608695652173913,0.0,0.0980392156862745],
|
|
487
|
+
:LightCoral => [0.0,0.466666666666667,0.466666666666667,0.0588235294117647],
|
|
488
|
+
:LightCyan => [0.12156862745098,0.0,0.0,0.0],
|
|
489
|
+
:LightGoldenRodYellow => [0.0,0.0,0.16,0.0196078431372549],
|
|
490
|
+
:LightGray => [0.0,0.0,0.0,0.172549019607843],
|
|
491
|
+
:LightGreen => [0.394957983193277,0.0,0.394957983193277,0.0666666666666667],
|
|
492
|
+
:LightGrey => [0.0,0.0,0.0,0.172549019607843],
|
|
493
|
+
:LightPink => [0.0,0.286274509803922,0.243137254901961,0.0],
|
|
494
|
+
:LightSalmon => [0.0,0.372549019607843,0.52156862745098,0.0],
|
|
495
|
+
:LightSeaGreen => [0.820224719101124,0.0,0.0449438202247191,0.301960784313726],
|
|
496
|
+
:LightSkyBlue => [0.46,0.176,0.0,0.0196078431372549],
|
|
497
|
+
:LightSlateGray => [0.222222222222222,0.111111111111111,0.0,0.4],
|
|
498
|
+
:LightSlateGrey => [0.222222222222222,0.111111111111111,0.0,0.4],
|
|
499
|
+
:LightSteelBlue => [0.207207207207207,0.117117117117117,0.0,0.129411764705882],
|
|
500
|
+
:LightYellow => [0.0,0.0,0.12156862745098,0.0],
|
|
501
|
+
:Lime => [1.0,0.0,1.0,0.0],
|
|
502
|
+
:LimeGreen => [0.75609756097561,0.0,0.75609756097561,0.196078431372549],
|
|
503
|
+
:Linen => [0.0,0.04,0.0799999999999999,0.0196078431372549],
|
|
504
|
+
:Magenta => [0.0,1.0,0.0,0.0],
|
|
505
|
+
:Maroon => [0.0,1.0,1.0,0.498039215686275],
|
|
506
|
+
:MediumAquaMarine => [0.502439024390244,0.0,0.170731707317073,0.196078431372549],
|
|
507
|
+
:MediumBlue => [1.0,1.0,0.0,0.196078431372549],
|
|
508
|
+
:MediumOrchid => [0.118483412322275,0.597156398104265,0.0,0.172549019607843],
|
|
509
|
+
:MediumPurple => [0.319444444444444,0.481481481481481,0.0,0.152941176470588],
|
|
510
|
+
:MediumSeaGreen => [0.664804469273743,0.0,0.368715083798883,0.298039215686275],
|
|
511
|
+
:MediumSlateBlue => [0.483193277310924,0.563025210084034,0.0,0.0666666666666667],
|
|
512
|
+
:MediumSpringGreen => [1.0,0.0,0.384,0.0196078431372549],
|
|
513
|
+
:MediumTurquoise => [0.655502392344498,0.0,0.0239234449760765,0.180392156862745],
|
|
514
|
+
:MediumVioletRed => [0.0,0.894472361809045,0.331658291457286,0.219607843137255],
|
|
515
|
+
:MidnightBlue => [0.776785714285714,0.776785714285714,0.0,0.56078431372549],
|
|
516
|
+
:MintCream => [0.0392156862745098,0.0,0.0196078431372549,0.0],
|
|
517
|
+
:MistyRose => [0.0,0.105882352941176,0.117647058823529,0.0],
|
|
518
|
+
:Moccasin => [0.0,0.105882352941176,0.290196078431373,0.0],
|
|
519
|
+
:NavajoWhite => [0.0,0.129411764705882,0.32156862745098,0.0],
|
|
520
|
+
:Navy => [1.0,1.0,0.0,0.498039215686275],
|
|
521
|
+
:OldLace => [0.0,0.0316205533596838,0.0909090909090909,0.00784313725490193],
|
|
522
|
+
:Olive => [0.0,0.0,1.0,0.498039215686275],
|
|
523
|
+
:OliveDrab => [0.246478873239437,0.0,0.753521126760563,0.443137254901961],
|
|
524
|
+
:Orange => [0.0,0.352941176470588,1.0,0.0],
|
|
525
|
+
:OrangeRed => [0.0,0.729411764705882,1.0,0.0],
|
|
526
|
+
:Orchid => [0.0,0.486238532110092,0.0183486238532109,0.145098039215686],
|
|
527
|
+
:PaleGoldenRod => [0.0,0.0252100840336135,0.285714285714286,0.0666666666666667],
|
|
528
|
+
:PaleGreen => [0.394422310756972,0.0,0.394422310756972,0.015686274509804],
|
|
529
|
+
:PaleTurquoise => [0.264705882352941,0.0,0.0,0.0666666666666667],
|
|
530
|
+
:PaleVioletRed => [0.0,0.481481481481481,0.319444444444444,0.152941176470588],
|
|
531
|
+
:PapayaWhip => [0.0,0.0627450980392157,0.164705882352941,0.0],
|
|
532
|
+
:PeachPuff => [0.0,0.145098039215686,0.274509803921569,0.0],
|
|
533
|
+
:Peru => [0.0,0.351219512195122,0.692682926829268,0.196078431372549],
|
|
534
|
+
:Pink => [0.0,0.247058823529412,0.203921568627451,0.0],
|
|
535
|
+
:Plum => [0.0,0.276018099547511,0.0,0.133333333333333],
|
|
536
|
+
:PowderBlue => [0.234782608695652,0.0260869565217392,0.0,0.0980392156862745],
|
|
537
|
+
:Purple => [0.0,1.0,0.0,0.498039215686275],
|
|
538
|
+
:Red => [0.0,1.0,1.0,0.0],
|
|
539
|
+
:RosyBrown => [0.0,0.23936170212766,0.23936170212766,0.262745098039216],
|
|
540
|
+
:RoyalBlue => [0.711111111111111,0.533333333333333,0.0,0.117647058823529],
|
|
541
|
+
:SaddleBrown => [0.0,0.503597122302158,0.863309352517986,0.454901960784314],
|
|
542
|
+
:Salmon => [0.0,0.488,0.544,0.0196078431372549],
|
|
543
|
+
:SandyBrown => [0.0,0.327868852459016,0.60655737704918,0.0431372549019607],
|
|
544
|
+
:SeaGreen => [0.669064748201439,0.0,0.37410071942446,0.454901960784314],
|
|
545
|
+
:SeaShell => [0.0,0.0392156862745098,0.0666666666666667,0.0],
|
|
546
|
+
:Sienna => [0.0,0.4875,0.71875,0.372549019607843],
|
|
547
|
+
:Silver => [0.0,0.0,0.0,0.247058823529412],
|
|
548
|
+
:SkyBlue => [0.425531914893617,0.123404255319149,0.0,0.0784313725490197],
|
|
549
|
+
:SlateBlue => [0.482926829268293,0.560975609756098,0.0,0.196078431372549],
|
|
550
|
+
:SlateGray => [0.222222222222222,0.111111111111111,0.0,0.435294117647059],
|
|
551
|
+
:SlateGrey => [0.222222222222222,0.111111111111111,0.0,0.435294117647059],
|
|
552
|
+
:Snow => [0.0,0.0196078431372549,0.0196078431372549,0.0],
|
|
553
|
+
:SpringGreen => [1.0,0.0,0.501960784313725,0.0],
|
|
554
|
+
:SteelBlue => [0.611111111111111,0.277777777777778,0.0,0.294117647058823],
|
|
555
|
+
:Tan => [0.0,0.142857142857143,0.333333333333333,0.176470588235294],
|
|
556
|
+
:Teal => [1.0,0.0,0.0,0.498039215686275],
|
|
557
|
+
:Thistle => [0.0,0.115740740740741,0.0,0.152941176470588],
|
|
558
|
+
:Tomato => [0.0,0.611764705882353,0.72156862745098,0.0],
|
|
559
|
+
:Turquoise => [0.714285714285714,0.0,0.0714285714285714,0.12156862745098],
|
|
560
|
+
:Violet => [0.0,0.453781512605042,0.0,0.0666666666666667],
|
|
561
|
+
:Wheat => [0.0,0.0938775510204082,0.269387755102041,0.0392156862745098],
|
|
562
|
+
:White => [0.0,0.0,0.0,0.0],
|
|
563
|
+
:WhiteSmoke => [0.0,0.0,0.0,0.0392156862745098],
|
|
564
|
+
:Yellow => [0.0,0.0,1.0,0.0],
|
|
565
|
+
:YellowGreen => [0.248780487804878,0.0,0.75609756097561,0.196078431372549]
|
|
566
|
+
]
|
|
567
|
+
|
|
568
|
+
end
|
|
569
|
+
#Standard papers
|
|
570
|
+
module Papers
|
|
571
|
+
STANDARD={
|
|
572
|
+
"11x17" => [792,1224],
|
|
573
|
+
:ledger => [1224,792],
|
|
574
|
+
:legal => [612,1008],
|
|
575
|
+
:letter => [612,792],
|
|
576
|
+
:lettersmall=> [612,792],
|
|
577
|
+
:archE => [2592,3456],
|
|
578
|
+
:archD => [1728,2592],
|
|
579
|
+
:archC => [1296,1728],
|
|
580
|
+
:archB => [864,1296],
|
|
581
|
+
:archA => [648,864],
|
|
582
|
+
#ISO standard]
|
|
583
|
+
:a0 => [2384,3370],
|
|
584
|
+
:a1 => [1684,2384],
|
|
585
|
+
:a2 => [1191,1684],
|
|
586
|
+
:a3 => [842,1191],
|
|
587
|
+
:a4 => [595,842],
|
|
588
|
+
:a4small => [595,842],
|
|
589
|
+
:a5 => [420,595],
|
|
590
|
+
:a6 => [297,420],
|
|
591
|
+
:a7 => [210,297],
|
|
592
|
+
:a8 => [148,210],
|
|
593
|
+
:a9 => [105,148],
|
|
594
|
+
:a10 => [73,105],
|
|
595
|
+
:isob0 => [2835,4008],
|
|
596
|
+
:isob1 => [2004,2835],
|
|
597
|
+
:isob2 => [1417,2004],
|
|
598
|
+
:isob3 => [1001,1417],
|
|
599
|
+
:isob4 => [709,1001],
|
|
600
|
+
:isob5 => [499,709],
|
|
601
|
+
:isob6 => [354,499],
|
|
602
|
+
:c0 => [2599,3677],
|
|
603
|
+
:c1 => [1837,2599],
|
|
604
|
+
:c2 => [1298,1837],
|
|
605
|
+
:c3 => [918,1298],
|
|
606
|
+
:c4 => [649,918],
|
|
607
|
+
:c5 => [459,649],
|
|
608
|
+
:c6 => [323,459],
|
|
609
|
+
#JIS standard
|
|
610
|
+
:jisb0 => [1030,1456],
|
|
611
|
+
:jisb1 => [728,1030],
|
|
612
|
+
:jisb2 => [515,728],
|
|
613
|
+
:jisb3 => [364,515],
|
|
614
|
+
:jisb4 => [257,364],
|
|
615
|
+
:jisb5 => [182,257],
|
|
616
|
+
:jisb6 => [128,182],
|
|
617
|
+
#Other
|
|
618
|
+
:flsa => [612,936],
|
|
619
|
+
:flse => [612,936],
|
|
620
|
+
:halfletter => [396,612]
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
end
|
|
624
|
+
end
|
|
625
|
+
|
|
626
|
+
|