Font Error - msGetLabelSize()

B Tuttle funkbucket at GMAIL.COM
Mon May 8 00:14:36 EDT 2006


(Apologies if this is going out twice, I got an error when I tried to
send it the first time, this is my first time posting to the list)
Hi-
I am new to this and trying to set up my first map server on a linux
box. When I try to use trutype font labels for my legend I get the
following error:
msGetLabelSize(): TrueType Font error. Requested font (courier) not found.

This also occurs if I change the font to say arial:
msGetLabelSize(): TrueType Font error. Requested font (arial) not found.

My legend is as follows:
LEGEND
     STATUS on
     IMAGECOLOR 230 230 230
     LABEL
          TYPE truetype
          FONT "courier"
          COLOR 0 0 0
          SIZE 10
          ANTIALIAS true
     END
END

Commenting out TYPE and FONT and changing SIZE to small gets rid of
the error. I am not sure if this is a typo, permissions, path, or some
other issue. My fontset.txt, and an ls of the font directory and my
map file are below. Any help would be appreciated.
======================================
[root at localhost home]# ls /usr/share/fonts/webcore/
andalemo.ttf  courbd.ttf     georgiai.ttf  tahomabd.ttf  trebucit.ttf
arialbd.ttf   courbi.ttf     georgia.ttf   tahoma.ttf    trebuc.ttf
arialbi.ttf   couri.ttf      georgiaz.ttf  timesbd.ttf   verdanab.ttf
ariali.ttf    cour.ttf       impact.ttf    timesbi.ttf   verdanai.ttf
arial.ttf     fonts.cache-1  l_10646.ttf   timesi.ttf    verdana.ttf
ariblk.ttf    fonts.dir      lucon.ttf     times.ttf     verdanaz.ttf
comicbd.ttf   fonts.scale    micross.ttf   trebucbd.ttf  webdings.ttf
comic.ttf     georgiab.ttf   symbol.ttf    trebucbi.ttf  wingding.ttf
[root at localhost home]
======================================
      arial                           /usr/share/fonts/webcore/arial.ttf
      arial-bold                      /usr/share/fonts/webcore/arialbd.ttf
      arial-italic                    /usr/share/fonts/webcore/ariali.ttf
      arial-bold-italic               /usr/share/fonts/webcore/arialbi.ttf
      arial_black                     /usr/share/fonts/webcore/ariblk.ttf
      comic_sans                      /usr/share/fonts/webcore/comic.ttf
      comic_sans-bold                 /usr/share/fonts/webcore/comicbd.ttf
      courier                         /usr/share/fonts/webcore/cour.ttf
      courier-bold                    /usr/share/fonts/webcore/courbd.ttf
      courier-italic                  /usr/share/fonts/webcore/couri.ttf
      courier-bold-italic             /usr/share/fonts/webcore/courbi.ttf
      georgia                         /usr/share/fonts/webcore/georgia.ttf
      georgia-bold                    /usr/share/fonts/webcore/georgiab.ttf
      georgia-italic                  /usr/share/fonts/webcore/georgiai.ttf
      georgia-bold-italic             /usr/share/fonts/webcore/georgiaz.ttf
      impact                          /usr/share/fonts/webcore/impact.ttf
      monotype.com                    /usr/share/fonts/webcore/monotype.ttf
      recreation_symbols              /usr/share/fonts/webcore/recreate.ttf
      times                           /usr/share/fonts/webcore/times.ttf
      times-bold                      /usr/share/fonts/webcore/timesbd.ttf
      times-italic                    /usr/share/fonts/webcore/timesi.ttf
      times-bold-italic               /usr/share/fonts/webcore/timesbi.ttf
      trebuchet_ms                    /usr/share/fonts/webcore/trebuc.ttf
      trebuchet_ms-bold               /usr/share/fonts/webcore/trebucbd.ttf
      trebuchet_ms-italic             /usr/share/fonts/webcore/trebucit.ttf
      trebuchet_ms-bold-italic        /usr/share/fonts/webcore/trebucbi.ttf
      verdana                         /usr/share/fonts/webcore/verdana.ttf
      verdana-bold                    /usr/share/fonts/webcore/verdanab.ttf
      verdana-italic                  /usr/share/fonts/webcore/verdanai.ttf
      verdana-bold-italic             /usr/share/fonts/webcore/verdanaz.ttf
======================================
NAME "AppDesign3"
UNITS meters
SIZE 640 480
IMAGECOLOR 255 255 255
IMAGETYPE png
SHAPEPATH "/data/"
#Bottom left, upper right
EXTENT 139732.562544 4093791.107191 763734.812496 4546455.000230
FONTSET "/usr/local/apache2/htdocs/fontset.txt"

