119 static void drawDocument(
const QRectF &rect,
145 bool drawAsOutlines =
true );
166 static void drawDocument( QPointF point,
186 static void drawTextOnLine(
const QPolygonF &line,
const QString &text,
188 double offsetAlongLine = 0,
double offsetFromLine = 0 );
202 static void drawDocumentOnLine(
const QPolygonF &line,
206 double offsetAlongLine = 0,
207 double offsetFromLine = 0 );
227 Q_DECL_DEPRECATED
static void drawPart(
const QRectF &rect,
double rotation,
Qgis::TextHorizontalAlignment alignment,
const QStringList &textLines,
249 Q_DECL_DEPRECATED
static void drawPart( QPointF origin,
double rotation,
Qgis::TextHorizontalAlignment alignment,
const QStringList &textLines,
275 QFontMetricsF *fontMetrics =
nullptr );
348 static constexpr double SUPERSCRIPT_SUBSCRIPT_FONT_SIZE_SCALING_FACTOR = 2.0 / 3.0;
361 int firstFragmentIndex = 0;
366 bool useOrigin =
false;
368 double rotation = 0.0;
370 double rotationOffset = 0.0;
384 double pictureBuffer = 0.0;
386 double dpiRatio = 1.0;
391 double extraWordSpacing = 0;
393 double extraLetterSpacing = 0;
443 const Component &component,
455 const Component &component,
459 const Component &component,
465 const Component &component,
471 const Component &component,
480 static void calculateExtraSpacingForLineJustification(
double spaceToDistribute,
const QgsTextBlock &block,
double &extraWordSpace,
double &extraLetterSpace );
481 static void applyExtraSpacingForLineJustification( QFont &font,
double extraWordSpace,
double extraLetterSpace );
487 const Component &component,
499 const Component &component,
507 struct DeferredRenderFragment
519 struct DeferredRenderBlock
523 QVector< DeferredRenderFragment > fragments;
526 static void renderBlockHorizontal(
const QgsTextBlock &block,
int blockIndex,
529 QPainter *painter,
bool forceRenderAsPaths,
530 double fontScale,
double extraWordSpace,
double extraLetterSpace,
532 DeferredRenderBlock *deferredRenderBlock );
533 static void renderDeferredBlocks(
QgsRenderContext &context,
const QgsTextFormat &format,
Qgis::TextComponents components,
const std::vector<DeferredRenderBlock> &deferredBlocks,
bool usePathsForText,
double fontScale,
const Component &component,
double rotation );
534 static void renderDeferredBuffer(
QgsRenderContext &context,
const QgsTextFormat &format,
Qgis::TextComponents components,
const std::vector<DeferredRenderBlock> &deferredBlocks,
double fontScale,
const Component &component,
double rotation );
535 static void renderDeferredShadowForText(
QgsRenderContext &context,
const QgsTextFormat &format,
const std::vector<DeferredRenderBlock> &deferredBlocks,
double fontScale,
const Component &component,
double rotation );
536 static void renderDeferredText(
QgsRenderContext &context,
const std::vector<DeferredRenderBlock> &deferredBlocks,
bool usePathsForText,
double fontScale,
const Component &component,
double rotation );
539 friend class QgsLabelPreview;
Contains information about the context of a rendering operation.
Represents a block of text consisting of one or more QgsTextFragment objects.
Contains pre-calculated metrics of a QgsTextDocument.
Represents a document consisting of one or more QgsTextBlock objects.
Handles rendering text using rich formatting options, including drop shadows, buffers and background ...