16 #ifndef QGSTEXTRENDERER_H
17 #define QGSTEXTRENDERER_H
20 #include "qgis_core.h"
72 static HAlignment convertQtHAlignment( Qt::Alignment alignment );
91 static VAlignment convertQtVAlignment( Qt::Alignment alignment );
119 static void drawText(
const QRectF &rect,
double rotation, HAlignment alignment,
const QStringList &textLines,
121 bool drawAsOutlines =
true, VAlignment vAlignment = AlignTop );
136 static void drawText( QPointF point,
double rotation, HAlignment alignment,
const QStringList &textLines,
138 bool drawAsOutlines =
true );
158 Q_DECL_DEPRECATED
static void drawPart(
const QRectF &rect,
double rotation, HAlignment alignment,
const QStringList &textLines,
180 Q_DECL_DEPRECATED static
void drawPart( QPointF origin,
double rotation, HAlignment alignment, const QStringList &textLines,
206 QFontMetricsF *fontMetrics =
nullptr );
217 QFontMetricsF *fontMetrics =
nullptr );
251 bool useOrigin =
false;
253 double rotation = 0.0;
255 double rotationOffset = 0.0;
269 double pictureBuffer = 0.0;
271 double dpiRatio = 1.0;
276 double extraWordSpacing = 0;
278 double extraLetterSpacing = 0;
299 static void drawPart(
const QRectF &rect,
double rotation, HAlignment alignment, VAlignment vAlignment,
const QgsTextDocument &document,
317 static void drawPart( QPointF origin,
double rotation, HAlignment alignment,
const QgsTextDocument &document,
322 const Component &component,
330 DrawMode mode = Rect );
333 const Component &component,
337 const Component &component,
342 const Component &component,
345 static void drawTextInternal( TextPart drawType,
348 const Component &component,
350 const QFontMetricsF *fontMetrics,
351 HAlignment alignment,
352 VAlignment vAlignment,
353 DrawMode mode = Rect );
357 static void calculateExtraSpacingForLineJustification(
double spaceToDistribute,
const QgsTextBlock &block,
double &extraWordSpace,
double &extraLetterSpace );
358 static void applyExtraSpacingForLineJustification( QFont &font,
double extraWordSpace,
double extraLetterSpace );
364 const Component &component,
367 const QFontMetricsF *fontMetrics,
368 HAlignment hAlignment,
369 VAlignment vAlignment,
376 const Component &component,
379 const QFontMetricsF *fontMetrics,
380 HAlignment hAlignment,
381 VAlignment vAlignment,
387 friend class QgsLabelPreview;
Struct for storing maximum and minimum scales for measurements in map units.
Contains information about the context of a rendering operation.
Represents a block of text consisting of one or more QgsTextFragment objects.
Represents a document consisting of one or more QgsTextBlock objects.
Container for all settings relating to text rendering.
TextOrientation
Text orientation.
Handles rendering text using rich formatting options, including drop shadows, buffers and background ...
VAlignment
Vertical alignment.
@ AlignBottom
Align to bottom.
@ AlignVCenter
Center align.
TextPart
Components of text.
@ Buffer
Buffer component.
@ Background
Background shape.
HAlignment
Horizontal alignment.
@ AlignCenter
Center align.
@ AlignJustify
Justify align.
DrawMode
Draw mode to calculate width and height.
@ Point
Text at point of origin draw mode.
@ Label
Label-specific draw mode.
RenderUnit
Rendering size units.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define FONT_WORKAROUND_SCALE