I would like to add a custom font and I tried this method :
Download a .ttf file (in that case GemFont One.ttf) that I put in
data/styles folder in GeoServer.
Then I Clear Resource Cache under Server Status.
In my sld file I have :
<sld:Label>
<ogc:PropertyName>ADMIN_NAME</ogc:PropertyName>
</sld:Label>
<sld:Font>
<sld:CssParameter name="font-size">20</sld:CssParameter>
<sld:CssParameter name="font-style">GemFont
One</sld:CssParameter>
</sld:Font>
...
The problem is that the font doesn't change, I don't have my custom style
but the default style.
What's wrong ?
On Mon, Nov 11, 2013 at 10:35 AM, pascal <pascal2833@anonymised.com> wrote:
Hi,
I would like to add a custom font and I tried this method :
Download a .ttf file (in that case GemFont One.ttf) that I put in
data/styles folder in GeoServer.
Then I Clear Resource Cache under Server Status.
In my sld file I have :
<sld:Label>
<ogc:PropertyName>ADMIN_NAME</ogc:PropertyName>
</sld:Label>
<sld:Font>
<sld:CssParameter name="font-size">20</sld:CssParameter>
<sld:CssParameter name="font-style">GemFont
One</sld:CssParameter>
</sld:Font>
...
The problem is that the font doesn't change, I don't have my custom style
but the default style.
What's wrong ?
Custom fonts are picked up on startup, or whenever you press the "reload"
button
in the status page, so if you added the font after GeoServer started, you'll
have to force a reload.
Moreover, normally the name of the fond is equal to the file name.
If you go in the status page there is a link to all the available fonts,
see how it's
called there
But now I have an other problem :
I choose in the list an existing font (URW Chancery L Medium Italic) and I
try to applied it in the sld file like that but it doesn't work, I have the
default style and not the new one:
<sld:TextSymbolizer>
<sld:Label>
<ogc:PropertyName>ADMIN_NAME</ogc:PropertyName>
</sld:Label>
<sld:Font>
<sld:CssParameter name="font-size">20</sld:CssParameter>
<sld:CssParameter name="font-style">URW Chancery L Medium
Italic</sld:CssParameter>
</sld:Font>
<sld:Fill>
<sld:CssParameter name="fill">#543545</sld:CssParameter>
</sld:Fill>
</sld:TextSymbolizer>
So my question is : is it the good way to introduce a new font style or the
parameters that I have introduced (font-size, font-style) are not the good
one ?