ctioga2 0.0 → 0.1

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 (84) hide show
  1. data/Changelog +25 -1
  2. data/lib/ctioga2/commands/commands.rb +13 -2
  3. data/lib/ctioga2/commands/doc/doc.rb +13 -17
  4. data/lib/ctioga2/commands/doc/documentation-commands.rb +14 -1
  5. data/lib/ctioga2/commands/doc/help.rb +136 -25
  6. data/lib/ctioga2/commands/doc/html.rb +56 -4
  7. data/lib/ctioga2/commands/doc/introspection.rb +45 -9
  8. data/lib/ctioga2/commands/doc/man.rb +7 -5
  9. data/lib/ctioga2/commands/doc/markup.rb +39 -12
  10. data/lib/ctioga2/commands/doc/wordwrap.rb +70 -0
  11. data/lib/ctioga2/commands/general-commands.rb +7 -4
  12. data/lib/ctioga2/commands/general-types.rb +27 -12
  13. data/lib/ctioga2/commands/interpreter.rb +2 -2
  14. data/lib/ctioga2/commands/parsers/command-line.rb +9 -5
  15. data/lib/ctioga2/commands/parsers/file.rb +5 -3
  16. data/lib/ctioga2/commands/type.rb +10 -3
  17. data/lib/ctioga2/commands/variables.rb +2 -2
  18. data/lib/ctioga2/data/backends/backend.rb +17 -15
  19. data/lib/ctioga2/data/backends/backends.rb +2 -2
  20. data/lib/ctioga2/data/backends/backends/gnuplot.rb +20 -5
  21. data/lib/ctioga2/data/backends/backends/math.rb +2 -2
  22. data/lib/ctioga2/data/backends/backends/text.rb +112 -17
  23. data/lib/ctioga2/data/backends/description.rb +10 -11
  24. data/lib/ctioga2/data/datacolumn.rb +73 -14
  25. data/lib/ctioga2/data/dataset.rb +305 -9
  26. data/lib/ctioga2/data/filters.rb +49 -1
  27. data/lib/ctioga2/data/indexed-dtable.rb +137 -0
  28. data/lib/ctioga2/data/point.rb +98 -7
  29. data/lib/ctioga2/data/stack.rb +98 -21
  30. data/lib/ctioga2/graphics/coordinates.rb +19 -2
  31. data/lib/ctioga2/graphics/elements.rb +12 -2
  32. data/lib/ctioga2/graphics/elements/containers.rb +14 -2
  33. data/lib/ctioga2/graphics/elements/contour.rb +67 -0
  34. data/lib/ctioga2/graphics/elements/curve2d.rb +103 -42
  35. data/lib/ctioga2/graphics/elements/element.rb +12 -2
  36. data/lib/ctioga2/graphics/elements/gradient-region.rb +94 -0
  37. data/lib/ctioga2/graphics/elements/parametric2d.rb +172 -0
  38. data/lib/ctioga2/graphics/elements/primitive.rb +37 -21
  39. data/lib/ctioga2/graphics/elements/region.rb +143 -0
  40. data/lib/ctioga2/graphics/elements/subplot.rb +92 -32
  41. data/lib/ctioga2/graphics/elements/tangent.rb +99 -0
  42. data/lib/ctioga2/graphics/elements/xyz-map.rb +126 -0
  43. data/lib/ctioga2/graphics/generator.rb +91 -6
  44. data/lib/ctioga2/graphics/legends.rb +26 -21
  45. data/lib/ctioga2/graphics/legends/area.rb +8 -8
  46. data/lib/ctioga2/graphics/legends/items.rb +5 -5
  47. data/lib/ctioga2/graphics/legends/storage.rb +4 -2
  48. data/lib/ctioga2/graphics/root.rb +24 -2
  49. data/lib/ctioga2/graphics/styles.rb +8 -0
  50. data/lib/ctioga2/graphics/styles/axes.rb +49 -23
  51. data/lib/ctioga2/graphics/styles/base.rb +2 -2
  52. data/lib/ctioga2/graphics/styles/carrays.rb +9 -2
  53. data/lib/ctioga2/graphics/styles/colormap.rb +272 -0
  54. data/lib/ctioga2/graphics/styles/curve.rb +64 -4
  55. data/lib/ctioga2/graphics/styles/drawable.rb +68 -9
  56. data/lib/ctioga2/graphics/styles/errorbar.rb +73 -0
  57. data/lib/ctioga2/graphics/styles/factory.rb +133 -17
  58. data/lib/ctioga2/graphics/styles/gradients.rb +60 -0
  59. data/lib/ctioga2/graphics/styles/location.rb +64 -0
  60. data/lib/ctioga2/graphics/styles/map-axes.rb +164 -0
  61. data/lib/ctioga2/graphics/styles/plot.rb +165 -62
  62. data/lib/ctioga2/graphics/styles/sets.rb +14 -1
  63. data/lib/ctioga2/graphics/styles/texts.rb +44 -34
  64. data/lib/ctioga2/graphics/subplot-commands.rb +94 -6
  65. data/lib/ctioga2/graphics/types.rb +113 -35
  66. data/lib/ctioga2/graphics/types/bijection.rb +3 -3
  67. data/lib/ctioga2/graphics/types/boundaries.rb +120 -1
  68. data/lib/ctioga2/graphics/types/dimensions.rb +8 -1
  69. data/lib/ctioga2/graphics/types/grid.rb +196 -0
  70. data/lib/ctioga2/graphics/types/location.rb +228 -0
  71. data/lib/ctioga2/graphics/types/point.rb +2 -2
  72. data/lib/ctioga2/log.rb +18 -18
  73. data/lib/ctioga2/metabuilder/type.rb +15 -3
  74. data/lib/ctioga2/metabuilder/types.rb +2 -2
  75. data/lib/ctioga2/metabuilder/types/coordinates.rb +13 -1
  76. data/lib/ctioga2/metabuilder/types/data.rb +50 -0
  77. data/lib/ctioga2/metabuilder/types/generic.rb +60 -0
  78. data/lib/ctioga2/metabuilder/types/lists.rb +53 -16
  79. data/lib/ctioga2/metabuilder/types/styles.rb +26 -45
  80. data/lib/ctioga2/plotmaker.rb +91 -20
  81. data/lib/ctioga2/postprocess.rb +8 -8
  82. data/lib/ctioga2/utils.rb +23 -4
  83. metadata +107 -75
  84. data/lib/ctioga2/data/merge.rb +0 -43
