Class RGhost::TextArea
In: textarea.rb
Parent: RGhost::PsObject

TextArea wraps the text so as the it fits in a box of a given width. Wrapping happens at whitespace characters without hyphenation. Additionally you can make use of predefined tag and the special tag <br/> to break row. The alignment can be left, right and centered.

PS: It not jumps pages.

Methods

new   ps  

Included Modules

RGhost::RubyToPs RGhost::ParseText

Constants

DEFAULT_OPTIONS = { :width => :area_x, :row_height => :row_height, :x=> :limit_left, :y=> :current_row, :text_align => :left

Public Class methods

Options

  • :x and :y - Initial position.
  • :row_height - Row height :)
  • :with - Max wide of the text
  • :text_align - Align of the text in the virtual box using :left, :right and :center.

Examples

 doc=RGhost::Document.new
 my_text="<font1>foo, bar, baz</font1><font2>qux, quux</font2>, corge, grault, garply, waldo, <font3>fred, plugh,</font3> xyzzy,<br/> thud, bing"
 doc.text_area my_text

 doc.text_area my_text, :width =>3

 doc.text_area my_text, :width =>3, :text_align => :center

 doc.text_area my_text, :width =>3, :text_align => :right

 doc.text_area my_text, :width =>3, :text_align => :right, :x => 3

 doc.text_area my_text, :width =>3, :text_align => :right, :x => 3, :row_height => 0.6

Public Instance methods

[Validate]