17 #ifndef QGSTEXTRENDERER_H 18 #define QGSTEXTRENDERER_H 21 #include "qgis_core.h" 25 #include <QSharedData> 28 #include <QDomElement> 31 class QgsTextBufferSettingsPrivate;
32 class QgsTextBackgroundSettingsPrivate;
33 class QgsTextShadowSettingsPrivate;
34 class QgsTextSettingsPrivate;
77 void setEnabled(
bool enabled );
92 void setSize(
double size );
130 QColor color()
const;
137 void setColor(
const QColor &color );
145 bool fillBufferInterior()
const;
153 void setFillBufferInterior(
bool fill );
160 double opacity()
const;
168 void setOpacity(
double opacity );
174 Qt::PenJoinStyle joinStyle()
const;
181 void setJoinStyle( Qt::PenJoinStyle style );
187 QPainter::CompositionMode blendMode()
const;
194 void setBlendMode( QPainter::CompositionMode mode );
206 void readXml(
const QDomElement &elem );
212 QDomElement writeXml( QDomDocument &doc )
const;
230 QSharedDataPointer<QgsTextBufferSettingsPrivate> d;
294 bool enabled()
const;
301 void setEnabled(
bool enabled );
320 QString svgFile()
const;
328 void setSvgFile(
const QString &file );
366 void setSize( QSizeF size );
424 double rotation()
const;
431 void setRotation(
double rotation );
439 QPointF offset()
const;
448 void setOffset( QPointF offset );
488 QSizeF radii()
const;
498 void setRadii( QSizeF radii );
537 double opacity()
const;
545 void setOpacity(
double opacity );
551 QPainter::CompositionMode blendMode()
const;
558 void setBlendMode( QPainter::CompositionMode mode );
565 QColor fillColor()
const;
573 void setFillColor(
const QColor &color );
580 QColor strokeColor()
const;
588 void setStrokeColor(
const QColor &color );
596 double strokeWidth()
const;
604 void setStrokeWidth(
double width );
642 Qt::PenJoinStyle joinStyle()
const;
649 void setJoinStyle( Qt::PenJoinStyle style );
685 QSharedDataPointer<QgsTextBackgroundSettingsPrivate> d;
728 bool enabled()
const;
735 void setEnabled(
bool enabled );
759 int offsetAngle()
const;
767 void setOffsetAngle(
int angle );
775 double offsetDistance()
const;
784 void setOffsetDistance(
double distance );
822 bool offsetGlobal()
const;
828 void setOffsetGlobal(
bool global );
835 double blurRadius()
const;
843 void setBlurRadius(
double blurRadius );
881 bool blurAlphaOnly()
const;
889 void setBlurAlphaOnly(
bool alphaOnly );
896 double opacity()
const;
904 void setOpacity(
double opacity );
917 void setScale(
int scale );
923 QColor color()
const;
930 void setColor(
const QColor &color );
936 QPainter::CompositionMode blendMode()
const;
943 void setBlendMode( QPainter::CompositionMode mode );
955 void readXml(
const QDomElement &elem );
961 QDomElement writeXml( QDomDocument &doc )
const;
965 QSharedDataPointer<QgsTextShadowSettingsPrivate> d;
1079 void setFont(
const QFont &font );
1086 QString namedStyle()
const;
1094 void setNamedStyle(
const QString &style );
1101 double size()
const;
1109 void setSize(
double size );
1148 QColor color()
const;
1155 void setColor(
const QColor &color );
1162 double opacity()
const;
1170 void setOpacity(
double opacity );
1176 QPainter::CompositionMode blendMode()
const;
1183 void setBlendMode( QPainter::CompositionMode mode );
1191 double lineHeight()
const;
1200 void setLineHeight(
double height );
1238 bool containsAdvancedEffects()
const;
1261 QString mTextFontFamily;
1262 bool mTextFontFound =
true;
1264 QSharedDataPointer<QgsTextSettingsPrivate> d;
1319 static void drawText(
const QRectF &rect,
double rotation,
HAlignment alignment,
const QStringList &textLines,
1321 bool drawAsOutlines =
true );
1335 static void drawText( QPointF point,
double rotation,
HAlignment alignment,
const QStringList &textLines,
1337 bool drawAsOutlines =
true );
1354 static void drawPart(
const QRectF &rect,
double rotation,
HAlignment alignment,
const QStringList &textLines,
1356 TextPart part,
bool drawAsOutlines =
true );
1373 static void drawPart( QPointF origin,
double rotation,
HAlignment alignment,
const QStringList &textLines,
1375 TextPart part,
bool drawAsOutlines =
true );
1393 bool useOrigin =
false;
1395 double rotation = 0.0;
1397 double rotationOffset = 0.0;
1411 double pictureBuffer = 0.0;
1413 double dpiRatio = 1.0;
1419 const Component &component,
1423 Component component,
1425 const QStringList &textLines,
1426 DrawMode mode = Rect );
1429 const Component &component,
1433 const Component &component,
1436 static void drawTextInternal(
TextPart drawType,
1439 const Component &component,
1440 const QStringList &textLines,
1441 const QFontMetricsF *fontMetrics,
1443 bool drawAsOutlines,
1444 DrawMode mode = Rect );
1447 friend class QgsLabelPreview;
1452 QFontMetricsF *fm =
nullptr );
1454 QFontMetricsF *fm =
nullptr );
1459 #endif // QGSTEXTRENDERER_H The class is used as a container of context for various read/write operations on other objects...
RotationType
Methods for determining the rotation of the background shape.
bool fontFound() const
Returns true if the specified font was found on the system, or false if the font was not found and a ...
QgsTextBackgroundSettings background() const
Returns a reference to the text background settings.
Draw shadow under buffer.
ShadowPlacement
Placement positions for text shadow.
QgsTextShadowSettings & shadow()
Returns a reference to the text drop shadow settings.
HAlignment
Horizontal alignment.
Base class for visual effects which can be applied to QPicture drawings.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
void setBackground(const QgsTextBackgroundSettings &backgroundSettings)
Sets the text's background settings.q.
Container for settings relating to a text background object.
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
QgsTextBackgroundSettings & background()
Returns a reference to the text background settings.
QgsTextBufferSettings & buffer()
Returns a reference to the text buffer settings.
SizeType
Methods for determining the background shape size.
QgsTextShadowSettings shadow() const
Returns a reference to the text drop shadow settings.
Handles rendering text using rich formatting options, including drop shadows, buffers and background ...
ShapeType
Background shape types.
TextPart
Components of text.
Contains information about the context of a rendering operation.
Shape rotation is offset from text rotation.
Struct for storing maximum and minimum scales for measurements in map units.
Container for settings relating to a text shadow.
Container for settings relating to a text buffer.
void setBuffer(const QgsTextBufferSettings &bufferSettings)
Sets the text's buffer settings.
void setShadow(const QgsTextShadowSettings &shadowSettings)
Sets the text's drop shadow settings.
Container for all settings relating to text rendering.
Represents a vector layer which manages a vector based data sets.
Square - buffered sizes only.
QgsTextBufferSettings buffer() const
Returns a reference to the text buffer settings.
RenderUnit
Rendering size units.
QString resolvedFontFamily() const
Returns the family for the resolved font, ie if the specified font was not found on the system this w...