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