Notation used in Ruby API documentation
Module: db
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. Text objects are used as labels (i.e. for pins) or to indicate a particular position.
The DText class uses floating-point coordinates. A class that operates with integer coordinates is Text.
See The Database API for more details about the database objects.
new DText ptr | new | (const Text Text) | Creates a floating-point coordinate text from an integer coordinate text |
new DText ptr | new | Default constructor | |
new DText ptr | new | (string string, const DTrans trans) | Constructor with string and transformation |
new DText ptr | new | (string string, double x, double y) | Constructor with string and location |
new DText ptr | new | (string string, const DTrans trans, double height, int font) | Constructor with string, transformation, text height and font |
[const] | bool | != | (const DText text) | Inequality |
[const] | bool | < | (const DText t) | Less operator |
[const] | bool | == | (const DText text) | Equality |
[const] | DText ptr | _const_cast | Returns a non-const reference to self. | |
void | _create | Ensures the C++ object is created | ||
void | _destroy | Explicitly destroys the object | ||
[const] | bool | _destroyed? | Returns a value indicating whether the object was already destroyed | |
[const] | bool | _is_const_object? | Returns a value indicating whether the reference is a const reference | |
void | _manage | Marks the object as managed by the script side. | ||
void | _unmanage | Marks the object as no longer owned by the script side. | ||
void | assign | (const DText other) | Assigns another object to self | |
[const] | DBox | bbox | Gets the bounding box of the text | |
[const] | new DText ptr | dup | Creates a copy of self | |
[const] | int | font | Gets the font number | |
void | font= | (int f) | Sets the font number | |
[const] | HAlign | halign | Gets the horizontal alignment | |
void | halign= | (HAlign a) | Sets the horizontal alignment | |
[const] | unsigned long | hash | Computes a hash value | |
DText | move | (const DVector distance) | Moves the text by a certain distance (modifies self) | |
DText | move | (double dx, double dy) | Moves the text by a certain distance (modifies self) | |
[const] | DText | moved | (const DVector distance) | Returns the text moved by a certain distance (does not modify self) |
[const] | DText | moved | (double dx, double dy) | Returns the text moved by a certain distance (does not modify self) |
[const] | DPoint | position | Gets the position of the text | |
[const] | double | size | Gets the text height | |
void | size= | (double s) | Sets the text height of this object | |
[const] | string | string | Get the text string | |
void | string= | (string text) | Assign a text string to this object | |
[const] | Text | to_itype | (double dbu = 1) | Converts the text to an integer coordinate text |
[const] | string | to_s | (double dbu = 0) | Converts the object to a string. |
[const] | DTrans | trans | Gets the transformation | |
void | trans= | (const DTrans t) | Assign a transformation (text position and orientation) to this object | |
[const] | Text | transformed | (const VCplxTrans t) | Transforms the text with the given complex transformation |
[const] | DText | transformed | (const DTrans t) | Transforms the text with the given simple transformation |
[const] | DText | transformed | (const DCplxTrans t) | Transforms the text with the given complex transformation |
[const] | VAlign | valign | Gets the vertical alignment | |
void | valign= | (VAlign a) | Sets the vertical alignment | |
[const] | double | x | Gets the x location of the text | |
void | x= | (double x) | Sets the x location of the text | |
[const] | double | y | Gets the y location of the text | |
void | y= | (double y) | Sets the y location of the text |
[static,const] | HAlign | HAlignCenter | Centered horizontal alignment | |
[static,const] | HAlign | HAlignLeft | Left horizontal alignment | |
[static,const] | HAlign | HAlignRight | Right horizontal alignment | |
[static,const] | HAlign | NoHAlign | Undefined horizontal alignment | |
[static,const] | VAlign | NoVAlign | Undefined vertical alignment | |
[static,const] | VAlign | VAlignBottom | Bottom vertical alignment | |
[static,const] | VAlign | VAlignCenter | Centered vertical alignment | |
[static,const] | VAlign | VAlignTop | Top vertical alignment | |
new DText ptr | from_s | (string s) | Creates an object from a string |
void | create | Use of this method is deprecated. Use _create instead | ||
void | destroy | Use of this method is deprecated. Use _destroy instead | ||
[const] | bool | destroyed? | Use of this method is deprecated. Use _destroyed? instead | |
void | halign= | (int a) | Use of this method is deprecated | |
[const] | bool | is_const_object? | Use of this method is deprecated. Use _is_const_object? instead | |
void | valign= | (int a) | Use of this method is deprecated |
!= | Signature: [const] bool != (const DText text) Description: Inequality Return true, if this text object and the given text are not equal | |||||
< | Signature: [const] bool < (const DText t) Description: Less operator
This operator is provided to establish some, not necessarily a certain sorting order | |||||
== | Signature: [const] bool == (const DText text) Description: Equality Return true, if this text object and the given text are equal | |||||
HAlignCenter | Signature: [static,const] HAlign HAlignCenter Description: Centered horizontal alignment Python specific notes: | |||||
HAlignLeft | Signature: [static,const] HAlign HAlignLeft Description: Left horizontal alignment Python specific notes: | |||||
HAlignRight | Signature: [static,const] HAlign HAlignRight Description: Right horizontal alignment Python specific notes: | |||||
NoHAlign | Signature: [static,const] HAlign NoHAlign Description: Undefined horizontal alignment Python specific notes: | |||||
NoVAlign | Signature: [static,const] VAlign NoVAlign Description: Undefined vertical alignment Python specific notes: | |||||
VAlignBottom | Signature: [static,const] VAlign VAlignBottom Description: Bottom vertical alignment Python specific notes: | |||||
VAlignCenter | Signature: [static,const] VAlign VAlignCenter Description: Centered vertical alignment Python specific notes: | |||||
VAlignTop | Signature: [static,const] VAlign VAlignTop Description: Top vertical alignment Python specific notes: | |||||
_const_cast | Signature: [const] DText ptr _const_cast Description: Returns a non-const reference to self. Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects. This method has been introduced in version 0.29.6. | |||||
_create | Signature: void _create Description: Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. | |||||
_destroy | Signature: void _destroy Description: Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. | |||||
_destroyed? | Signature: [const] bool _destroyed? Description: Returns a value indicating whether the object was already 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. | |||||
_is_const_object? | Signature: [const] bool _is_const_object? Description: Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. | |||||
_manage | Signature: void _manage Description: Marks the object as managed by the script side. After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. Usually it's not required to call this method. It has been introduced in version 0.24. | |||||
_unmanage | Signature: void _unmanage Description: Marks the object as no longer owned by the script side. Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. Usually it's not required to call this method. It has been introduced in version 0.24. | |||||
assign | Signature: void assign (const DText other) Description: Assigns another object to self | |||||
bbox | Signature: [const] DBox bbox Description: Gets the bounding box of the text The bounding box of the text is a single point - the location of the text. Both points of the box are identical. This method has been added in version 0.28. | |||||
create | Signature: void create Description: Ensures the C++ object is created Use of this method is deprecated. Use _create instead Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. | |||||
destroy | Signature: void destroy Description: Explicitly destroys the object Use of this method is deprecated. Use _destroy instead Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. | |||||
destroyed? | Signature: [const] bool destroyed? Description: Returns a value indicating whether the object was already destroyed Use of this method is deprecated. Use _destroyed? instead 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. | |||||
dup | Signature: [const] new DText ptr dup Description: Creates a copy of self Python specific notes: | |||||
font | Signature: [const] int font Description: Gets the font number See font= for a description of this property. Python specific notes: | |||||
font= | Signature: void font= (int f) Description: Sets the font number The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects. Python specific notes: | |||||
from_s | Signature: [static] new DText ptr from_s (string s) Description: Creates an object from a string Creates the object from a string representation (as returned by to_s) This method has been added in version 0.23. | |||||
halign | Signature: [const] HAlign halign Description: Gets the horizontal alignment See halign= for a description of this property. Python specific notes: | |||||
halign= | (1) Signature: void halign= (int a) Description: Sets the horizontal alignment Use of this method is deprecated This is the version accepting integer values. It's provided for backward compatibility. Python specific notes: | |||||
(2) Signature: void halign= (HAlign a) Description: Sets the horizontal alignment This property specifies how the text is aligned relative to the anchor point. This property has been introduced in version 0.22 and extended to enums in 0.28. Python specific notes: | ||||||
hash | Signature: [const] unsigned long hash Description: Computes a hash value Returns a hash value for the given text object. This method enables texts as hash keys. This method has been introduced in version 0.25. Python specific notes: | |||||
is_const_object? | Signature: [const] bool is_const_object? Description: Returns a value indicating whether the reference is a const reference Use of this method is deprecated. Use _is_const_object? instead This method returns true, if self is a const reference. In that case, only const methods may be called on self. | |||||
move | (1) Signature: DText move (const DVector distance) Description: Moves the text by a certain distance (modifies self)
Moves the text by a given offset and returns the moved text. Does not check for coordinate overflows. | |||||
(2) Signature: DText move (double dx, double dy) Description: Moves the text by a certain distance (modifies self)
Moves the text by a given distance in x and y direction and returns the moved text. Does not check for coordinate overflows. This method was introduced in version 0.23. | ||||||
moved | (1) Signature: [const] DText moved (const DVector distance) Description: Returns the text moved by a certain distance (does not modify self)
Moves the text by a given offset and returns the moved text. Does not modify *this. Does not check for coordinate overflows. | |||||
(2) Signature: [const] DText moved (double dx, double dy) Description: Returns the text moved by a certain distance (does not modify self)
Moves the text by a given offset and returns the moved text. Does not modify *this. Does not check for coordinate overflows. This method was introduced in version 0.23. | ||||||
new | (1) Signature: [static] new DText ptr new (const Text Text) Description: Creates a floating-point coordinate text from an integer coordinate text This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. Python specific notes: | |||||
(2) Signature: [static] new DText ptr new Description: Default constructor Creates a text with unit transformation and empty text. Python specific notes: | ||||||
(3) Signature: [static] new DText ptr new (string string, const 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. Python specific notes: | ||||||
(4) Signature: [static] new DText ptr new (string string, double x, double y) Description: Constructor with string and location A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. This method has been introduced in version 0.23. Python specific notes: | ||||||
(5) Signature: [static] new DText ptr new (string string, const 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. Python specific notes: | ||||||
position | Signature: [const] DPoint position Description: Gets the position of the text This convenience method has been added in version 0.28. | |||||
size | Signature: [const] double size Description: Gets the text height Python specific notes: | |||||
size= | Signature: void size= (double s) Description: Sets the text height of this object Python specific notes: | |||||
string | Signature: [const] string string Description: Get the text string Python specific notes: | |||||
string= | Signature: void string= (string text) Description: Assign a text string to this object Python specific notes: | |||||
to_itype | Signature: [const] Text to_itype (double dbu = 1) Description: Converts the text to an integer coordinate text The database unit can be specified to translate the floating-point coordinate Text in micron units to an integer-coordinate text in database units. The text's coordinates will be divided by the database unit. This method has been introduced in version 0.25. | |||||
to_s | Signature: [const] string to_s (double dbu = 0) Description: Converts the object to a string. If a DBU is given, the output units will be micrometers. The DBU argument has been added in version 0.27.6. Python specific notes: | |||||
trans | Signature: [const] DTrans trans Description: Gets the transformation Python specific notes: | |||||
trans= | Signature: void trans= (const DTrans t) Description: Assign a transformation (text position and orientation) to this object Python specific notes: | |||||
transformed | (1) Signature: [const] Text transformed (const VCplxTrans t) Description: Transforms the text with the given complex transformation
This method has been introduced in version 0.25. | |||||
(2) Signature: [const] DText transformed (const DTrans t) Description: Transforms the text with the given simple transformation
| ||||||
(3) Signature: [const] DText transformed (const DCplxTrans t) Description: Transforms the text with the given complex transformation
| ||||||
valign | Signature: [const] VAlign valign Description: Gets the vertical alignment See valign= for a description of this property. Python specific notes: | |||||
valign= | (1) Signature: void valign= (int a) Description: Sets the vertical alignment Use of this method is deprecated This is the version accepting integer values. It's provided for backward compatibility. Python specific notes: | |||||
(2) Signature: void valign= (VAlign a) Description: Sets the vertical alignment This property specifies how the text is aligned relative to the anchor point. This property has been introduced in version 0.22 and extended to enums in 0.28. Python specific notes: | ||||||
x | Signature: [const] double x Description: Gets the x location of the text This method has been introduced in version 0.23. Python specific notes: | |||||
x= | Signature: void x= (double x) Description: Sets the x location of the text This method has been introduced in version 0.23. Python specific notes: | |||||
y | Signature: [const] double y Description: Gets the y location of the text This method has been introduced in version 0.23. Python specific notes: | |||||
y= | Signature: void y= (double y) Description: Sets the y location of the text This method has been introduced in version 0.23. Python specific notes: |