International text characters in labels

Trond Michelsen trondmm-mapserver at CRUSADERS.NO
Mon May 2 09:05:30 EDT 2005


On Mon, May 02, 2005 at 05:08:59AM -0500, Robert Jones wrote:
> I am using a shapefile which contains cities and displaying the city names
> as labels, and am having the problem that the city names which contain
> international characters are not displaying correctly i.e. the wrong
> characters are being used for the international characters.
>
> Can anyone suggest how to solve this problem?
>
> I couldn't find the solution by searching the archives or looking through
> the mapserver documentation.

First of all, you need to specify in the mapfile what character set
the labeldata is in. Then you need a font that supports international
characters.

I had a lot of problems trying to display Norwegian charcters, until I
realised that the bitmap fonts doesn't support them. I then switched
to a truetype font, and everything worked as expected.

Here's an example of my label class:

LABEL
  ENCODING LATIN1
  color 0 0 0
  outlinecolor 255 255 255
  type truetype
  font arialbd
  size 10
  PARTIALS FALSE
  BUFFER 1
END

Of course, this also requires that I have specified a fontset in the
mapfile, like this:

FONTSET "fonts/fonts.list"

and this file must include an entry that maps "arialbd" to a ttf-file

arialbd  arialbd.ttf


Finally, you also need the actual ttf-file. I can't help you with
that, I'm afraid.

--
Trond Michelsen



More information about the mapserver-users mailing list