Class: Origami::Text::State
- Inherits:
-
Object
- Object
- Origami::Text::State
- Defined in:
- lib/origami/graphics/text.rb
Instance Attribute Summary collapse
-
#char_spacing ⇒ Object
Returns the value of attribute char_spacing.
-
#font ⇒ Object
Returns the value of attribute font.
-
#font_size ⇒ Object
Returns the value of attribute font_size.
-
#leading ⇒ Object
Returns the value of attribute leading.
-
#rendering_mode ⇒ Object
Returns the value of attribute rendering_mode.
-
#scaling ⇒ Object
Returns the value of attribute scaling.
-
#text_knockout ⇒ Object
Returns the value of attribute text_knockout.
-
#text_line_matrix ⇒ Object
Returns the value of attribute text_line_matrix.
-
#text_matrix ⇒ Object
Returns the value of attribute text_matrix.
-
#text_rendering_matrix ⇒ Object
Returns the value of attribute text_rendering_matrix.
-
#text_rise ⇒ Object
Returns the value of attribute text_rise.
-
#word_spacing ⇒ Object
Returns the value of attribute word_spacing.
Instance Method Summary collapse
- #begin_text_object ⇒ Object
- #end_text_object ⇒ Object
-
#initialize ⇒ State
constructor
A new instance of State.
- #is_in_text_object? ⇒ Boolean
- #reset ⇒ Object
Constructor Details
#initialize ⇒ State
Returns a new instance of State.
55 56 57 |
# File 'lib/origami/graphics/text.rb', line 55 def initialize self.reset end |
Instance Attribute Details
#char_spacing ⇒ Object
Returns the value of attribute char_spacing.
48 49 50 |
# File 'lib/origami/graphics/text.rb', line 48 def char_spacing @char_spacing end |
#font ⇒ Object
Returns the value of attribute font.
49 50 51 |
# File 'lib/origami/graphics/text.rb', line 49 def font @font end |
#font_size ⇒ Object
Returns the value of attribute font_size.
49 50 51 |
# File 'lib/origami/graphics/text.rb', line 49 def font_size @font_size end |
#leading ⇒ Object
Returns the value of attribute leading.
48 49 50 |
# File 'lib/origami/graphics/text.rb', line 48 def leading @leading end |
#rendering_mode ⇒ Object
Returns the value of attribute rendering_mode.
50 51 52 |
# File 'lib/origami/graphics/text.rb', line 50 def rendering_mode @rendering_mode end |
#scaling ⇒ Object
Returns the value of attribute scaling.
48 49 50 |
# File 'lib/origami/graphics/text.rb', line 48 def scaling @scaling end |
#text_knockout ⇒ Object
Returns the value of attribute text_knockout.
51 52 53 |
# File 'lib/origami/graphics/text.rb', line 51 def text_knockout @text_knockout end |
#text_line_matrix ⇒ Object
Returns the value of attribute text_line_matrix.
53 54 55 |
# File 'lib/origami/graphics/text.rb', line 53 def text_line_matrix @text_line_matrix end |
#text_matrix ⇒ Object
Returns the value of attribute text_matrix.
53 54 55 |
# File 'lib/origami/graphics/text.rb', line 53 def text_matrix @text_matrix end |
#text_rendering_matrix ⇒ Object
Returns the value of attribute text_rendering_matrix.
53 54 55 |
# File 'lib/origami/graphics/text.rb', line 53 def text_rendering_matrix @text_rendering_matrix end |
#text_rise ⇒ Object
Returns the value of attribute text_rise.
51 52 53 |
# File 'lib/origami/graphics/text.rb', line 51 def text_rise @text_rise end |
#word_spacing ⇒ Object
Returns the value of attribute word_spacing.
48 49 50 |
# File 'lib/origami/graphics/text.rb', line 48 def word_spacing @word_spacing end |
Instance Method Details
#begin_text_object ⇒ Object
84 85 86 87 88 89 90 91 92 93 |
# File 'lib/origami/graphics/text.rb', line 84 def begin_text_object if is_in_text_object? raise TextStateError, "Cannot start a text object within an existing text object." end @text_object = true @text_matrix = @text_line_matrix = @text_rendering_matrix = Matrix.identity(3) end |
#end_text_object ⇒ Object
95 96 97 98 99 100 101 102 103 104 |
# File 'lib/origami/graphics/text.rb', line 95 def end_text_object unless is_in_text_object? raise TextStateError, "Cannot end text object : no previous text object has begun." end @text_object = false @text_matrix = @text_line_matrix = @text_rendering_matrix = nil end |
#is_in_text_object? ⇒ Boolean
80 81 82 |
# File 'lib/origami/graphics/text.rb', line 80 def is_in_text_object? @text_object end |
#reset ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/origami/graphics/text.rb', line 59 def reset @char_spacing = 0 @word_spacing = 0 @scaling = 100 @leading = 0 @font = nil @font_size = nil @rendering_mode = Rendering::FILL @text_rise = 0 @text_knockout = true # # Text objects # @text_object = false @text_matrix = @text_line_matrix = @text_rendering_matrix = nil end |