The font used to display text symbols added to the graphics layer.
Known Limitations
This class is not fully supported in 3D SceneViews.
var textSymbol = new TextSymbol({
color: "white",
haloColor: "black",
haloSize: "1px",
text: "You are here",
xoffset: 3,
yoffset: 3,
font: { // autocast as esri/symbols/Font
size: 12,
family: "sans-serif",
weight: "bolder"
}
});
Constructors
new Font(properties)
properties Object See the properties for a list of all the properties that may be passed into the constructor. |
Property Overview
Name | Type | Summary | |
---|---|---|---|
String | The name of the class. more details | more details | |
String | The text decoration. more details | more details | |
String | The font family of the text. more details | more details | |
Number | The font size in points. more details | more details | |
String | The text style. more details | more details | |
String | The text variant. more details | more details | |
String | The text weight. more details | more details |
Property Details
declaredClassStringreadonly
The name of the class. The declared class name is formatted as
esri.folder.className
.decorationString
The text decoration.
Possible Values: underline | line-through | none
Known Limitations
This property is not supported in 3D SceneViews.
Default Value: nonefamilyString
The font family of the text.
- See also:
Default Value: serifThe font size in points. This value may be autocast with a string expressing size in points or pixels (e.g.
12px
).- See also:
Default Value: 9Examples:// size in points symbol.size = 14;
// size in pixels symbol.size = "20px";
// size in points symbol.size = "14pt";
styleString
The text style.
Possible Values: normal | italic | oblique
- See also:
Default Value: normalvariantString
The text variant.
Possible Values: normal | small-caps
Known Limitations
This property is not supported in 3D SceneViews.
- See also:
Default Value: normalweightString
The text weight.
Possible Values: normal | bold | bolder | lighter
- See also:
Default Value: normal
Method Overview
Name | Return Type | Summary | |
---|---|---|---|
Font | Creates a deep clone of the font object. more details | more details | |
* | Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. more details | more details | |
Object | Converts an instance of this class to its ArcGIS Portal JSON representation. more details | more details |
Method Details
clone(){Font}
Creates a deep clone of the font object.
Returns:Type Description Font A deep clone of the object that invoked this method. fromJSON(json){*}static
Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input
json
parameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameter:json ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
Returns:Type Description * Returns a new instance of this class. toJSON(){Object}
Converts an instance of this class to its ArcGIS Portal JSON representation. See the Using fromJSON() topic in the Guide for more information.
Returns:Type Description Object The ArcGIS Portal JSON representation of an instance of this class.