How Geoserver handles font files to point to a specific "font-family"?
I tried SimHei which under C:\windows\Fonts directory,
<Font>
<CssParameter name="font-family">SimHei</CssParameter>
<CssParameter name="font-style">Normal</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-weight">normal</CssParameter>
</Font>
but geoserver tell me,
java.io.FileNotFoundException: SimHei (系统找不到指定的文件。)
2772617 [信息] org.geotools.renderer.style.SLDStyleFactory - null input stream
2822699 [信息] org.vfny.geoserver.servlets.AbstractService - Service handled
How does geoserver find font files?
How can I make it support specified font files, for example SimHei.ttf.
Thanks in advance.
Alex
Alex Chew ha scritto:
How Geoserver handles font files to point to a specific "font-family"?
I tried SimHei which under C:\windows\Fonts directory,
<Font>
<CssParameter name="font-family">SimHei</CssParameter>
<CssParameter name="font-style">Normal</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-weight">normal</CssParameter>
</Font>
but geoserver tell me,
java.io.FileNotFoundException: SimHei (系统找不到指定的文件。)
2772617 [信息] org.geotools.renderer.style.SLDStyleFactory - null input stream
2822699 [信息] org.vfny.geoserver.servlets.AbstractService - Service handled
How does geoserver find font files?
How can I make it support specified font files, for example SimHei.ttf.
Thanks in advance.
Just checked the lookup code.
On startup, it loads the list of system fonts. This happens just once on
startup, probably when the code was written loading the system fonts list was very expensive. So one cause of the failure may be that
you added the font after Geoserver last startup.
If the font is not found among the system ones, the font name is
checked, if it starts with file:// or http:// it is assumed this is
a url or file system path to a ttf file, and an attempt to load that
file is made.
In your case, all attempts do fail. I suggest you try and restart Geoserver.
Cheers
Andrea