@@ -16,7 +16,7 @@ require 'ctioga2/log'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 53 $', '$Date: 2009-05-20 01:05:32 +0200 (Wed, 20 May 2009) $')
19
+ Version::register_svn_info('$Revision: 196 $', '$Date: 2010-11-25 20:15:32 +0100 (Thu, 25 Nov 2010) $')
20
20
 
21
21
  module Graphics
22
22
 
@@ -190,7 +190,7 @@ module CTioga2
190
190
  # specification. Splits up the text at a comma and
191
191
  def self.from_text(text, default = :figure)
192
192
  if not text =~ /^\s*([btlrc]{2})(?::([^,]+),\s*(.*))?\s*$/
193
- return "Invalid format for #{text}"
193
+ raise "Invalid format for aligned point: #{text}"
194
194
  end
195
195
 
196
196
  specs = $1
@@ -16,7 +16,7 @@ require 'logger'
16
16
 
17
17
  module CTioga2
18
18
 
19
- Version::register_svn_info('$Revision: 90 $', '$Date: 2009-06-22 23:28:01 +0200 (Mon, 22 Jun 2009) $')
19
+ Version::register_svn_info('$Revision: 152 $', '$Date: 2010-06-20 01:55:50 +0200 (Sun, 20 Jun 2010) $')
20
20
 
21
21
  # This module should be included (or extended) by every class that
22
22
  # need logging/debugging facilities.
@@ -24,28 +24,28 @@ module CTioga2
24
24
 
25
25
  # Prints a debug message, on channel _channel_. Channel handling
26
26
  # is not implemented yet.
27
- def debug(message, channel = nil)
28
- @@logger.debug(message)
27
+ def debug(channel = nil)
28
+ @@logger.debug {yield}
29
29
  end
