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

Aude Allain aude.allain.ext at MAPPY.COM
Wed Jan 24 03:53:10 EST 2007


My fontset.txt is : 

Arial (TrueType) C:/WINDOWS/Fonts/ARIAL.TTF
Arial Bold (TrueType) C:/WINDOWS/Fonts/ARIALBD.TTF
Arial Italic (TrueType) C:/WINDOWS/Fonts/ARIALI.TTF
Arial Bold Italic (TrueType) C:/WINDOWS/Fonts/ARIALBI.TTF
Times New Roman (TrueType) C:/WINDOWS/Fonts/TIMES.TTF
Times New Roman bold (TrueType) C:/WINDOWS/Fonts/TIMESBD.TTF
Times New Roman italic (TrueType) C:/WINDOWS/Fonts/TIMESI.TTF
Times New Roman bold_italic (TrueType) C:/WINDOWS/Fonts/TIMESBI.TTF
TrebucNet MS (TrueType) C:/WINDOWS/Fonts/trebuc.ttf
Trebuchet MS Bold (TrueType) C:/WINDOWS/Fonts/trebucb.ttf
Trebuchet MS Italic (TrueType) C:/WINDOWS/Font/strebuci.ttf
Trebuchet MS Bold Italic (TrueType) C:/WINDOWS/Fonts/trebucbi.ttf



1. The font alias in the layer is correct.

	LAYER
		....
		FONT "Arial"
		.... FONT "Arial"
	END

	With this FONT, I get the following error : msGetLabelSize(): Could not find/open font.

	
	If I add "(TrueType)" --> FONT "Arial (TrueType)", I get the following error : msGetLabelSize(): Requested font (Arial (TrueType)) not found.

	So, I don't add TrueType.

2. I use an absolute path in my the mapfile to define the fonts.txt file. 

      FONTSET  "c:/ms4w/Apache/htdocs/viewer/mapfile/font/fontset.txt"

3. I would like to have more information about permissions because in some forums, it is said to check the font permissions, but I don't know how to do that. 

4. The Arial font is in C:/WINDOWS/Fonts/ARIAL.TTF directory. I tried to put the font file in the same directory as the fontset.txt file and replaced C:/WINDOWS/Fonts/ARIAL.TTF by  ARIAL.TTF and I have always the same error. 


5. Mapserver is compiled with freetype support.

MapServer version 4.10.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PD
F OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPP
ORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPP
ORTS=SOS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OR
ACLESPATIAL INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE DEBUG=MSDEBUG

Thanks a lot, 

aude

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

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