WEB
    HEADER "/usr/local/apache2/htdocs/appdesign3_web_header.html"
    FOOTER "/usr/local/apache2/htdocs/appdesign3_web_footer.html"
    EMPTY "/appdesign3_no_results.html"
    TEMPLATE "/usr/local/apache2/htdocs/appdesign3.html"
    IMAGEPATH "/usr/local/apache2/htdocs/tmp/"
    IMAGEURL "/tmp/"
END

SYMBOL
  NAME "triangle"
  TYPE vector
  POINTS
    0 4
    2 0
    4 4
    0 4
  END
END

REFERENCE
  IMAGE "/data/colorado_ref_map.gif"
  SIZE 300 225
  EXTENT 139732.562544 4093791.107191 763734.812496 4546455.000230
  STATUS on
  COLOR -1 -1 -1
  OUTLINECOLOR 255 0 0
END

QUERYMAP
  STATUS on
  STYLE hilite
  COLOR 255 0 0
  SIZE 480 320
END

SCALEBAR
     LABEL
          COLOR 0 0 0
          ANTIALIAS true
          SIZE small
     END
     POSITION lr
     INTERVALS 5
     STATUS embed
     SIZE 144 5
     STYLE 0
     UNITS miles
     BACKGROUNDCOLOR 255 255 255
     IMAGECOLOR 255 255 255
     COLOR 0 0 0
     OUTLINECOLOR 0 0 0
     TRANSPARENT off
END

LEGEND
     STATUS on
     IMAGECOLOR 230 230 230
     LABEL
          TYPE truetype
          FONT "courier"
          COLOR 0 0 0
          SIZE 10
          #SIZE small
          ANTIALIAS true
     END
END


LAYER
    NAME "USGS_Index"
    STATUS on
    TYPE polygon
    CONNECTIONTYPE POSTGIS
    CONNECTION "dbname=project1 user=postgres host=localhost port=5432"
    DATA "the_geom from usgs_index"
    HEADER "/usr/local/apache2/htdocs/appdesign3_index_header.html"
    FOOTER "/usr/local/apache2/htdocs/appdesign3_index_footer.html"
    TOLERANCE 100
    TOLERANCEUNITS meters
    LABELCACHE on
    LABELITEM 'QUAD_NAME'
    LABELMAXSCALE 250000
    CLASS
        NAME "USGS Index"
        TEMPLATE "/usr/local/apache2/htdocs/appdesign3_index_query.html"
        STYLE
            OUTLINECOLOR 0 255 0
        END
        LABEL
            COLOR 0 255 0
            SIZE small
	    POSITION cc
        END # label
    END # class
END # layer

LAYER
    NAME "Counties"
    STATUS on
    TYPE polygon
    CONNECTIONTYPE POSTGIS
    CONNECTION "dbname=project1 user=postgres host=localhost port=5432"
    DATA "the_geom from counties"
    LABELCACHE on
    LABELITEM "CNTY_NAME"
    LABELMINSCALE 250000
    CLASS
        NAME "Counties"
        STYLE
            SIZE 1
            OUTLINECOLOR 0 0 255
        END
        LABEL
            #MINFEATURESIZE auto
            COLOR 0 0 255
            SIZE small
            POSITION cc
        END # label
    END # class
END # layer

LAYER
    NAME "Cities"
    STATUS on
    TYPE point
    CONNECTIONTYPE POSTGIS
    CONNECTION "dbname=project1 user=postgres host=localhost port=5432"
    DATA "the_geom from cities"
    LABELCACHE on
    LABELITEM "name"
    LABELMAXSCALE 100000
    MAXSCALE 1000000
    CLASS
        STYLE
            COLOR  255 0 0
            SYMBOL 'triangle'
            SIZE 5
        END
        LABEL
          COLOR 250 0 0
          SIZE small
          POSITION auto
        END
    END # class
END # layer states

LAYER
    NAME "Highways"
    STATUS on
    TYPE line
    CONNECTIONTYPE POSTGIS
    CONNECTION "dbname=project1 user=postgres host=localhost port=5432"
    DATA "the_geom from highways"
    LABELCACHE on
    #LABELITEM "ROUTE"
    CLASS
        NAME "Highways"
        STYLE
            SIZE 1
            COLOR 0 0 0
        END
    #    LABEL
    #        COLOR 0 0 0
    #        SIZE small
    #    END # label
    END # class
END # layer

END # mapfile



More information about the mapserver-users mailing list