Text Functions

Functions to manage text objects, including appending, deleting, querying records, retrieving attributes, and getting the text origin.

MTK_Object_Text_AppendRecord()

Append a record (line) to a text object.

Signature
int MTK_Object_Text_AppendRecord(
    MTK_Object* obj, const char* record);
Parameters
  • obj: Pointer to an MTK_Object struct.
  • record: The record to append.
Return Value 0 on success; any other value indicates failure.

MTK_Object_Text_DeleteAllRecords()

Delete all records (lines) of a text object.

Signature
int MTK_Object_Text_DeleteAllRecords(MTK_Object* obj);
Parameters obj: Pointer to an MTK_Object struct.
Return Value 0 on success; any other value indicates failure.

MTK_Object_Text_DeleteRecord()

Delete a specific record (line) of a text object.

Signature
int MTK_Object_Text_DeleteRecord(
    MTK_Object* obj, const int& index);
Parameters
  • obj: Pointer to an MTK_Object struct.
  • index: Index of the record to delete.
Return Value 0 on success; any other value indicates failure.

MTK_Object_Text_GetAttributes()

Get the attributes of a text object.

Signature
int MTK_Object_Text_GetAttributes(
    MTK_Object* obj,
    char* font, char* scale, double* angle,
    double* height, double* width, int* boxed
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • font: Buffer to receive the font of the text.
  • scale: Buffer to receive the scale of the text.
  • angle: Angle of the text.
  • height: Height of the text.
  • width: Width of the text.
  • boxed: Whether the text is boxed.
Return Value 0 on success; any other value indicates failure.

MTK_Object_Text_GetOrigin()

Get the origin of a text object.

Signature
int MTK_Object_Text_GetOrigin(
    MTK_Object* obj,
    double* x, double* y, double* z
    );
Parameters
  • obj: Pointer to an MTK_Object struct.
  • x, y, z: Coordinates of the origin.
Return Value 0 on success; any other value indicates failure.