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

Jelmer Baas baas at speerit.nl
Thu Nov 6 23:05:01 PST 2014


Hi Humberto,

Thanks for the example; unfortunately I can't use this construction - I don't know the font size and color of the objects, hence the stileitem "auto" . The resolution now is to make sure all labels in the MapInfo have have a proper font set. 

Regards,
Jelmer 


-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Humberto Cereser Ibanez
Sent: donderdag 6 november 2014 13:34
To: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Annotation label with styleitem auto uses bitmap font

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

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list