[mapserver-users] Annotation label with styleitem auto uses bitmap font

Humberto Cereser Ibanez humberto at pastoraldacrianca.org.br
Thu Nov 6 04:34:19 PST 2014


Hi Jelmer,

On Wed, 2014-11-05 at 20:39 +0000, Jelmer Baas wrote:
> Hi Humberto,
> 
> Thanks for the quick reply. 
> 
> I have not tried any encoding setting, because it's obviously using the bitmap font. Or would that force MapServer to use a TTF font? I'm also not sure where to add the "FONT" property. On the class? Or Layer? I tried both, had no effect.
My environment is another that your.
I use PhpMapscript and PostgreSQL/Postgis.
But perhaps these settings from my mapfile will be useful to clarifying:
MAP
...
  FONTSET "../fonts/msfontset.txt"
...
LAYER
...
    labelitem obj_name
...
    CLASS
      NAME "Better"
      expression ([range] = 1)
      STYLE
        width 2
        color 0 255 0
        OUTLINECOLOR 15 15 15
      END # Style
      LABEL
        COLOR     15 15 15
        SIZE      8
        POSITION  auto
        mindistance 4
        FONT      "FreeSans"
        type      TRUETYPE
        ENCODING  "UTF8"
      END #LABEL
    END # Class Better
    CLASS
...
Next, the path for FreeSans at msfontset.txt file:
...
FreeSans                sfd/FreeSans.ttf
...
And, at the mapfile's directory:
$ ls -l ../fonts/sfd/
...
-rwxr-xr-x 1 humberto humberto 264072 Sep 30 11:58 FreeSans.ttf
...
I get the labelitem 'obj_name' and the value tested on the expression
'range' from a PostgreSQL/Postgis query.
> 
> I believe I may have a bigger problem, maybe MapServer is falling back to the built-in font because it can't open the TTF files, but I have no idea how to test that (or confirm or deny my suspicions, because I can't find any debugging / logging info).
> 
Did you looked to Web Server's logs or run the utility command line
'shp2img'?
http://mapserver.org/utilities/shp2img.html


Good luck,

Humberto




More information about the MapServer-users mailing list