msGetLabelSize() : Could not find/open font {Scanned} {Scanned}

Fawcett, David David.Fawcett at STATE.MN.US
Tue Jan 23 14:47:46 EST 2007


I think that it is clear that the problem is that MapServer can't find the font file based on the name that you have specified in your layer.  This could result from many different errors:

1.  The font alias name in your layer cannot be found in your fonts.txt file.  Case sensitivity applies on 'nix boxes.  

2.  The relative path that you have specified at FONTSET in your MAP object does not point to the fonts.txt file that you have created.  Try using an absolute path to your fonts.txt file.  

3.  It could be a permissions problem.

4.  The absolute path to the font file as it is written in fonts.txt may not correctly point to the font file.  

5.  MapServer wasn't compiled with freetype support.  

To rule out an issue with MapScript, you could create a map image using mapserver cgi or shp2img.exe. 

David.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Aude Allain
Sent: Tuesday, January 23, 2007 2:32 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] msGetLabelSize() : Could not find/open font {Scanned} {Scanned}


Hi, 

These solutions don't work. I have always the same error. 

Do you know what is the problem ? 

aude

-----Message d'origine-----
De : UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] De la part de Siki Zoltan Envoyé : lundi 22 janvier 2007 20:27 À : MAPSERVER-USERS at LISTS.UMN.EDU Objet : Re: [UMN_MAPSERVER-USERS] msGetLabelSize() : Could not find/open font {Scanned} {Scanned}

Hi,

1. Try to remove (TrueType) from your font set file.
2. Use slash instead of backslash in the path in the font set file even on 
   Windows

for example
Arial C:/WINDOWS/Fonts/ARIAL.TTF

Bye,
Zoltan

On Mon, 22 Jan 2007, Aude Allain wrote:

> Hello,
> 
> I'm trying to display labels on my map, but I get the following error 
> :
> : msGetLabelSize(): Could not find/open font. 
> 
> I defined a FONTSET FILE in the mapfile which contains font paths :
> FONTSET   "../font/fontset.txt"
> 
> Content of fontset.txt :
> 
> Arial (TrueType) C:\WINDOWS\Fonts\ARIAL.TTF
> 
> And, the layer on which I want to see the labels is defined in the 
> mapfile :
> 
> LAYER
> 
>             NAME         " A0"
> 
>               CONNECTIONTYPE oraclespatial      
> 
>             CONNECTION  "user at bd/pwd"
> 
>             DATA "GEOM FROM MN_A0 USING UNIQUE ID SRID 8307 "
> 
>             STATUS       DEFAULT
> 
>             TYPE         POLYGON
> 
>             MINSCALE       150
> 
>             MAXSCALE    500
> 
>             GROUP "Administratif"
> 
>             TOLERANCE    100
> 
>             TOLERANCEUNITS pixels
> 
>             LABELITEM "NAME"
> 
>             LABELCACHE on
> 
>             CLASS
> 
>                 NAME                      "Pays - A0"       
> 
>                 COLOR        255 216 176
> 
>                 OUTLINECOLOR 32 32 32
> 
>                 TEMPLATE "ttt_query.html"
> 
>                 LABEL
> 
>                          MINFEATURESIZE 1
> 
>                         MINDISTANCE 1
> 
>                         POSITION CC
> 
>                         TYPE TRUETYPE
> 
>                         FONT "Arial"
> 
>                         SIZE 12
> 
>                        ANTIALIAS TRUE
> 
>                        COLOR 0 0 0
> 
>                         OUTLINECOLOR 255 255 255
> 
>                 END
> 
>             END
> 
>             
> 
> END # A0
> 
>  
> 
>  
> 
> The font named 'Arial' is in c:/Windows/font.
> 
>  
> 
> On the Web, it is said to check the Apache user or mapserver has 
> permission to access the font file and the ttf files. But I don't know 
> how to do that.
> 
>  
> 
> Could you hep me ?
> 
>  
> 
> I use :
> 
> -          windows xp
> 
> -          ms4w : php/mapscript 4.10, apache 2, php5.2
> 
> -          Oracle spatial 10g
> 
>  
> 
>  
> 
> Aude
> 
>  
> 
> 



More information about the mapserver-users mailing list