Class: Pdfrb::Content::GraphicsState::TextState
- Inherits:
-
Object
- Object
- Pdfrb::Content::GraphicsState::TextState
- Defined in:
- lib/pdfrb/content/graphics_state.rb
Overview
Text-specific sub-state (s9.3). Composed in GraphicsState.
Instance Attribute Summary collapse
-
#char_spacing ⇒ Object
readonly
Returns the value of attribute char_spacing.
-
#font_name ⇒ Object
readonly
Returns the value of attribute font_name.
-
#font_size ⇒ Object
readonly
Returns the value of attribute font_size.
-
#horizontal_scaling ⇒ Object
readonly
Returns the value of attribute horizontal_scaling.
-
#leading ⇒ Object
readonly
Returns the value of attribute leading.
-
#line_matrix ⇒ Object
readonly
Returns the value of attribute line_matrix.
-
#rendering_mode ⇒ Object
readonly
Returns the value of attribute rendering_mode.
-
#rise ⇒ Object
readonly
Returns the value of attribute rise.
-
#text_matrix ⇒ Object
readonly
Returns the value of attribute text_matrix.
-
#word_spacing ⇒ Object
readonly
Returns the value of attribute word_spacing.
Instance Method Summary collapse
-
#initialize(char_spacing: 0.0, word_spacing: 0.0, horizontal_scaling: 100.0, leading: 0.0, font_name: nil, font_size: 0.0, rendering_mode: 0, rise: 0.0, text_matrix: Pdfrb::Model::Matrix.identity, line_matrix: Pdfrb::Model::Matrix.identity) ⇒ TextState
constructor
A new instance of TextState.
- #to_h ⇒ Object
- #with(**overrides) ⇒ Object
Constructor Details
#initialize(char_spacing: 0.0, word_spacing: 0.0, horizontal_scaling: 100.0, leading: 0.0, font_name: nil, font_size: 0.0, rendering_mode: 0, rise: 0.0, text_matrix: Pdfrb::Model::Matrix.identity, line_matrix: Pdfrb::Model::Matrix.identity) ⇒ TextState
Returns a new instance of TextState.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/pdfrb/content/graphics_state.rb', line 70 def initialize(char_spacing: 0.0, word_spacing: 0.0, horizontal_scaling: 100.0, leading: 0.0, font_name: nil, font_size: 0.0, rendering_mode: 0, rise: 0.0, text_matrix: Pdfrb::Model::Matrix.identity, line_matrix: Pdfrb::Model::Matrix.identity) @char_spacing = char_spacing.to_f @word_spacing = word_spacing.to_f @horizontal_scaling = horizontal_scaling.to_f @leading = leading.to_f @font_name = font_name @font_size = font_size.to_f @rendering_mode = rendering_mode.to_i @rise = rise.to_f @text_matrix = text_matrix @line_matrix = line_matrix end |
Instance Attribute Details
#char_spacing ⇒ Object (readonly)
Returns the value of attribute char_spacing.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def char_spacing @char_spacing end |
#font_name ⇒ Object (readonly)
Returns the value of attribute font_name.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def font_name @font_name end |
#font_size ⇒ Object (readonly)
Returns the value of attribute font_size.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def font_size @font_size end |
#horizontal_scaling ⇒ Object (readonly)
Returns the value of attribute horizontal_scaling.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def horizontal_scaling @horizontal_scaling end |
#leading ⇒ Object (readonly)
Returns the value of attribute leading.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def leading @leading end |
#line_matrix ⇒ Object (readonly)
Returns the value of attribute line_matrix.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def line_matrix @line_matrix end |
#rendering_mode ⇒ Object (readonly)
Returns the value of attribute rendering_mode.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def rendering_mode @rendering_mode end |
#rise ⇒ Object (readonly)
Returns the value of attribute rise.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def rise @rise end |
#text_matrix ⇒ Object (readonly)
Returns the value of attribute text_matrix.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def text_matrix @text_matrix end |
#word_spacing ⇒ Object (readonly)
Returns the value of attribute word_spacing.
66 67 68 |
# File 'lib/pdfrb/content/graphics_state.rb', line 66 def word_spacing @word_spacing end |
Instance Method Details
#to_h ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/pdfrb/content/graphics_state.rb', line 92 def to_h { char_spacing: @char_spacing, word_spacing: @word_spacing, horizontal_scaling: @horizontal_scaling, leading: @leading, font_name: @font_name, font_size: @font_size, rendering_mode: @rendering_mode, rise: @rise, text_matrix: @text_matrix, line_matrix: @line_matrix } end |