Show / Hide Table of Contents

Class TextSymbol

Defines how text is displayed using characteristics such as font, size, color, and position.

Inheritance
System.Object
Symbol
MarkerSymbol
TextSymbol
Implements
System.ComponentModel.INotifyPropertyChanged
MarkerSymbol.Angle
MarkerSymbol.AngleAlignment
MarkerSymbol.LeaderOffsetX
MarkerSymbol.LeaderOffsetY
MarkerSymbol.OffsetX
MarkerSymbol.OffsetY
Symbol.PropertyChanged
Symbol.FromJson(String)
Symbol.ToJson()
Symbol.Clone()
Symbol.CreateSwatchAsync(Double)
Symbol.CreateSwatchAsync(Color, Double)
Symbol.CreateSwatchAsync(Int32, Int32, Single, Color, Geometry)
Symbol.CreateSwatchAsync(Int32, Int32, Double, Color)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Esri.ArcGISRuntime.Symbology
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class TextSymbol : MarkerSymbol, INotifyPropertyChanged
Remarks

To display text in a MapView or SceneView, create a TextSymbol. Specify whether a string or attribute value is displayed by the Text. Define the appearance and position of the text using Color, Size, FontStyle, or VerticalAlignment, for example. Position the text by applying it to a Graphic based on any type of geometry - point, multipoint, polyline, or polygon. Add the graphic to the Graphics collection and add the GraphicsOverlay to the MapView or SceneView collection of graphics overlays.

TextSymbol is also used to define the appearance of layer and grid based labels:

  • Layers such as FeatureLayer, ArcGISSceneLayer, or DynamicEntityLayer contain label definitions that specify how labels are displayed. You can use TextSymbol to define a label appearance within a scale range. To display these labels, add a collection of these label definitions to a layer.
  • MapView can display a coordinate system grid with specific label styles at different resolutions. You can define the appearance of these labels using SetTextSymbol(Int64, Symbol).

Constructors

Name Description
TextSymbol()

Initializes a new instance of the TextSymbol class with default values.

TextSymbol(String, Color, Double, HorizontalAlignment, VerticalAlignment)

Initializes a new instance of the TextSymbol class.

Properties

Name Description
BackgroundColor

Gets or sets the color for the text symbol background.

Color

Gets or sets the color for the text symbol.

FontDecoration

Gets or sets the type of font decoration for the text symbol.

FontFamily

Gets or sets the font family of the text symbol.

FontStyle

Gets or sets the font style of the text symbol.

FontWeight

Gets or sets the font weight of the text symbol.

HaloColor

Gets or sets the halo color for the text symbol.

HaloWidth

Gets or sets the size of the halo around the text symbol in device-independent pixels (DIPs).

HorizontalAlignment

Gets or sets the horizontal alignment of the text symbol relative to the symbol's mid-point.

KerningEnabled

Gets or sets a value indicating whether to adjust the spacing between individual characters in the text.

OutlineColor

Gets or sets the outline color for the text symbol.

OutlineWidth

Gets or sets the width of the text symbol outline in device-independent pixels (DIPs).

Size

Gets or sets the font size of the text symbol.

Text

Gets or sets the text of the text symbol.

VerticalAlignment

Gets or sets the vertical alignment of the text symbol relative to the symbol's mid-point location.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.8
.NET100.13 - 200.8
.NET Windows100.13 - 200.8
.NET Android200.0 - 200.8
.NET iOS200.0 - 200.8
.NET Framework100.0 - 200.8
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.8

Relevant samples

Display grid: Display coordinate system grids including Latitude/Longitude, MGRS, UTM and USNG on a map view. Also, toggle label visibility and change the color of grid lines and grid labels.
Offline routing: Solve a route on-the-fly using offline data.
Route around barriers: Find a route that reaches all stops without crossing any barriers.
In This Article
Back to top Copyright © 2022 Esri.