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,
329 DrawMode mode = Rect );
332 const Component &component,
336 const Component &component,
340 const Component &component,
343 static void drawTextInternal( TextPart drawType,
346 const Component &component,
348 const QFontMetricsF *fontMetrics,
349 HAlignment alignment,
350 VAlignment vAlignment,
351 DrawMode mode = Rect );
355 static void calculateExtraSpacingForLineJustification(
double spaceToDistribute,
const QgsTextBlock &block,
double &extraWordSpace,
double &extraLetterSpace );
356 static void applyExtraSpacingForLineJustification( QFont &font,
double extraWordSpace,
double extraLetterSpace );
362 const Component &component,
365 const QFontMetricsF *fontMetrics,
366 HAlignment hAlignment,
367 VAlignment vAlignment,
374 const Component &component,
377 const QFontMetricsF *fontMetrics,
378 HAlignment hAlignment,
379 VAlignment vAlignment,
383 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