Skip To Content ArcGIS for Developers Sign In Dashboard

TextSymbol Class

(Esri::ArcGISRuntime::TextSymbol)

A text marker symbol. More...

Header: #include <TextSymbol>
Since: Esri::ArcGISRuntime 100.0
Inherits: MarkerSymbol

Public Functions

TextSymbol(QObject *parent = nullptr)
TextSymbol(const QString &text, const QColor &color, float size, HorizontalAlignment hAlign, VerticalAlignment vAlign, QObject *parent = nullptr)
~TextSymbol()
QColor backgroundColor() const
QColor color() const
FontDecoration fontDecoration() const
QString fontFamily() const
FontStyle fontStyle() const
FontWeight fontWeight() const
QColor haloColor() const
float haloWidth() const
HorizontalAlignment horizontalAlignment() const
bool isKerningEnabled() const
QColor outlineColor() const
float outlineWidth() const
void setBackgroundColor(const QColor &backgroundColor)
void setColor(const QColor &color)
void setFontDecoration(FontDecoration fontDecoration)
void setFontFamily(const QString &fontFamily)
void setFontStyle(FontStyle fontStyle)
void setFontWeight(FontWeight fontWeight)
void setHaloColor(const QColor &haloColor)
void setHaloWidth(float haloWidth)
void setHorizontalAlignment(HorizontalAlignment hAlign)
void setKerningEnabled(bool kerningEnabled)
void setOutlineColor(const QColor &outlineColor)
void setOutlineWidth(float outlineWidth)
void setSize(float size)
void setText(const QString &text)
void setVerticalAlignment(VerticalAlignment vAlign)
float size() const
QString text() const
VerticalAlignment verticalAlignment() const

Additional Inherited Members

Detailed Description

A text marker symbol.

Symbols describe how graphics and features look on a map. Different symbols are used with different geometry types. Instances of this class represent text symbols used to display text for graphics and features. The graphic or feature can be based on any type of geometry - point, multipoint, polyline, or polygon.

Example:

Create a TextSymbol and apply it to a Graphic:

TextSymbol* textSymbol = new TextSymbol("Redlands", QColor(Qt::black), 12.0, HorizontalAlignment::Right, VerticalAlignment::Middle, this);
Point point(-117,34);
Graphic* graphic = new Graphic(point, textSymbol, this);

Member Function Documentation

TextSymbol::TextSymbol(QObject *parent = nullptr)

Default constructor with an optional parent.

TextSymbol::TextSymbol(const QString &text, const QColor &color, float size, HorizontalAlignment hAlign, VerticalAlignment vAlign, QObject *parent = nullptr)

Constructs a text symbol providing its text, color, size, hAlign, vAlign, and optional parent.

TextSymbol::~TextSymbol()

Destructor.

QColor TextSymbol::backgroundColor() const

Returns the color for the text symbol background.

See also setBackgroundColor().

QColor TextSymbol::color() const

Returns the color of the text.

See also setColor().

FontDecoration TextSymbol::fontDecoration() const

Returns the font decoration of the text.

See also setFontDecoration().

QString TextSymbol::fontFamily() const

Returns the font family for the text.

See also setFontFamily().

FontStyle TextSymbol::fontStyle() const

Returns the font style for the text.

See also setFontStyle().

FontWeight TextSymbol::fontWeight() const

Returns the font weight for the text.

See also setFontWeight().

QColor TextSymbol::haloColor() const

Gets the color of the halo.

See also setHaloColor().

float TextSymbol::haloWidth() const

Gets the width of the halo in device independent pixels (DIPs).

See also setHaloWidth().

HorizontalAlignment TextSymbol::horizontalAlignment() const

Returns the horizontal alignment for the text.

See also setHorizontalAlignment().

bool TextSymbol::isKerningEnabled() const

Returns whether kerning (visual adjustments to the spacing between characters in the text) is enabled.

The default value is false.

QColor TextSymbol::outlineColor() const

Gets the color of the outline.

See also setOutlineColor().

float TextSymbol::outlineWidth() const

Gets the width of the outline in device independent pixels (DIPs).

See also setOutlineWidth().

void TextSymbol::setBackgroundColor(const QColor &backgroundColor)

Sets the color for the text symbol background to backgroundColor.

See also backgroundColor().

void TextSymbol::setColor(const QColor &color)

Sets the color of the text.

See also color().

void TextSymbol::setFontDecoration(FontDecoration fontDecoration)

Sets the fontDecoration of the text.

See also fontDecoration().

void TextSymbol::setFontFamily(const QString &fontFamily)

Sets the fontFamily for the text.

See also fontFamily().

void TextSymbol::setFontStyle(FontStyle fontStyle)

Sets the fontStyle for the text.

See also fontStyle().

void TextSymbol::setFontWeight(FontWeight fontWeight)

Sets the fontWeight for the text.

See also fontWeight().

void TextSymbol::setHaloColor(const QColor &haloColor)

Sets the color of the halo to haloColor.

See also haloColor().

void TextSymbol::setHaloWidth(float haloWidth)

Sets the width of the outline in device independent pixels (DIPs) to haloWidth.

See also haloWidth().

void TextSymbol::setHorizontalAlignment(HorizontalAlignment hAlign)

Sets the hAlign for the text.

See also horizontalAlignment().

void TextSymbol::setKerningEnabled(bool kerningEnabled)

Sets whether kerning (visual adjustments to the spacing between characters in the text) is enabled to kerningEnabled.

The default value is false.

See also isKerningEnabled().

void TextSymbol::setOutlineColor(const QColor &outlineColor)

Sets the color of the outline to outlineColor.

See also outlineColor().

void TextSymbol::setOutlineWidth(float outlineWidth)

Sets the width of the outline in device independent pixels (DIPs) to outlineWidth.

See also outlineWidth().

void TextSymbol::setSize(float size)

Sets the size of the text in device independent pixels (DIPs).

See also size().

void TextSymbol::setText(const QString &text)

Sets the text to display for the symbol.

See also text().

void TextSymbol::setVerticalAlignment(VerticalAlignment vAlign)

Sets the vAlign for the text.

See also verticalAlignment().

float TextSymbol::size() const

Returns the size of the text in device independent pixels (DIPs).

See also setSize().

QString TextSymbol::text() const

Returns the text to display for the symbol.

See also setText().

VerticalAlignment TextSymbol::verticalAlignment() const

Returns the vertical alignment for the text.

See also setVerticalAlignment().


Feedback on this topic?