white text under color text

Arnulf Christl arnulf.christl at CCGIS.DE
Wed Dec 8 14:43:08 EST 2004

Eric Bridger wrote:

> On Wed, 2004-12-08 at 10:59, Kristjan Annus wrote:
>>I have seen in various samples that text labels i.e. street names are drawn
>>with black characters witch are placed on top of a little bit bigger white
>>characters - it makes text much better to read especialy on ortophotos.
>>Does anybody know how it is done?
> In your mapfile LABEL section add something like:
>  SHADOWCOLOR 200 200 200

You can either do that (gives a drop shadow of the text) or you can add
OUTLINECOLOR [r] [g] [b]
which gives you a 1-pixel outline around every character. Do some
experimenting to find our which combination suits you best. Remember to
take care of font sizes at different scales, very tiny fonts might look
strange with those options.

You can combine effects to render the labels looking like embossed. The
below MAP file settings render labels like can be seen in the German
MapServer Users' map (I toyed around with both options).

small scale:

        EXPRESSION /./
        NAME "UMN MapServer User"
        MINSCALE 0
        MAXSCALE 1000000000
                TYPE TRUETYPE
                FONT "arialbold"
                WRAP "*"
                SIZE 8
                MINSIZE 6
                MAXSIZE 10
                POSITION AUTO
                OFFSET 8 3
                BUFFER 2
                BACKGROUNDCOLOR 190 190 190
                BACKGROUNDSHADOWSIZE -1 -1
                BACKGROUNDSHADOWCOLOR 254 254 255
                #OUTLINECOLOR 255 255 245
                SHADOWCOLOR 236 236 236
                SHADOWSIZE -1 -1
                MINDISTANCE 10
                COLOR 0 0 0  #102 102 255
                ANTIALIAS TRUE
                PARTIALS FALSE
                FORCE FALSE

I think it would be a great idea to have more samples of what can be
done. Long time ago Frank was suggesting to set up an always up-to-date
  demo & test environment, what has happened to that one?
Maybe we could do both and just put MAP file snippets like the above on
a server together with a WMS example showing each.

...why am I asking this, thats just a bloody lot of work

Cheers, Arnulf.

Arnulf B. Christl

More information about the mapserver-users mailing list