119 static void drawDocument(
const QRectF &rect,
145 bool drawAsOutlines =
true );
167 static void drawDocument( QPointF point,
188 static void drawTextOnLine(
const QPolygonF &line,
const QString &text,
190 double offsetAlongLine = 0,
double offsetFromLine = 0 );
204 static void drawDocumentOnLine(
const QPolygonF &line,
208 double offsetAlongLine = 0,
209 double offsetFromLine = 0 );
229 Q_DECL_DEPRECATED
static void drawPart(
const QRectF &rect,
double rotation,
Qgis::TextHorizontalAlignment alignment,
const QStringList &textLines,
251 Q_DECL_DEPRECATED
static void drawPart( QPointF origin,
double rotation,
Qgis::TextHorizontalAlignment alignment,
const QStringList &textLines,
277 QFontMetricsF *fontMetrics =
nullptr );
350 static constexpr double SUPERSCRIPT_SUBSCRIPT_FONT_SIZE_SCALING_FACTOR = 2.0 / 3.0;
363 int firstFragmentIndex = 0;
368 bool useOrigin =
false;
370 double rotation = 0.0;
372 double rotationOffset = 0.0;
386 double pictureBuffer = 0.0;
388 double dpiRatio = 1.0;
393 double extraWordSpacing = 0;
395 double extraLetterSpacing = 0;
445 const Component &component,
451 const Component &component,
457 const Component &component,
461 const Component &component,
467 const Component &component,
473 const Component &component,
482 static void calculateExtraSpacingForLineJustification(
double spaceToDistribute,
const QgsTextBlock &block,
double &extraWordSpace,
double &extraLetterSpace );
483 static void applyExtraSpacingForLineJustification( QFont &font,
double extraWordSpace,
double extraLetterSpace );
489 const Component &component,
501 const Component &component,
509 struct DeferredRenderFragment
524 double backgroundXOffset = 0;
526 double backgroundWidth = 0;
527 double extraWordSpace = 0;
528 double extraLetterSpace = 0;
533 struct DeferredRenderBlock
537 QVector< DeferredRenderFragment > fragments;
540 static QBrush createBrushForPath(
QgsRenderContext &context,
const QString &path );
542 static void renderBlockHorizontal(
const QgsTextBlock &block,
int blockIndex,
545 QPainter *painter,
bool forceRenderAsPaths,
546 double fontScale,
double extraWordSpace,
double extraLetterSpace,
548 DeferredRenderBlock *deferredRenderBlock );
550 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 );
551 static void renderDeferredBuffer(
QgsRenderContext &context,
const QgsTextFormat &format,
Qgis::TextComponents components,
const std::vector<DeferredRenderBlock> &deferredBlocks,
double fontScale,
const Component &component,
double rotation );
552 static void renderDeferredShadowForText(
QgsRenderContext &context,
const QgsTextFormat &format,
const std::vector<DeferredRenderBlock> &deferredBlocks,
double fontScale,
const Component &component,
double rotation );
553 static void renderDeferredText(
QgsRenderContext &context,
const std::vector<DeferredRenderBlock> &deferredBlocks,
bool usePathsForText,
double fontScale,
const Component &component,
double rotation );
556 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 ...