mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-15 00:06:49 -05:00
81 lines
2.8 KiB
Plaintext
81 lines
2.8 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/textrenderer/qgstextdocumentmetrics.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsTextDocumentMetrics
|
|
{
|
|
%Docstring(signature="appended")
|
|
|
|
Contains pre-calculated metrics of a :py:class:`QgsTextDocument`.
|
|
|
|
.. warning::
|
|
|
|
This API is not considered stable and may change in future QGIS versions.
|
|
|
|
.. versionadded:: 3.28
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgstextdocumentmetrics.h"
|
|
%End
|
|
public:
|
|
|
|
static QgsTextDocumentMetrics calculateMetrics( const QgsTextDocument &document, const QgsTextFormat &format, const QgsRenderContext &context, double scaleFactor = 1.0 );
|
|
%Docstring
|
|
Returns precalculated text metrics for a text ``document``, when rendered using the
|
|
given base ``format`` and render ``context``.
|
|
|
|
The optional ``scaleFactor`` parameter can specify a font size scaling factor. It is recommended to set this to
|
|
:py:class:`QgsTextRenderer`.FONT_WORKAROUND_SCALE and then manually calculations
|
|
based on the resultant font metrics. Failure to do so will result in poor quality text rendering
|
|
at small font sizes.
|
|
%End
|
|
|
|
QSizeF documentSize( Qgis::TextLayoutMode mode ) const;
|
|
%Docstring
|
|
Returns the overall size of the document.
|
|
%End
|
|
|
|
double blockWidth( int blockIndex ) const;
|
|
%Docstring
|
|
Returns the width of the block at the specified index.
|
|
%End
|
|
|
|
double blockHeight( int blockIndex ) const;
|
|
%Docstring
|
|
Returns the height of the block at the specified index.
|
|
%End
|
|
|
|
double baselineOffset( int blockIndex, Qgis::TextLayoutMode mode ) const;
|
|
%Docstring
|
|
Returns the offset from the top of the document to the text baseline for the given block index.
|
|
%End
|
|
|
|
QFont fragmentFont( int blockIndex, int fragmentIndex ) const;
|
|
%Docstring
|
|
Returns the calculated font for the fragment at the specified block and fragment indices.
|
|
%End
|
|
|
|
double ascentOffset() const;
|
|
%Docstring
|
|
Returns the ascent offset of the first block in the document.
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/textrenderer/qgstextdocumentmetrics.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|