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

[const] bool !=( DText text )

Description: Inequality

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

[const] bool <( DText 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 ==( DText text )

Description: Equality

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

assign( DText 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] DText dup

Description: Creates a copy of self.

int font

Description: Get the font number

font=( int )

Description: Set the font number

[static] DText from_itext( Text double_text )

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

ref DText move( DPoint 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

DText moved( DPoint 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] DText new( string string, DTrans trans )
synonym: [static] DText new_st( string string, DTrans 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] DText new

Description: Default constructor

Creates a text with unit transformation and empty text.

[static] DText new( string string, DTrans trans, double height, int font )
synonym: [static] DText new_sthf( string string, DTrans trans, double 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] double size

Description: Get the text height

size=( double )

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 DTrans trans

Description: Get the transformation

trans=( DTrans )

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

[const] DText transformed( DTrans t )

Description: Transform the text with the given simple transformation

t:The transformation to apply
returns:The transformed text

[const] DText transformed_cplx( DCplxTrans t )

Description: Transform the text with the given complex transformation

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