MapServer / MapServer-import

3 stars 2 forks source link

Truetype font outlines buggered starting with Mapserver 4.10.0 #2027

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: sroberts@ucar.edu Date: 2007/02/11 - 23:48

Starting with Mapserver 4.10.0 truetype font outlines appear to be broken. Each
character outline now shows up as multiple outlines offset randomly, making it
difficult to read the text or interpret symbols. Truetype font outlines worked
fine with Mapserver 4.8.4. Here is a sample mapfile demonstrating the problem:

MAP
  SIZE 500 200
  EXTENT 0 0 100 100
  FONTSET "{path to fonts}/fonts/fonts.list"
  IMAGECOLOR 0 0 0

  OUTPUTFORMAT
    NAME png
    DRIVER "GD/PNG"
    MIMETYPE "image/png"
    IMAGEMODE RGB
    EXTENSION "png"
  END
  PROJECTION
      "proj=latlong"
  END

  LAYER
    TYPE ANNOTATION
    FEATURE
      POINTS 50 65 END
    END
    STATUS DEFAULT
    CLASS
      TEXT "TRUETYPE FONT;Mapserver-4.10.0"
      LABEL
        TYPE TRUETYPE
        FONT courier
        SIZE 35
        POSITION CC
        COLOR 255 0 0
        OUTLINECOLOR 255 255 255
        WRAP ';'
      END
    END
  END
END
tbonfort commented 12 years ago

Author: sdlime Date: 2007/02/12 - 21:26

Yup, that FUBAR. I've not seen the same problems with any of my 4.10 
applications. What versions of GD and Freetype are you using?

Steve
tbonfort commented 12 years ago

Author: sroberts@ucar.edu Date: 2007/02/13 - 01:04

I tried both gd-2.0.33 and gd-2.0.34, freetype-2.3.1 and the version included
with the Redhat distribution(libfreetype.so.6.3.7). Makes no difference. I'm
building both mapserver 4.8.4 and 4.10.0 identically using the same versions of
dependent software. Version 4.8.4 works fine but 4.10.0 does not. Did you try
using my test mapfile? And did it work for you? The problem is not obvious if
you are using small fonts so could the problem be there but you just overlooked
it?? The problem is particularly troublesome to me since I'm using a large ship
outline symbol to plot the location of a ship and starting with version 4.10.0
the ship is no longer recognizable. I'm using this font in a label so could it
have something to do with maplabel.c? I've noticed you made a lot of changes to
this file since mapserver 4.8.4 to support curved labels.

-Steve
tbonfort commented 12 years ago

Author: sdlime Date: 2007/02/13 - 17:21

I can confim the bug on my end. I'm puzzled why this hasn't been noticed 
before. Perhaps since folks don't often render 35pt text. For example, if you 
reduce your size to 10 you don't see the effect, but larger and you do. All my 
4.10 interfaces stick to relatively small text sizes.

I suspect the problem is in mapgd.c since that's where the outline is applied.

Working on it, should be an easy one (I hope)...

Steve
tbonfort commented 12 years ago

Author: sdlime Date: 2007/02/13 - 18:00

Ok, found the problem. I suspect this cropped in when some other changes were 
contributed by a third-party and I simply didn't scrutinize them closely 
enough. I have fixed the error in 4.10 branch and CVS HEAD...

Steve
tbonfort commented 12 years ago

Author: sdlime Date: 2007/02/14 - 18:04

*** Bug 2029 has been marked as a duplicate of this bug. ***