10

I want to use a custom font I have downloaded from the web with Geoserver for my labels. How do I specify the location of my font so that the font-family css parameter can read it?

Geoserver 2.1.4

14

You put your custom TTF-fonts in the catalog styles which are located in your data directory.

Then you need to Clear Resource Cache under Server Status so that the font will be loaded by the server!

This is a new functionality from 2.1.x.

  • I did the above steps no luck so far, do I just specify in my sld as <sld:Font><sld:CssParameter name="font-family">"fontName".ttf</sld:CssParameter></sld:Font>? Or is there a special way of specifying? – Ando Jul 25 '12 at 0:21
  • Apolologies for the above comment, I had got the font name wrong. Also you do not require the .ttf extension. – Ando Jul 25 '12 at 0:35
3

Puting my font files (*.ttf) to (...)/geoserver/data/styles still works in version 2.6? I put files there, cleared resources cache and in full list of available fonts they don't exist.

  • Did you get this resolved? – Alex Leith Oct 7 '15 at 0:59
  • and for linux users: in addition to the /styles folder in the gdal-data directory you'll have to place fonts somewhere like /usr/java/jdk1.8.0_144/jre/lib/fonts then restart Geoserver before they're visible in the Geoserver GUI "Fonts available to JVM" – cm1 Aug 28 '18 at 16:38
1

Moving the ttf's into the data_dir of GeoServer didn't work out for me, too. So, I simply put them into C:/Windows/Fonts, cleared the ressource cache and voilà! Now they are available on GeoServer.

My environment: Windows Server 2008 R2 with GeoServer 2.10.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.