30
30
 
31
31
  # Prints a warning message
32
- def warn(message)
33
- @@logger.warn(message)
32
+ def warn
33
+ @@logger.warn {yield}
34
34
  end
35
35
 
36
36
  # Prints an informational message
37
- def info(message)
38
- @@logger.info(message)
37
+ def info
38
+ @@logger.info {yield}
39
39
  end
40
40
 
41
41
  # Prints an error message
42
- def error(message)
43
- @@logger.error(message)
42
+ def error
43
+ @@logger.error {yield}
44
44
  end
45
45
 
46
46
  # Prints a fatal error message and initiates program termination.
47
- def fatal(message)
48
- @@logger.fatal(message)
47
+ def fatal
48
+ @@logger.fatal {yield}
49
49
  exit 1 # Fatal error.
50
50
  end
51
51
 
@@ -76,13 +76,13 @@ module CTioga2
76
76
  # A logged replacement for system
77
77
  def spawn(cmd, priority = :info)
78
78
  retval = system(cmd)
79
- self.send(priority, "Spawned #{cmd} -> " +
80
- if retval
81
- "success"
82
- else
83
- "failure"
84
- end
85
- )
79
+ self.send(priority) { "Spawned #{cmd} -> " +
80
+ if retval
81
+ "success"
82
+ else
83
+ "failure"
84
+ end
85
+ }
86
86
  return retval
87
87
  end
88
88
 
@@ -20,7 +20,7 @@ require 'ctioga2/utils'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 18 $', '$Date: 2009-04-28 23:43:54 +0200 (Tue, 28 Apr 2009) $')
23
+ Version::register_svn_info('$Revision: 151 $', '$Date: 2010-06-19 23:45:20 +0200 (Sat, 19 Jun 2010) $')
24
24
 
25
25
 
26
26
  # The MetaBuilder module contains a framework to perform
@@ -100,6 +100,10 @@ module CTioga2
100
100
  # many of them here.
101
101
  attr_accessor :re_shortcuts
102
102
 
103
+ # If the given string matches this regular expression, it is
104
+ # passed through without further modification.
105
+ attr_accessor :passthrough
106
+
103
107
  # A default constructor. It should be safe to use it directly for
104
108
  # children, unless something more specific is needed. Any descendent
105
109
  # should *always* register _type_ as @type - or, even better, call
@@ -118,6 +122,10 @@ module CTioga2
118
122
  end
119
123
  end
120
124
  end
125
+ if @type[:passthrough]
126
+ @passthrough = @type[:passthrough]
127
+ end
128
+
121
129
  end
122
130
 
123
131
  # This class function actually registers the current type
@@ -126,8 +134,8 @@ module CTioga2
126
134
  # creates a #type_name instance method returning this value.
127
135
  def self.type_name(name, public_name = nil, default_value = nil)
128
136
  if @@types.has_key?(name)
129
- warn "Redefining type #{name} " +
130
- "from #{@@types[name]} to #{self}"
137
+ warn { "Redefining type #{name} " +
138
+ "from #{@@types[name]} to #{self}" }
131
139
  end
132
140
  @@types[name] = self
133
141
  self.send(:define_method,:type_name) do
@@ -177,6 +185,10 @@ module CTioga2
177
185
  # is recommanded to define a #string_to_type_internal function
178
186
  # rather to redefine #string_to_type
179
187
  def string_to_type(string)
188
+ # First, passthrough
189
+ if @passthrough && @passthrough === string
190
+ return stt_run_hook(string)
191
+ end
180
192
  # First, shortcuts:
181
193
  if @shortcuts and @shortcuts.key? string
182
194
  return stt_run_hook(@shortcuts[string])
@@ -33,7 +33,7 @@ for file in files.uniq
33
33
  begin
34
34
  require "ctioga2/metabuilder/types/#{file}"
35
35
  rescue Exception => e
36
- warn "There was a problem trying to load 'ctioga2/metabuilder/types/#{file}'"
37
- warn "#{e.inspect}"
36
+ warn { "There was a problem trying to load 'ctioga2/metabuilder/types/#{file}'" }
37
+ warn { "#{e.inspect}" }
38
38
  end
