QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Public Member Functions | List of all members
QgsPrecalculatedTextMetrics Class Reference

Contains precalculated properties regarding text metrics for text to be renderered at a later stage. More...

#include <qgstextmetrics.h>

Public Member Functions

 QgsPrecalculatedTextMetrics (const QStringList &graphemes, double characterHeight, const QVector< double > &characterWidths)
 Constructor for QgsPrecalculatedTextMetrics. More...
 
double characterHeight () const
 Character height (actually font metrics height, not individual character height). More...
 
double characterWidth (int position) const
 Returns the width of the character at the specified position. More...
 
int count () const
 Returns the total number of characters. More...
 
QString grapheme (int index) const
 Returns the grapheme at the specified index. More...
 
QgsTextCharacterFormat graphemeFormat (int index) const
 Returns the character format for the grapheme at the specified index. More...
 
int graphemeFormatCount () const
 Returns the number of grapheme formats available. More...
 
QStringList graphemes () const
 Returns the list of graphemes contained in the text. More...
 
void setGraphemeFormats (const QVector< QgsTextCharacterFormat > &formats)
 Sets the character formats associated with the text graphemes(). More...
 

Detailed Description

Contains precalculated properties regarding text metrics for text to be renderered at a later stage.

Note
Not available in Python bindings
Since
QGIS 3.20

Definition at line 34 of file qgstextmetrics.h.

Constructor & Destructor Documentation

◆ QgsPrecalculatedTextMetrics()

QgsPrecalculatedTextMetrics::QgsPrecalculatedTextMetrics ( const QStringList &  graphemes,
double  characterHeight,
const QVector< double > &  characterWidths 
)
inline

Constructor for QgsPrecalculatedTextMetrics.

Parameters
graphemeslist of graphemes contained in the text
characterHeightheight of characters
characterWidthsvector of character widths

Definition at line 44 of file qgstextmetrics.h.

Member Function Documentation

◆ characterHeight()

double QgsPrecalculatedTextMetrics::characterHeight ( ) const
inline

Character height (actually font metrics height, not individual character height).

Definition at line 54 of file qgstextmetrics.h.

◆ characterWidth()

double QgsPrecalculatedTextMetrics::characterWidth ( int  position) const
inline

Returns the width of the character at the specified position.

Definition at line 64 of file qgstextmetrics.h.

◆ count()

int QgsPrecalculatedTextMetrics::count ( ) const
inline

Returns the total number of characters.

Definition at line 59 of file qgstextmetrics.h.

◆ grapheme()

QString QgsPrecalculatedTextMetrics::grapheme ( int  index) const
inline

Returns the grapheme at the specified index.

Definition at line 74 of file qgstextmetrics.h.

◆ graphemeFormat()

QgsTextCharacterFormat QgsPrecalculatedTextMetrics::graphemeFormat ( int  index) const
inline

Returns the character format for the grapheme at the specified index.

Definition at line 89 of file qgstextmetrics.h.

◆ graphemeFormatCount()

int QgsPrecalculatedTextMetrics::graphemeFormatCount ( ) const
inline

Returns the number of grapheme formats available.

Definition at line 84 of file qgstextmetrics.h.

◆ graphemes()

QStringList QgsPrecalculatedTextMetrics::graphemes ( ) const
inline

Returns the list of graphemes contained in the text.

Definition at line 69 of file qgstextmetrics.h.

◆ setGraphemeFormats()

void QgsPrecalculatedTextMetrics::setGraphemeFormats ( const QVector< QgsTextCharacterFormat > &  formats)
inline

Sets the character formats associated with the text graphemes().

Definition at line 79 of file qgstextmetrics.h.


The documentation for this class was generated from the following file: