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,
449 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
522 double backgroundXOffset = 0;
524 double backgroundWidth = 0;
525 double extraWordSpace = 0;
526 double extraLetterSpace = 0;
531 struct DeferredRenderBlock
535 QVector< DeferredRenderFragment > fragments;
538 static QBrush createBrushForPath(
QgsRenderContext &context,
const QString &path );
540 static void renderBlockHorizontal(
const QgsTextBlock &block,
int blockIndex,
543 QPainter *painter,
bool forceRenderAsPaths,
544 double fontScale,
double extraWordSpace,
double extraLetterSpace,
546 DeferredRenderBlock *deferredRenderBlock );
548 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 );
549 static void renderDeferredBuffer(
QgsRenderContext &context,
const QgsTextFormat &format,
Qgis::TextComponents components,
const std::vector<DeferredRenderBlock> &deferredBlocks,
double fontScale,
const Component &component,
double rotation );
550 static void renderDeferredShadowForText(
QgsRenderContext &context,
const QgsTextFormat &format,
const std::vector<DeferredRenderBlock> &deferredBlocks,
double fontScale,
const Component &component,
double rotation );
551 static void renderDeferredText(
QgsRenderContext &context,
const std::vector<DeferredRenderBlock> &deferredBlocks,
bool usePathsForText,
double fontScale,
const Component &component,
double rotation );
554 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 ...