Class: Layout::FormattedText
Relationships | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Entity
|
|
Instance Chain:
self,
Entity
|
|
Inherits: |
Layout::Entity
|
Overview
A formatted text entity.
Constant Summary
-
ANCHOR_TYPE_BOTTOM_CENTER =
Constants
nil
-
ANCHOR_TYPE_BOTTOM_LEFT =
Stub value.
nil
-
ANCHOR_TYPE_BOTTOM_RIGHT =
Stub value.
nil
-
ANCHOR_TYPE_CENTER_CENTER =
Stub value.
nil
-
ANCHOR_TYPE_CENTER_LEFT =
Stub value.
nil
-
ANCHOR_TYPE_CENTER_RIGHT =
Stub value.
nil
-
ANCHOR_TYPE_TOP_CENTER =
Stub value.
nil
-
ANCHOR_TYPE_TOP_LEFT =
Stub value.
nil
-
ANCHOR_TYPE_TOP_RIGHT =
Stub value.
nil
-
GROW_MODE_BOUNDED =
Stub value.
nil
-
GROW_MODE_UNBOUNDED =
Stub value.
nil
Class Method Summary
-
.new(text, bounds) ⇒ Layout::FormattedText
constructor
The
#initialize
method creates a newFormattedText
. -
.new_from_file(path, bounds) ⇒ Layout::FormattedText
The .new_from_file method creates a new
FormattedText
from a text file.
Instance Attribute Summary
-
#grow_mode ⇒ Integer
rw
The #grow_mode method returns the mode for how the
FormattedText
sizes itself. -
#grow_mode=(grow_mode) ⇒ Integer
rw
The #grow_mode= method sets the mode for how the
FormattedText
sizes itself. -
#plain_text ⇒ String
rw
The #plain_text method returns the plain text representation of the
FormattedText
. -
#plain_text=(plain_text)
rw
The #plain_text= method sets the plain text representation of the
FormattedText
.
Entity
- Inherited
#locked= | The |
#locked? | The |
#on_shared_layer? | |
#style | |
#style= | |
#untransformed_bounds | The |
#untransformed_bounds= | The |
Instance Method Summary
-
#append_plain_text(plain_text, style)
The #append_plain_text method appends new text with a given style to the end of the existing plain text of the
FormattedText
. -
#apply_style(style, index = 0, length = length_to_end_of_text)
The #apply_style method sets the
Style
for the text starting at the given character index, and running for the given number of characters. -
#display_text(page = nil) ⇒ String
The #display_text method returns the display text representation of the
FormattedText
. -
#rtf ⇒ String
The #rtf method returns the raw RTF representation of the
FormattedText
. -
#rtf=(rtf_text)
The #rtf= method sets the raw RTF representation of the
FormattedText
. - #style(index = 0, length = 1) ⇒ Layout::Style
Entity
- Inherited
#== | The |
#bounds | The |
#document | |
#drawing_bounds | The |
#group | |
#layer_instance | The |
#move_to_group | |
#move_to_layer | |
#page | |
#transform! | The |
#transformation | The |
Constructor Details
.new(text, bounds) ⇒ FormattedText
.new(text, anchor_point, anchor_type) ⇒ FormattedText
FormattedText
.new(text, anchor_point, anchor_type) ⇒ FormattedText
The #initialize
method creates a new FormattedText
.
The anchor type can be one of the following values:
ANCHOR_TYPE_TOP_LEFT
ANCHOR_TYPE_CENTER_LEFT
ANCHOR_TYPE_BOTTOM_LEFT
ANCHOR_TYPE_TOP_RIGHT
ANCHOR_TYPE_CENTER_RIGHT
ANCHOR_TYPE_BOTTOM_RIGHT
ANCHOR_TYPE_TOP_CENTER
ANCHOR_TYPE_CENTER_CENTER
ANCHOR_TYPE_BOTTOM_CENTER
Class Method Details
.new_from_file(path, bounds) ⇒ FormattedText
.new_from_file(path, anchor_point, anchor_type) ⇒ FormattedText
FormattedText
.new_from_file(path, anchor_point, anchor_type) ⇒ FormattedText
The .new_from_file
method creates a new FormattedText
from a text file.
The anchor type can be one of the following values:
ANCHOR_TYPE_TOP_LEFT
ANCHOR_TYPE_CENTER_LEFT
ANCHOR_TYPE_BOTTOM_LEFT
ANCHOR_TYPE_TOP_RIGHT
ANCHOR_TYPE_CENTER_RIGHT
ANCHOR_TYPE_BOTTOM_RIGHT
ANCHOR_TYPE_TOP_CENTER
ANCHOR_TYPE_CENTER_CENTER
ANCHOR_TYPE_BOTTOM_CENTER
-
Layout::FormattedText::ANCHOR_TYPE_TOP_LEFT)
Instance Attribute Details
#grow_mode ⇒ Integer
(rw)
The #grow_mode
method returns the mode for how the FormattedText
sizes itself.
The grow mode can be one of the following values:
Layout::FormattedText::GROW_MODE_BOUNDED
Layout::FormattedText::GROW_MODE_UNBOUNDED
#grow_mode=(grow_mode) ⇒ Integer
(rw)
The #grow_mode=
method sets the mode for how the FormattedText
sizes itself.
The grow mode can be one of the following values:
Layout::FormattedText::GROW_MODE_BOUNDED
Layout::FormattedText::GROW_MODE_UNBOUNDED
#plain_text ⇒ String (rw)
The #plain_text
method returns the plain text representation of the FormattedText
.
#plain_text=(plain_text) (rw)
The #plain_text=
method sets the plain text representation of the FormattedText
.
Instance Method Details
#append_plain_text(plain_text, style)
This method does not support more than two different style runs in a single text string.
The #append_plain_text
method appends new text with a given style to the end of the existing plain text of the FormattedText
.
#apply_style(style, index = 0, length = length_to_end_of_text)
The #apply_style
method sets the Style
for the text starting at the given character index, and running for the given number of characters.
#display_text(page = nil) ⇒ String
Passing an invalid Page
will prevent an auto-text tag from being substituted with its display representation.
The #display_text
method returns the display text representation of the FormattedText
.
Layout::FormattedText::ANCHOR_TYPE_TOP_LEFT) doc.add_entity(text, doc.layers.first, doc.pages.first) text = text.display_text(doc.pages.first)
Passing an invalid Page
will prevent an auto-text tag from being substituted with its display representation.
The #rtf
method returns the raw RTF representation of the FormattedText
.
#rtf=(rtf_text)
The #rtf=
method sets the raw RTF representation of the FormattedText
.
text.par}“
#style(index = 0, length = 1) ⇒ Layout::Style
The #style
method returns a Style
for the text starting at the given character index, and running for the given length.