scalebar : msGetFontFace(): General error message. Freetype was unable to load font file #5141

Closed
jbelien opened this Issue Aug 14, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@jbelien

jbelien commented Aug 14, 2015

Hi,

I just tried to use the scalebar executable (from 7.0.0 Github release - after compilation) but I get this error message : msGetFontFace(): General error message. Freetype was unable to load font file when I try to generate a scalebar image.

I have no problem with shp2img and legend executables with the same MapFile and the same font. I tried several fonts and get the error message everytime.

EDIT: I switched back to 6.4.1 and the scalebar executable works just fine.

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Sep 8, 2015

Member

can you post the mapfile you're using please

Member

tbonfort commented Sep 8, 2015

can you post the mapfile you're using please

@jbelien

This comment has been minimized.

Show comment
Hide comment
@jbelien

jbelien Sep 9, 2015

Hi,

My mapfile is the following one :

MAP
  NAME "ELECTRICITY_11001"
  EXTENT 482155.90657486 6638182.7614446 493276.18880817 6650557.4816821
  STATUS ON
  SIZE 1050 750
  IMAGECOLOR 255 255 255
  #FONTSET "/usr/lib/cgi-bin/fonts.txt"
  SYMBOLSET "/usr/lib/cgi-bin/symbols.txt"

  PROJECTION
    "init=epsg:3857"
  END

  SCALEBAR
    UNITS kilometers
    OUTLINECOLOR 0 0 0
    LABEL
      FONT "sc"
      TYPE truetype
      SIZE 10.0
    END
  END

  LEGEND
    LABEL
      FONT "sc"
      TYPE truetype
      SIZE 8.0
    END
  END

  INCLUDE "osm-google.map"

  LAYER
    ...
  END # LAYER

END # MAP

The osm-google.map included is the mapfile generated by https://github.com/mapserver/basemaps for OpenStreetMap (edited to be included in test.map) :

#MAP
FONTSET "/var/www/data/vector/osm/2015/basemaps/fonts.lst"
SHAPEPATH "/var/www/data/vector/osm/2015/basemaps"
IMAGETYPE png
MAXSIZE 4000
#SIZE 800 800
#EXTENT -20000000 -20000000 20000000 20000000
UNITS meters
IMAGECOLOR 153 179 204
#WEB
#   METADATA
#      "ows_enable_request" "*"
#      "wms_srs" "EPSG:900913 EPSG:4326 EPSG:3857 EPSG:2154 EPSG:310642901 EPSG:4171 EPSG:310024802 EPSG:310915814 EPSG:310486805 EPSG:310702807 EPSG:310700806 EPSG:310547809 EPSG:310706808 EPSG:310642810 EPSG:310642801 EPSG:310642812 EPSG:310032811 EPSG:310642813 EPSG:2986"
#      "labelcache_map_edge_buffer" "-10"
#      "wms_title" "osm france"
#   END
#END
#DEBUG 1
#CONFIG "MS_ERRORFILE" "stderr"
#CONFIG "PROJ_LIB" "/var/www/data/vector/osm/2015/basemaps"
#PROJECTION
#   "init=epsg:3857"
#END
LAYER
...
END
#END

The fonts.lst list file is the default font list generated by https://github.com/mapserver/basemaps for OpenStreetMap :

unifont fonts/unifont.ttf
arialuni fonts/arialuni.ttf
#sc fonts/ARIALUNI.TTF
#scb fonts/ARIALUNI.TTF
#sc fonts/Everson-Mono.ttf
#scb fonts/Everson-Mono.ttf
#sc fonts/TITUSCBZ.TTF
#scb fonts/TITUSCBZ.TTF
sc fonts/DejaVuSansCondensed.ttf
scb fonts/DejaVuSansCondensed-Bold.ttf
khmer fonts/KhmerOS.ttf
jp fonts/ipag.ttf
#sc fonts/Cyberbit.ttf
#scb fonts/Cyberbit.ttf

