white text under color text

Arnulf Christl arnulf.christl at CCGIS.DE
Wed Dec 8 11:43:08 PST 2004


Eric Bridger wrote:

> On Wed, 2004-12-08 at 10:59, Kristjan Annus wrote:
>
>>Hi
>>
>>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
>  SHADOWSIZE 1 1
>

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:
http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/umn_user.map&WMTVER=1.0.0&REQUEST=map&LAYERS=UMN%20USER,UMN_USER_NAMES&STYLES=,&SRS=EPSG:4326&BBOX=-11,32,32,75&WIDTH=150&HEIGHT=150&FORMAT=PNG&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE
larger:
http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/umn_user.map&WMTVER=1.0.0&REQUEST=map&LAYERS=UMN%20USER,UMN_USER_NAMES&STYLES=,&SRS=EPSG:4326&BBOX=6.4,50,8.4,52.3&WIDTH=150&HEIGHT=150&FORMAT=PNG&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=INIMAGE

CLASS
        EXPRESSION /./
        NAME "UMN MapServer User"
        MINSCALE 0
        MAXSCALE 1000000000
        LABEL
                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
        END
END


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
------------------------
http://www.ccgis.de
http://www.mapbender.org
------------------------



More information about the MapServer-users mailing list