SDK
Text utilities

Functions

int SPI_TXT_length_text (const std::string &text, double textHeight, double textRatio, const std::string &fontName, double *length)
 Calculates the length of a text.
 
int SPI_TXT_frame_text (int mode, double *pt, double textHeight, double textRatio, double textAngle, double slantAngle, int adjust, const std::string &fontName, const std::string &text, double *boundingRect)
 Calculates the bounding rectangle of a text.
 

Detailed Description

Text utilities

Function Documentation

◆ SPI_TXT_frame_text()

int SPI_TXT_frame_text ( int mode,
double * pt,
double textHeight,
double textRatio,
double textAngle,
double slantAngle,
int adjust,
const std::string & fontName,
const std::string & text,
double * boundingRect )

Calculates the bounding rectangle of a text.

Version
4.4
Parameters
[in]modecreation mode of the rectangle
  • SPI_TEXT_NORMAL_FRAME exact box
  • SPI_TEXT_EXTEND_FRAME box increased by 20 percent
[in]ptuser position of the text
[in]textHeighttext height
[in]textRatiotext ratio
[in]textAngletext direction
[in]slantAngleitalic angle
[in]adjusttext attachment mode
[in]fontNametext font
[in]texttext
[out]boundingRectenclosing rectangle
Returns
SPI_YES, SPI_NO
ier := ICALL(SPI_TXT_frame_text,SPI_TEXT_NORMAL_FRAME,pt,8,0.4,45,0,1,
int SPI_TXT_frame_text(int mode, double *pt, double textHeight, double textRatio, double textAngle, double slantAngle, int adjust, const std::string &fontName, const std::string &text, double *boundingRect)
Calculates the bounding rectangle of a text.
Definition sp_txt01.c:79

◆ SPI_TXT_length_text()

int SPI_TXT_length_text ( const std::string & text,
double textHeight,
double textRatio,
const std::string & fontName,
double * length )

Calculates the length of a text.

Version
4.4
Parameters
[in]texttext to measure
[in]textHeighttext height
[in]textRatiotext ratio
[in]fontNametext font
[out]lengthtext length
Returns
SPI_YES, SPI_NO
ier := ICALL(SPI_TXT_length_text,'TOTO',8,0.4,'ARIAL',lng);
int SPI_TXT_length_text(const std::string &text, double textHeight, double textRatio, const std::string &fontName, double *length)
Calculates the length of a text.
Definition sp_txt01.c:41