[mapserver-users] mapserver 5.6.3: msGetLabelSize() won't see TrueType fonts?

Christian Fritze christian.fritze at porath.de
Sun Jun 20 07:44:33 PDT 2010


Hello everybody!

When trying to use TrueType fonts for a label with perl/mapscript,
I get the error message

> msGetLabelSize(): TrueType Font error. Requested font (Vera) not found.

But this code in the same script...

> my $fontsetobj = $map2->{fontset};
> my $fonts = $fontsetobj->{fonts};
> my $vermerk=$map2->getLayerByName('Vermerk');
> 
> my $class=$vermerk->getClass(0);
> my $label=$class->{label};
> print STDERR "Font of label $label is " . $label->{font} . "\n";
> print STDERR "Font alias " . $label->{font} . " points to " . $fonts->get($label->{font}) . ".\n";

...indicates that alias 'Vera' points to file
/usr/X11R6/lib/X11/fonts/truetype/Vera.ttf
which /usr/bin/file tells me to be world readable 'TrueType font data'.

When changing the LABEL part of the mapfile to use bitmap fonts
instead, the label gets drawn without problems.

Can anyone think of a reason why msGetLabelSize() won't see what is
apparently there? (GD *is* compiled against FreeType2...)

Thanks in advance...





More information about the MapServer-users mailing list