Defining Fonts and Symbols

Parent Previous Next

Defining Fonts and Symbols

In order to support all the MapInfo brush, pen and marker (point) styles it may be required to define additional styles and fonts to be used by MapServer when drawing the features of the layer. The installer of MapManager copies a default font file (font.list) and symbol file (symbols.sym) in the templates subdirectory of the application folder. By editing these files we can add further fonts and symbols to be used when creating a map configuration with MapManager.

Adding a TrueType font reference

The references to the installed fonts should be added to the font.list file. The font.list file is a simple text file containing information about the TrueType fonts available for MapServer. The aliases defined are then used throughout a MapFile to specify which font to use. The aliases are are case sensitive.

The format of the font.list file is very simple. Each line contains 2 items: an alias and the name/path of the font seperated by white space. The alias is simply the name we refer to the font as in our mapfiles (eg. times-bold). The name is the actual name of the TrueType file. If the file path is not specified then it is interpreted as relative to the location of the fontset. Here's an example of the MapInfo related fontset entries:

map-symbols C:\WINDOWS\Fonts\Mapsym.ttf
mapinfo-miscellaneous C:\WINDOWS\Fonts\Ttmimi__.ttf
mapinfo-cartographic C:\WINDOWS\Fonts\TTMICG__.TTF
mapinfo-arrows C:\WINDOWS\Fonts\Ttmiar__.ttf
mapinfo-dispersed-groups C:\WINDOWS\Fonts\MapInfo_dispersed_groups.ttf
mapinfo-oil&gas C:\WINDOWS\Fonts\Ttmiog__.ttf
mapinfo-real-estate C:\WINDOWS\Fonts\Ttmire__.ttf
mapinfo-shields C:\WINDOWS\Fonts\MAPIS___.TTF
mapinfo-streetpro C:\WINDOWS\Fonts\mapisp__.ttf
mapinfo-streetpro-unicode C:\WINDOWS\Fonts\Mapispu0.ttf
mapinfo-symbols C:\WINDOWS\Fonts\TTMIOS__.TTF
mapinfo-transportation C:\WINDOWS\Fonts\Ttmitc__.ttf
mapinfo-weather C:\WINDOWS\Fonts\Ttmiwe__.ttf

Adding a new SYMBOL definition

To support some application specific or custom styles it may be required to extend the current set of symbols by adding new symbol definitions. The symbols define how the lines, polygons and points being rendered by MapServer. The symbols are used to define the line and brush patterns and the outline of the point (marker) features.

When using the OGR auto style option, pre-defined symbol names should exist in order to support rendering all the styles contained by the layer. For more information about the pre-defined symbol names see Mapping OGR Feature Styles to Layer Styles.
The symbol definitions should be located in the symbolset file (symbols.sym) see the example below:

  NAME 'mapinfo-brush-137'
    12 12
    12 15
    15 15
    15 12
    12 12

Alternatively we can add the symbol definition directly into the mapfile (inline symbols) within the MAP section, like:

    NAME 'mapinfo-pen-14'
    PATTERN 11 5 1 5 END

Note: The symbol name convention 'mapinfo-pen-nnn' or 'mapinfo-brush-nnn' where nnn is the fill pattern number as defined by MapInfo Professional means that when "Auto Style" is checked for a MapServer layer that uses a MapInfo TAB file that pen or brush style will be assigned to any feature that has a native MapInfo style defined by 'mapinfo-pen-nnn'  and/or 'mapinfo-brush-nnn'.

Defining TrueType symbols

The TrueType symbols are essential for example when defining the MapInfo point symbols (mapinfo-sym-...). To define the symbol the character code should be identified and the following symbol definition can be used:

  NAME "mapinfo-sym-67"
  FONT "mapinfo-miscellaneous"
  GAP 10

Note: The character code can be used directly in the definition according to the following convention: CHARACTER  "C"

For more information about the symbol definitions see: MapServer SYMBOL reference.