39
39
  end
@@ -20,7 +20,7 @@ require 'ctioga2/utils'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 67 $', '$Date: 2009-05-30 23:38:00 +0200 (Sat, 30 May 2009) $')
23
+ Version::register_svn_info('$Revision: 198 $', '$Date: 2010-11-30 00:48:23 +0100 (Tue, 30 Nov 2010) $')
24
24
 
25
25
  module MetaBuilder
26
26
  module Types
@@ -100,6 +100,8 @@ module CTioga2
100
100
  def string_to_type_internal(str)
101
101
  default = @type[:default] || :frame
102
102
  case str
103
+ when Graphics::Types::GridBox::GridBoxRE
104
+ return Graphics::Types::GridBox::from_text(str)
103
105
  when Graphics::Types::PointBasedBox::PointBasedBoxRE
104
106
  return Graphics::Types::PointBasedBox::from_text(str, default)
105
107
  else
@@ -119,6 +121,16 @@ module CTioga2
119
121
 
120
122
  end
121
123
 
124
+ class LocationType < Type
125
+
126
+ type_name :location, 'location'
127
+
128
+ def string_to_type_internal(str)
129
+ return Graphics::Types::PlotLocation.from_text(str)
130
+ end
131
+
132
+ end
133
+
122
134
  end
123
135
  end
124
136
  end
@@ -0,0 +1,50 @@
1
+ # styles.rb : Different Types to deal with various style arguments.
2
+ # Copyright (C) 2006, 2009 Vincent Fourmond
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
+
18
+
19
+ require 'ctioga2/utils'
20
+
21
+ module CTioga2
22
+
23
+ Version::register_svn_info('$Revision: 171 $', '$Date: 2010-10-22 17:07:52 +0200 (Fri, 22 Oct 2010) $')
24
+
25
+ module MetaBuilder
26
+ module Types
27
+
28
+ class DataPointType < Type
29
+
30
+ type_name :data_point, 'data-point'
31
+
32
+ def string_to_type_internal(str)
33
+ return Data::DataPoint.from_text(PlotMaker.plotmaker,str)
34
+ end
35
+ end
36
+
37
+ class LevelType < Type
38
+
39
+ type_name :level, 'level'
40
+
41
+ # @todo This should be modified eventually to mirror the
42
+ # DataPoint, but for now, no.
43
+ def string_to_type_internal(str)
44
+ return [str.to_f, PlotMaker.plotmaker.data_stack.last]
45
+ end
46
+ end
47
+
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,60 @@
1
+ # generic.rb: conversion-function based type (or the Death of MetaBuilder)
2
+ # you can choose among several possibilities
3
+ # Copyright (C) 2010 Vincent Fourmond
4
+ #
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation; either version 2 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ require 'ctioga2/utils'
20
+
21
+ module CTioga2
22
+
23
+ Version::register_svn_info('$Revision$', '$Date$')
24
+
25
+
26
+ module MetaBuilder
27
+
28
+ module Types
29
+
30
+ # A type based on a conversion function from_text from a given
31
+ # class/module.
32
+ class FunctionBasedType < Type
33
+
34
+ type_name :function_based
35
+
36
+ def type_name
37
+ return 'function_based'
38
+ end
39
+
40
+
41
+ def initialize(type)
42
+ super
43
+ raise "type must have a :class key" unless type.has_key?(:class)
44
+ # We make a copy for our own purposes.
45
+ @cls = type[:class]
46
+ @func_name = type[:func_name] || :from_text
47
+ end
48
+
49
+ def string_to_type_internal(str)
50
+ return @cls.send(@func_name, str)
51
+ end
52
+
53
+ def type_to_string_internal(val)
54
+ return val.to_s
55
+ end
56
+ end
57
+
58
+ end
59
+ end
60
+ end
@@ -20,7 +20,7 @@ require 'ctioga2/utils'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 2 $', '$Date: 2009-04-25 14:03:30 +0200 (Sat, 25 Apr 2009) $')
23
+ Version::register_svn_info('$Revision: 222 $', '$Date: 2011-01-11 00:52:31 +0100 (Tue, 11 Jan 2011) $')
24
24
 
