Providing geoscience data globally Navigation
Main content
Bottom links


Home > How to serve a OneGeology WMS > Setting up a MapServer WMS > Configuring your MapServer WMS > Alt character set

4.3.2 Adding alternate character set support

If you are serving a non-English language service, you may need or want to change the font and character sets.

To specify a font set you need to use the FONTSET keyword which references a file that contains the mappings from the font name aliases, which you will use in your map file, to the actual font file names on your computer.

    NAME BGS_EN_Bedrock_and_Superficial_Geology
    # Root layer name
    SIZE 600 600
    EXTENT -8.6476 49.8639 1.76943 60.8622
    UNITS dd 
    SHAPEPATH “data”
    IMAGECOLOR 255 255 255
    FONTSET “fontset.txt”

The path to the fontset.txt file is relative to the location of the map file. In this example (above) then, the fontset.txt file is located in the same folder as the map file.

A fontset.txt file may look like:


You only need one font specified in your map file but you may list as many as you like in your font set file. To get the font specified in the font file to be used by the map service you now need to modify the LABEL section of the LEGEND, as in the below example, which would allow you to display Chinese characters.

    OUTLINECOLOR 200 200 200
    KEYSPACING 10 10
        TYPE truetype
        FONT msgothic
        SIZE 8
        ENCODING UTF-8

The important parts to note in the above example are:

  • TYPE truetype (the default is TYPE bitmap)
  • FONT msgothic (the font alias we set up in our fontset.txt file)
  • SIZE 8 (size should be specified in points, you can’t use words like “small” or “medium” which you do with bitmap fonts.)
  • ENCODING UTF-8 (You must also save your map file in this character set encoding).

Section last modified: 31 August 2011.

Back | Next