FontSymbol

Description

The FontSymbol element defines a style for a font symbol.

Context

Table 1 lists the elements that can contain, or be contained by, a FontSymbol element.

Table 1. Context
Contained by Element Contains

NamedStyle or PointStyle

FontSymbol

(empty)

Attributes

Table 2 lists the attributes of a FontSymbol element.

Table 2. Attributes
Attribute Description

id

A unique identifier for the element.

name

A descriptive name for the element.

text

A one-character string value specifying the symbol character to use.

If the family attribute is set to the name of a TrueType font, set this attribute to the character for the font symbol.

If the family attribute is set to MapInfo 3.0 Compatible or MapInfo Symbols, refer to the set of symbols and symbol codes shown in MapInfo 3.0 Symbol Codes.

family

Either of the following:

  • A string value specifying the name of a TrueType symbol font (for example, "WingDings").
  • The string value MapInfo 3.0 Compatible or MapInfo Symbols, specifying the symbols shown in MapInfo 3.0 Symbol Codes.

The family attribute is optional. The default value is arial.

size

A floating-point value specifying the size of the symbol.

The size attribute is optional. The default value is 12.

size-unit

A reference to a length in the mapinfo codespace, which specifies the unit of measurement used for the size attribute.

The size-unit attribute is optional. The default value is mapinfo:length pt.

stroke

A string value specifying the color of the symbol.

The value can be any valid CSS color. (See http://www.w3.org/TR/REC-CSS1#color-units.)

The stroke attribute is optional. The default value is black.

stroke-opacity

A floating-point value from 0 to 1 specifying the opacity of the symbol.

A value of 0 means that the symbol is totally transparent. A value of 1 means that the symbol is totally opaque. A value of 0.5 means that the symbol is 50% translucent.

The stroke-opacity attribute is optional. The default value is 1.

font-style

An enumeration value specifying the font style. Possible values are:

  • normal
  • italic
  • oblique

The font-style attribute is optional. The default value is normal.

effect

A string value specifying the color of the text effect provided by the effect-type attribute.

The value can be any valid CSS color. (See http://www.w3.org/TR/REC-CSS1#color-units.)

The effect attribute is optional. The default value is none.

effect-opacity

A floating-point value from 0 to 1 specifying the opacity of the text effect.

A value of 0 means that the effect is totally transparent. A value of 1 means that the effect is totally opaque. A value of 0.5 means that the effect is 50% translucent.

The effect-opacity attribute is optional. The default value is 1.

effect-type

An enumeration value specifying the text effect type. Possible values are:

  • box
  • halo
  • glyph-outline
  • none

The effect-type attribute is optional. The default value is none.

font-weight

An enumeration value specifying the font weight. Possible values are:

  • normal
  • bold
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
Note: normal is equivalent to 200; bold is equivalent to 400.

The font-weight attribute is optional. The default value is normal.

text-decoration

A string value specifying the text decoration.

The value must have the following pattern: a choice of one or more of (underline | line-through) separated by a single space or the single value none. Examples: line-through underline, underline, none.

The text-decoration attribute is optional. The default value is none.

text-case

An enumeration value specifying the text case. Possible values are:

  • upper
  • lower
  • default
Note: default means 'retain the current case'.

The text-case attribute is optional. The default value is default.

shadow

A boolean value (true or false) specifying whether to have a drop-shadow drawn behind the symbol. A value of false (the default) specifies no drop-shadow.

The shadow attribute is optional. The default value is false.

expand

A boolean value (true or false) specifying whether a space character should be inserted between each pair of visible characters in the text string.

The expand attribute is optional. The default value is false.

angle

A floating-point value specifying the rotation angle of the symbol.

angle-unit

A string value specifying the unit of measurement used for the angle attribute.

Examples

This example specifies an 18-point red push-pin symbol from the MapInfo 3.0 Symbols set.

Note that the text attribute is set to C, which is decimal code 67 in the UTF-8 encoding, and the family attribute is set to MapInfo Symbols, which specifies the MapInfo 3.0 Symbols set. In the MapInfo 3.0 Symbols set, code 67 specifies a push-pin symbol.


<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle
    version="MXP_WorkSpace_1_5"
    xmlns="http://www.mapinfo.com/mxp">
    <FontSymbol
        size="18"
        size-unit="mapinfo:length pt"
        stroke="red"
        stroke-opacity="1"
        text="C"
        family="MapInfo Symbols"/>
</NamedStyle>

			

This example specifies a 14-point blue star symbol from the MapInfo 3.0 Symbols set.

Note that the text attribute is set to #, which is decimal code 35 in the UTF-8 encoding, and the family attribute is set to MapInfo Symbols, which specifies the MapInfo 3.0 Symbols set. In the MapInfo 3.0 Symbols set, code 35 specifies a star symbol.


<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle
    version="MXP_WorkSpace_1_5"
    xmlns="http://www.mapinfo.com/mxp">
    <FontSymbol
        size="14"
        size-unit="mapinfo:length pt"
        stroke="blue"
        stroke-opacity="1"
        text="#"
        family="MapInfo Symbols"/>
</NamedStyle>