Text Object

Updated 5 years ago

Represents a textual element of a score.

A new Text belonging to a score can be created with:
  text = new Text(score);
where score is a Score Object .

Currently, only 'staff text' elements can be added to a score (by moving a Cursor Object to the required point and using the Cursor.putStaffText(text) method).

See also:

Cursor Object , Score Object .

Properties

Name Type Description
color QColor the text foreground colour.
defaultFont QFont the font used to display the text. Hint: this may be set to 10 point Times with var font = new QFont("Times", 10); text.defaultFont = font;.
text string the text to display.
xOffset double the horizontal offset (in spaces*) from the default position of the text (positive: to the right, negative: to the left).
yOffset double the vertical offset (in spaces*) from the default position of the text (positive: down, negative: up).

* Note: "Spaces" is a relative measurement unique to music notation. One space unit is the vertical distance between two lines of a staff.
* Note: Due to a bug in the plugin framework, xOffset and yOffset are parsed as integers.

Methods

None.