Module: Prawn::Text::Formatted

Included in:
Prawn::Text
Defined in:
lib/prawn/text/formatted.rb,
lib/prawn/text/formatted/box.rb,
lib/prawn/text/formatted/wrap.rb,
lib/prawn/text/formatted/parser.rb,
lib/prawn/text/formatted/arranger.rb,
lib/prawn/text/formatted/fragment.rb,
lib/prawn/text/formatted/line_wrap.rb

Overview

Fancy pretty text.

Defined Under Namespace

Modules: Wrap Classes: Arranger, Box, Fragment, LineWrap, Parser

Stable API collapse

Instance Method Details

#formatted_text_box(array, options = {}) ⇒ Array<Hash>

Draws the requested formatted text into a box.

When the text overflows the rectangle shrink to fit or truncate the text. Text boxes are independent of the document y position.

Examples:

formatted_text_box([{ :text => "hello" },
                    { :text => "world",
                      :size => 24,
                      :styles => [:bold, :italic] }])

Raises:



73
74
75
# File 'lib/prawn/text/formatted.rb', line 73

def formatted_text_box(array, options = {})
  Text::Formatted::Box.new(array, options.merge(document: self)).render
end