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;
390 #endif // QGSTEXTRENDERER_H