Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

When publishing a WMS in geoserver using a custom SLD file, I'm seeing the WMS preview correctly on my local geoserver. However, doing everything the same on a remote hosted geoserver, my seeing an incorrect font family displayed.

Local geoserver version (open geo suite community edition) = Version 2.1-SNAPSHOT, Subversion Revision -1, Build Date 24-May-2012 21:47, GeoTools Version 2.7-SNAPSHOT (rev -1)

Remote geoserver version = Version: 2.1.4 Subversion Revision: 17150 Build Date: 01-Jun-2012 17:02 GeoTools Version: 2.7.5 (rev 38793)

What I’ve done:

  • I’ve downloaded and used an SLD file to style some points with some labels. I got the SLD from the Geoserver SLD cookbook here, modified the sld (code below) to read my shape file field ‘myname’ in the this shape file
  • I’ve added the sld in both the local and remote geoserver instances using the browse to file, upload, validate and submit options in the styles menu.
  • I’ve created a new workspace, datastore and published a WMS layer via both my local and remote Geoserver. I’ve selected the correct sld when publishing the layers.
  • The Problem = the remote Geoserver layer preview is not displaying the font family (arial) that is specified in my SLD file. See screeshots below of the previews from the local (correct font) and remote (incorrect font) geoservers respectively:

enter image description here enter image description here

<?xml version="1.0" encoding="ISO-8859-1"?>    
<StyledLayerDescriptor version="1.0.0" 
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
xmlns="http://www.opengis.net/sld" 
xmlns:ogc="http://www.opengis.net/ogc" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Point with styled label</Name>
<UserStyle>
<Title>GeoServer SLD Cook Book: Point with styled label</Title>
<FeatureTypeStyle>
<Rule>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
</Mark>
<Size>6</Size>
</Graphic>
</PointSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>myname</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">12</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.0</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>0</DisplacementX>
<DisplacementY>5</DisplacementY>
</Displacement>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
share|improve this question

1 Answer 1

up vote 3 down vote accepted

I think it's most likely due to the server not having the MS Windows fonts installed and available to the JVM. I think you can see a list of available fonts from the Server Status page of the GeoServer admin console. You should also be able to install additional fonts, see here: How do I use use custom fonts for labelling in Geoserver?.

Cheers,

Matt.

share|improve this answer
1  
Cheers - that worked a treat, am previewing labelling in Arial. Although, after clearing the Resource Cache. I still have the same number of fonts installed as before, which does not include Arial. This must read the JVM installed fonts only. –  SamFranklin Aug 10 '12 at 7:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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