Class: CTioga2::Graphics::Styles::BaseTextStyle
- Inherits:
-
BasicStyle
- Object
- BasicStyle
- CTioga2::Graphics::Styles::BaseTextStyle
- Defined in:
- lib/ctioga2/graphics/styles/texts.rb
Overview
The style of a text object. This class is suitable for inclusion as a Hash to FigureMaker#show_axis, for the tick labels.
Direct Known Subclasses
Constant Summary
Constants inherited from BasicStyle
CTioga2::Graphics::Styles::BasicStyle::OldAttrAccessor
Instance Attribute Summary collapse
-
#alignement ⇒ Object
The vertical alignment.
-
#angle ⇒ Object
The angle of the text.
-
#justification ⇒ Object
The horizontal alignment.
-
#scale ⇒ Object
The scale of the text.
-
#shift ⇒ Object
The ‘shift’ of the text.
Instance Method Summary collapse
-
#draw_text(t, text, x_or_loc, y = nil, measure = nil) ⇒ Object
Draw the text at the given location with the given style.
Methods inherited from BasicStyle
attr_accessor, attributes, from_hash, #instance_variable_defined?, #set_from_hash, #to_hash, #update_from_other
Instance Attribute Details
#alignement ⇒ Object
The vertical alignment
43 44 45 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 43 def alignement @alignement end |
#angle ⇒ Object
The angle of the text
32 33 34 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 32 def angle @angle end |
#justification ⇒ Object
The horizontal alignment
46 47 48 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 46 def justification @justification end |
#scale ⇒ Object
The scale of the text
40 41 42 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 40 def scale @scale end |
#shift ⇒ Object
The ‘shift’ of the text. Only meaningful for axes and tick labels, where the position of the text is specified using a side rather than a precise position
37 38 39 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 37 def shift @shift end |
Instance Method Details
#draw_text(t, text, x_or_loc, y = nil, measure = nil) ⇒ Object
Draw the text at the given location with the given style. If y is nil, then x_or_loc is taken to be a location (see FigureMaker#show_text).
51 52 53 54 |
# File 'lib/ctioga2/graphics/styles/texts.rb', line 51 def draw_text(t, text, x_or_loc, y = nil, measure = nil) dict = prepare_show_text_dict(text, x_or_loc, y, measure) t.show_text(dict) end |