25
25
 
26
26
  module MetaBuilder
@@ -107,6 +107,38 @@ module CTioga2
107
107
  end
108
108
  end
109
109
 
110
+
111
+ # A choice between different symbols based on regular expressions.
112
+ class REListParameter < Type
113
+
114
+ type_name :re_list
115
+
116
+ def initialize(type)
117
+ super
118
+ raise "type must have a :list key" unless type.has_key?(:list)
119
+ # We make a copy for our own purposes.
120
+ @re_hash = type[:list].dup
121
+ end
122
+
123
+ def type_name
124
+ return 'relist'
125
+ end
126
+
127
+ def string_to_type_internal(str)
128
+ for k,v in @re_hash
129
+ if str =~ /^\s*#{k}\s*$/
130
+ return v
131
+ end
132
+ end
133
+ raise IncorrectInput, "Invalid input: #{str} should match " +
134
+ @re_hash.keys.map {|s| s.to_s}.join(',')
135
+ end
136
+
137
+ def type_to_string_internal(val)
138
+ return val.to_s
139
+ end
140
+ end
141
+
110
142
  # An array of identical elements of type specified by :subtype. Defaults
111
143
  # to String
112
144
  class ArrayParameter < Type
@@ -142,14 +174,14 @@ module CTioga2
142
174
  # A Type used for sets for Graphics::Styles::CircularArray
143
175
  # objects.
144
176
  #
145
- # TODO: write a gradient stuff !!!
177
+ # \todo write a gradient stuff !!!
146
178
  class SetParameter < ArrayParameter
147
179
  type_name :set
148
180
 
149
181
  def initialize(type)
150
182
  super
151
183
  @separator = /\s*\|\s*/
152
- @sepatarot_out = '|'
184
+ @separator_out = '|'
153
185
  end
154
186
 
155
187
  def type_name
@@ -157,28 +189,33 @@ module CTioga2
157
189
  end
158
190
 
159
191
  def string_to_type_internal(str)
192
+ multiply = nil
193
+ if str =~ /(.*)\*\s*(\d+)\s*$/
194
+ multiply = $2.to_i
195
+ str = $1
196
+ end
160
197
  if str =~ /^\s*gradient:(.+)--(.+),(\d+)\s*$/
161
198
  s,e,nb = $1, $2, $3.to_i
162
199
  s,e = @subtype.string_to_type(s),@subtype.string_to_type(e)
163
200
  fact = if nb > 1
164
- 1.0/(nb - 1) # The famous off-by one...
165
- else
166
- warn "Incorrect gradient number: #{nb}"
167
- 1.0
168
- end
201
+ 1.0/(nb - 1) # The famous off-by one...
202
+ else
203
+ warn { "Incorrect gradient number: #{nb}" }
204
+ 1.0
205
+ end
169
206
  array = []
170
207
  nb.times do |i|
171
- a = []
172
- f = i * fact
173
- e.each_index do |c|
174
- a << s[c] * (1 - f) + e[c] * f
175
- end
176
- array << a
208
+ array << Utils::mix_objects(e,s, i * fact)
177
209
  end
178
- return array
179
210
  else
180
- return super
211
+ array = super
212
+ end
213
+ if multiply
214
+ # Seems that I've finally managed to understand what zip
215
+ # is useful for !
216
+ array = array.zip(*([array]*(multiply-1))).flatten(1)
181
217
  end
218
+ return array
182
219
  end
183
220
 
184
221
  end
@@ -20,28 +20,36 @@ require 'ctioga2/utils'
20
20
 
21
21
  module CTioga2
22
22
 
23
- Version::register_svn_info('$Revision: 96 $', '$Date: 2009-06-27 20:56:17 +0200 (Sat, 27 Jun 2009) $')
23
+ Version::register_svn_info('$Revision: 222 $', '$Date: 2011-01-11 00:52:31 +0100 (Tue, 11 Jan 2011) $')
24
24
 
25
25
  module MetaBuilder
26
26
  module Types
27
27
 
28
- # A color for use with Tioga, ie an [red, green, blue] array
29
- # of values between 0 and 1.0. It accepts HTML-like colors, or
28
+ # A color for use with Tioga, ie a [red, green, blue] array of
29
+ # values between 0 and 1.0. It accepts HTML-like colors, or
30
30
  # three comma-separated values between 0 and 1.
31
31
  class TiogaColorType < Type
32
32
 
33
33
  type_name :tioga_color, 'color'
34
+
35
+ HLSRegexp = /(?:hls):/i
34
36
 
35
37
  def string_to_type_internal(str)
38
+ if str =~ HLSRegexp
39
+ hls = true
40
+ str = str.gsub(HLSRegexp,'')
41
+ else
42
+ hls = false
43
+ end
36
44
  if str =~ /^\s*#([0-9a-fA-F]{6})\s*$/
37
- value = $1.scan(/../).map {
45
+ value = $1.scan(/../).map {
38
46
  |i| i.to_i(16)/255.0
39
47
  }
40
48
  elsif str =~ /^\s*#([0-9a-fA-F]{3})\s*$/
41
- value = $1.scan(/../).map {
49
+ value = $1.scan(/./).map {
42
50
  |i| i.to_i(16)/15.0
43
51
  }
44
- else
52
+ else
45
53
  value = str.split(/\s*,\s*/).map do |s|
46
54
  s.to_f
47
55
  end
@@ -49,6 +57,10 @@ module CTioga2
49
57
  if value.size != 3
50
58
  raise IncorrectInput, "You need exactly three values to make up a color"
51
59
  end
60
+ if hls
61
+ # Requires Tioga r599
62
+ value = Tioga::FigureMaker.hls_to_rgb(value)
63
+ end
52
64
  return value
53
65
  end
54
66
  end
@@ -74,7 +86,6 @@ module CTioga2
74
86
  else
75
87
  phase = 0
76
88
  end
77
- p specs
78
89
  return [ specs.map { |s| s.to_f }, phase]
79
90
  end
80
91
  end
@@ -125,51 +136,21 @@ module CTioga2
125
136
  end
126
137
  end
127
138
 
128
- # Justification (horizontal alignement)
129
- class JustificationType < Type
130
-
131
- include Tioga::FigureConstants
132
-
133
- ValidTypes = {
134
- /l(eft)?/i => LEFT_JUSTIFIED,
135
- /c(enter)?/i => CENTERED,
136
- /r(ight)?/ => RIGHT_JUSTIFIED
137
- }
138
-
139
- type_name :tioga_justification, 'halign'
139
+ # LaTeX font
140
+ class LaTeXFontBaseType < Type
141
+ type_name :latex_font, 'latex font'
140
142
 
141
143
  def string_to_type_internal(str)
142
- for k,v in ValidTypes
143
- if str =~ /^\s*#{k}\s*/
144
- return v
145
- end
146
- end
147
- raise IncorrectInput, "Not a justification: #{str}"
144
+ return Graphics::Styles::LaTeXFont.from_text(str)
148
145
  end
149
146
  end
150
147
 
151
- # Vertical alignement
152
- class AlignmentType < Type
153
-
154
- include Tioga::FigureConstants
155
-
156
- type_name :tioga_align, 'valign'
157
-
158
- ValidTypes = {
159
- /t(op)?/i => ALIGNED_AT_TOP,
160
- /c(enter)|m(idheight)/i => ALIGNED_AT_MIDHEIGHT,
161
- /B|Baseline|baseline/ => ALIGNED_AT_BASELINE,
162
- /b(ottom)?/ => ALIGNED_AT_BOTTOM
163
- }
164
-
148
+ # Colormap
149
+ class LaTeXFontBaseType < Type
150
+ type_name :colormap, 'color map'
165
151
 
166
152
  def string_to_type_internal(str)
167
- for k,v in ValidTypes
168
- if str =~ /^\s*#{k}\s*/
169
- return v
170
- end
171
- end
172
- raise IncorrectInput, "Not a vertical alignment: #{str}"
153
+ return Graphics::Styles::ColorMap.from_text(str)
173
154
  end
174
155
  end
175
156