I kept the directory structure generated by https://github.com/mapserver/basemaps (fonts.lst is in a fonts directory next to osm-google.map.

Thanks for your help.

jbelien commented Sep 9, 2015

Hi,

My mapfile is the following one :

MAP
  NAME "ELECTRICITY_11001"
  EXTENT 482155.90657486 6638182.7614446 493276.18880817 6650557.4816821
  STATUS ON
  SIZE 1050 750
  IMAGECOLOR 255 255 255
  #FONTSET "/usr/lib/cgi-bin/fonts.txt"
  SYMBOLSET "/usr/lib/cgi-bin/symbols.txt"

  PROJECTION
    "init=epsg:3857"
  END

  SCALEBAR
    UNITS kilometers
    OUTLINECOLOR 0 0 0
    LABEL
      FONT "sc"
      TYPE truetype
      SIZE 10.0
    END
  END

  LEGEND
    LABEL
      FONT "sc"
      TYPE truetype
      SIZE 8.0
    END
  END

  INCLUDE "osm-google.map"

  LAYER
    ...
  END # LAYER

END # MAP

The osm-google.map included is the mapfile generated by https://github.com/mapserver/basemaps for OpenStreetMap (edited to be included in test.map) :

#MAP
FONTSET "/var/www/data/vector/osm/2015/basemaps/fonts.lst"
SHAPEPATH "/var/www/data/vector/osm/2015/basemaps"
IMAGETYPE png
MAXSIZE 4000
#SIZE 800 800
#EXTENT -20000000 -20000000 20000000 20000000
UNITS meters
IMAGECOLOR 153 179 204
#WEB
#   METADATA
#      "ows_enable_request" "*"
#      "wms_srs" "EPSG:900913 EPSG:4326 EPSG:3857 EPSG:2154 EPSG:310642901 EPSG:4171 EPSG:310024802 EPSG:310915814 EPSG:310486805 EPSG:310702807 EPSG:310700806 EPSG:310547809 EPSG:310706808 EPSG:310642810 EPSG:310642801 EPSG:310642812 EPSG:310032811 EPSG:310642813 EPSG:2986"
#      "labelcache_map_edge_buffer" "-10"
#      "wms_title" "osm france"
#   END
#END
#DEBUG 1
#CONFIG "MS_ERRORFILE" "stderr"
#CONFIG "PROJ_LIB" "/var/www/data/vector/osm/2015/basemaps"
#PROJECTION
#   "init=epsg:3857"
#END
LAYER
...
END
#END

The fonts.lst list file is the default font list generated by https://github.com/mapserver/basemaps for OpenStreetMap :

unifont fonts/unifont.ttf
arialuni fonts/arialuni.ttf
#sc fonts/ARIALUNI.TTF
#scb fonts/ARIALUNI.TTF
#sc fonts/Everson-Mono.ttf
#scb fonts/Everson-Mono.ttf
#sc fonts/TITUSCBZ.TTF
#scb fonts/TITUSCBZ.TTF
sc fonts/DejaVuSansCondensed.ttf
scb fonts/DejaVuSansCondensed-Bold.ttf
khmer fonts/KhmerOS.ttf
jp fonts/ipag.ttf
#sc fonts/Cyberbit.ttf
#scb fonts/Cyberbit.ttf

I kept the directory structure generated by https://github.com/mapserver/basemaps (fonts.lst is in a fonts directory next to osm-google.map.

Thanks for your help.

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Sep 9, 2015

Member

please try the fix I just committed and report back

Member

tbonfort commented Sep 9, 2015

please try the fix I just committed and report back

@jbelien

This comment has been minimized.

Show comment
Hide comment
@jbelien

jbelien Sep 9, 2015

It fixed the problem !
Thanks a lot ; nice (and quick) work !

jbelien commented Sep 9, 2015

It fixed the problem !
Thanks a lot ; nice (and quick) work !

@jbelien jbelien closed this Sep 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment