QGIS API Documentation 3.29.0-Master (8c80f25a4f)
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, const QVector< double > &characterWidths, const QVector< double > &characterHeights, const QVector< double > &characterDescents)
 Constructor for QgsPrecalculatedTextMetrics. More...
 
double characterDescent (int position) const
 Returns the descent of the character at the specified position. More...
 
double characterHeight (int position) const
 Returns the character height of the character at the specified position (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...
 
double maximumCharacterDescent () const
 Returns the maximum descent of any character found in the text. More...
 
double maximumCharacterHeight () const
 Returns the maximum height of any character found 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,
const QVector< double > &  characterWidths,
const QVector< double > &  characterHeights,
const QVector< double > &  characterDescents 
)
inline

Constructor for QgsPrecalculatedTextMetrics.

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

Definition at line 45 of file qgstextmetrics.h.

Member Function Documentation

◆ characterDescent()

double QgsPrecalculatedTextMetrics::characterDescent ( int  position) const
inline

Returns the descent of the character at the specified position.

Since
QGIS 3.28

Definition at line 86 of file qgstextmetrics.h.

◆ characterHeight()

double QgsPrecalculatedTextMetrics::characterHeight ( int  position) const
inline

Returns the character height of the character at the specified position (actually font metrics height, not individual character height).

Since
QGIS 3.28

Definition at line 79 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 72 of file qgstextmetrics.h.

◆ count()

int QgsPrecalculatedTextMetrics::count ( ) const
inline

Returns the total number of characters.

Definition at line 67 of file qgstextmetrics.h.

◆ grapheme()

QString QgsPrecalculatedTextMetrics::grapheme ( int  index) const
inline

Returns the grapheme at the specified index.

Definition at line 110 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 125 of file qgstextmetrics.h.

◆ graphemeFormatCount()

int QgsPrecalculatedTextMetrics::graphemeFormatCount ( ) const
inline

Returns the number of grapheme formats available.

Definition at line 120 of file qgstextmetrics.h.

◆ graphemes()

QStringList QgsPrecalculatedTextMetrics::graphemes ( ) const
inline

Returns the list of graphemes contained in the text.

Definition at line 105 of file qgstextmetrics.h.

◆ maximumCharacterDescent()

double QgsPrecalculatedTextMetrics::maximumCharacterDescent ( ) const
inline

Returns the maximum descent of any character found in the text.

Since
QGIS 3.28

Definition at line 100 of file qgstextmetrics.h.

◆ maximumCharacterHeight()

double QgsPrecalculatedTextMetrics::maximumCharacterHeight ( ) const
inline

Returns the maximum height of any character found in the text.

Since
QGIS 3.28

Definition at line 93 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 115 of file qgstextmetrics.h.


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