Class Text (version 0.18)

Description: A text object

A text object has a point (location), a text, a text transformation, a text size and a font id. Text size and font id are provided to be be able to render the text correctly.

Class overview

Index

Method Overview

[static] Text from_dtext( DText double_text )Construct an integer coordinate text object from a floating-point coordinate text
[const] Text transformed_cplx( ICplxTrans t )Transform the text with the given complex transformation
[static] Text newDefault constructor
[static] Text new( string string, Trans trans )Constructor with string and transformation
[static] Text new( string string, Trans trans, int height, int font )Constructor with string, transformation, text height and font
string=( string )Assign a text string to this object
[const] string stringGet the text string
trans=( Trans )Assign a transformation (text position and orientation) to this object
[const] const ref Trans transGet the transformation
size=( int )Set the text height of this object
[const] int sizeGet the text height
font=( int )Set the font number
int fontGet the font number
ref Text move( Point distance )Moves the text by a certain distance
Text moved( Point distance )Returns the text moved by a certain distance
[const] Text transformed( Trans t )Transform the text with the given simple transformation
[const] DText transformed_cplx( CplxTrans t )Transform the text with the given complex transformation
[const] bool <( Text t )Less operator
[const] bool ==( Text text )Equality
[const] bool !=( Text text )Inequality
[const] string to_sConvert to a string
assign( Text other )Assign the contents of another object to self
[const] Text dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] bool !=( Text text )

Description: Inequality

Return true, if this text object and the given text are not equal

[const] bool <( Text t )

Description: Less operator

This operator is provided to establish some, not necessarily a certain sorting order

t:The object to compare against

[const] bool ==( Text text )

Description: Equality

Return true, if this text object and the given text are equal

assign( Text other )

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed

Description: Tell, if the object was destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] Text dup

Description: Creates a copy of self.

int font

Description: Get the font number

font=( int )

Description: Set the font number

[static] Text from_dtext( DText double_text )

Description: Construct an integer coordinate text object from a floating-point coordinate text

ref Text move( Point distance )

Description: Moves the text by a certain distance

Moves the text by a given offset and returns the moved text. Does not check for coordinate overflows.

p:The offset to move the text.
returns:A reference to this text object

Text moved( Point distance )

Description: Returns the text moved by a certain distance

Moves the text by a given offset and returns the moved text. Does not modify *this. Does not check for coordinate overflows.

p:The offset to move the text.
returns:The moved text.

[static] Text new

Description: Default constructor

Creates a text with unit transformation and empty text.

[static] Text new( string string, Trans trans )
synonym: [static] Text new_st( string string, Trans trans )

Description: Constructor with string and transformation

A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object.

[static] Text new( string string, Trans trans, int height, int font )
synonym: [static] Text new_sthf( string string, Trans trans, int height, int font )

Description: Constructor with string, transformation, text height and font

A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified.

[const] int size

Description: Get the text height

size=( int )

Description: Set the text height of this object

[const] string string

Description: Get the text string

string=( string )

Description: Assign a text string to this object

[const] string to_s

Description: Convert to a string

[const] const ref Trans trans

Description: Get the transformation

trans=( Trans )

Description: Assign a transformation (text position and orientation) to this object

[const] Text transformed( Trans t )

Description: Transform the text with the given simple transformation

t:The transformation to apply
returns:The transformed text

[const] Text transformed_cplx( ICplxTrans t )

Description: Transform the text with the given complex transformation

This method has been introduced in version 0.18.

t:The magnifying transformation to apply
returns:The transformed text (in this case an integer coordinate object now)

[const] DText transformed_cplx( CplxTrans t )

Description: Transform the text with the given complex transformation

t:The magnifying transformation to apply
returns:The transformed text (a DText now)