Module: Prawn::Core::Text
- Included in:
- Text
- Defined in:
- lib/prawn/core/text.rb
Overview
:nodoc:
Constant Summary collapse
- VALID_OPTIONS =
These should be used as a base. Extensions may build on this list
[:kerning, :size, :style]
Instance Attribute Summary collapse
-
#skip_encoding ⇒ Object
readonly
Returns the value of attribute skip_encoding.
-
#text_options ⇒ Object
readonly
Returns the value of attribute text_options.
Instance Method Summary collapse
-
#draw_text!(text, options) ⇒ Object
Low level text placement method.
-
#process_text_options(options) ⇒ Object
Low level call to set the current font style and extract text options from an options hash.
Instance Attribute Details
#skip_encoding ⇒ Object (readonly)
Returns the value of attribute skip_encoding.
20 21 22 |
# File 'lib/prawn/core/text.rb', line 20 def skip_encoding @skip_encoding end |
#text_options ⇒ Object (readonly)
Returns the value of attribute text_options.
19 20 21 |
# File 'lib/prawn/core/text.rb', line 19 def @text_options end |
Instance Method Details
#draw_text!(text, options) ⇒ Object
Low level text placement method. All font and size alterations should already be set
25 26 27 28 |
# File 'lib/prawn/core/text.rb', line 25 def draw_text!(text, ) x,y = map_to_absolute([:at]) add_text_content(text,x,y,) end |
#process_text_options(options) ⇒ Object
Low level call to set the current font style and extract text options from an options hash. Should be called from within a save_font block
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/prawn/core/text.rb', line 33 def () if [:style] raise "Bad font family" unless font.family font(font.family, :style => [:style]) end # must compare against false to keep kerning on as default unless [:kerning] == false [:kerning] = font.has_kerning_data? end [:size] ||= font_size end |