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 );
120 static void drawText(
const QRectF &rect,
double rotation, HAlignment alignment,
const QStringList &textLines,
122 bool drawAsOutlines =
true, VAlignment vAlignment = AlignTop,
123 Qgis::TextRendererFlags flags = Qgis::TextRendererFlags() );
138 static void drawText( QPointF point,
double rotation, HAlignment alignment,
const QStringList &textLines,
140 bool drawAsOutlines =
true );
160 Q_DECL_DEPRECATED
static void drawPart(
const QRectF &rect,
double rotation, HAlignment alignment,
const QStringList &textLines,
182 Q_DECL_DEPRECATED static
void drawPart( QPointF origin,
double rotation, HAlignment alignment, const QStringList &textLines,
208 QFontMetricsF *fontMetrics =
nullptr );
221 QFontMetricsF *fontMetrics =
nullptr,
Qgis::TextRendererFlags flags =
Qgis::TextRendererFlags(),
double maxLineWidth = 0 );
271 bool useOrigin =
false;
273 double rotation = 0.0;
275 double rotationOffset = 0.0;
289 double pictureBuffer = 0.0;
291 double dpiRatio = 1.0;
296 double extraWordSpacing = 0;
298 double extraLetterSpacing = 0;
319 static void drawPart(
const QRectF &rect,
double rotation, HAlignment alignment, VAlignment vAlignment,
const QgsTextDocument &document,
337 static void drawPart( QPointF origin,
double rotation, HAlignment alignment,
const QgsTextDocument &document,
342 const Component &component,
350 DrawMode mode = Rect );
353 const Component &component,
357 const Component &component,
362 const Component &component,
365 static void drawTextInternal( TextPart drawType,
368 const Component &component,
370 const QFontMetricsF *fontMetrics,
371 HAlignment alignment,
372 VAlignment vAlignment,
373 DrawMode mode = Rect );
377 static void calculateExtraSpacingForLineJustification(
double spaceToDistribute,
const QgsTextBlock &block,
double &extraWordSpace,
double &extraLetterSpace );
378 static void applyExtraSpacingForLineJustification( QFont &font,
double extraWordSpace,
double extraLetterSpace );
384 const Component &component,
387 const QFontMetricsF *fontMetrics,
388 HAlignment hAlignment,
389 VAlignment vAlignment,
396 const Component &component,
399 const QFontMetricsF *fontMetrics,
400 HAlignment hAlignment,
401 VAlignment vAlignment,
407 friend class QgsLabelPreview;
The Qgis class provides global constants for use throughout the application.
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