1

Is it possible to print ttf's in an SLD using mapfish-print?

<GraphicFill>
    <Graphic>
        <Opacity>1</Opacity>
        <Size>25</Size>
        <Mark>
            <WellKnownName>ttf://my_font#32</WellKnownName>
            <Fill>
                <CssParameter name="fill">#1F1FCD</CssParameter>
            </Fill>
            <Stroke>
                <CssParameter name="stroke">#1F1FCD</CssParameter>
                <CssParameter name="stroke-width">1</CssParameter>
            </Stroke>
        </Mark>
    </Graphic>
</GraphicFill>

This is how it works on Geoserver already. In mapfish it works with Shape symbols like shape://slash but not with the Bulk TTF marks. How could it do this?


Versions

  • Mapfish 3.10.2
  • Geoserver: 2.14.0
  • Geotools: 20.0

Log

Request: getServiceInfo
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - CRSConverter: Converting object of class java.lang.String to org.opengis.referencing.crs.CoordinateReferenceSystem
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,790 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - number of fts set 13
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - number of fts set 13
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:05,791 TRACE [org.geotools.styling] - ENTRY
--- following part 4x ---
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:05,791 TRACE [org.geotools.styling] - ENTRY
-------------------------
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:05,791 DEBUG [org.geotools.styling] - StyleImpl added 13 feature types
--- following part 7x ---
2019-03-08 22:31:05,792 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,792 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
-------------------------
2019-03-08 22:31:05,792 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:05,792 TRACE [org.geotools.styling] - ENTRY
2019-03-08 22:31:05,792 DEBUG [org.geotools.styling] - creating defaultMark
--- following part 8x ---
2019-03-08 22:31:05,792 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,792 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
-------------------------
2019-03-08 22:31:05,792 DEBUG [org.geotools.rendering] - Computed scale denominator: 49999.99999999999
2019-03-08 22:31:05,792 DEBUG [org.geotools.styling] - number of fts set 1
2019-03-08 22:31:05,792 DEBUG [org.geotools.rendering] - creating rules for scale denominator - 50'000
--- following part 7x ---
2019-03-08 22:31:05,792 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,792 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
-------------------------
2019-03-08 22:31:05,793 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:05,793 TRACE [org.geotools.styling] - ENTRY
2019-03-08 22:31:05,793 DEBUG [org.geotools.styling] - creating defaultMark
--- following part 8x ---
2019-03-08 22:31:05,793 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,793 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
-------------------------
2019-03-08 22:31:05,793 DEBUG [org.geotools.rendering] - Processing 1 stylers for http://myApp:layer_name_1
2019-03-08 22:31:05,793 DEBUG [org.geotools.rendering] - Querying layer http://myApp:layer_name_1 with bbox: ReferencedEnvelope[2727972.0000000005 : 2728308.0000000005, 1270452.0000000002 : 1270788.0000000002]
2019-03-08 22:31:05,793 DEBUG [org.geotools.jdbc] - CREATE CONNECTION
2019-03-08 22:31:05,793 DEBUG [org.geotools.filter] - exporting LogicFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,794 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting NullFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting SQL ComparisonFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting SQL ComparisonFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting LogicFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting SQL ComparisonFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,794 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting SQL ComparisonFilter
2019-03-08 22:31:05,794 DEBUG [org.geotools.filter] - exporting PropertyName
2019-03-08 22:31:05,794 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:05,794 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation only.
2019-03-08 22:31:05,794 DEBUG [org.geotools.jdbc] - SELECT someSqlStuff
2019-03-08 22:31:05,794 DEBUG [org.geotools.jdbc] - 1 = POLYGON ((2727972.0000000005 1270452.0000000002, 2727972.0000000005 1270788.0000000002, 2728308.0000000005 1270788.0000000002, 2728308.0000000005 1270452.0000000002, 2727972.0000000005 1270452.0000000002))
2019-03-08 22:31:05,794 DEBUG [org.geotools.jdbc] - 2 = myApp
2019-03-08 22:31:05,794 DEBUG [org.geotools.jdbc] - 3 = CH
2019-03-08 22:31:05,794 DEBUG [org.geotools.jdbc] - 4 = 744
2019-03-08 22:31:05,794 DEBUG [org.geotools.jdbc] - 5 = 1035
2019-03-08 22:31:05,802 DEBUG [org.geotools.jdbc] - CLOSE CONNECTION
2019-03-08 22:31:05,802 DEBUG [org.geotools.renderer.label] - TOTAL LINE LABELS : 0
2019-03-08 22:31:05,802 DEBUG [org.geotools.renderer.label] - PAINTED LINE LABELS : 0
2019-03-08 22:31:05,802 DEBUG [org.geotools.renderer.label] - REMAINING LINE LABELS : 0
2019-03-08 22:31:05,802 DEBUG [org.geotools.rendering] - Style cache hit ratio: NaN , hits 0, requests 0
2019-03-08 22:31:05,802 INFO [org.geoserver.wms] -
Request: getFeatureInfo
    BaseUrl = http://myByUrl:80/
    Exceptions = application/vnd.ogc.se_xml
    FeatureCount = 20
    Get = false
    GetMapRequest =
GetMap Request
 version: 1.3.0
 output format: image/png
 width height: 512,512
 bbox: SRSEnvelope[2721056.0 : 2728224.0, 1263984.0 : 1271152.0]
 layers: myApp:layer_name_1
 styles: style_213
    InfoFormat = application/json
    PropertyNames = [[name1, name2, name3, name4, ...]]
    QueryLayers = [org.geoserver.wms.MapLayerInfo@d87fb7ef]
    RawKvp = ...
    Request = GetFeatureInfo
    RequestCharset = null
    Version = 1.3.0
    XPixel = 506
    YPixel = 38
2019-03-08 22:31:05,803 INFO [org.geoserver.wfs.json] - about to encode JSON
2019-03-08 22:31:06,161 INFO [org.geoserver.wms] -
Request: getServiceInfo
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - CRSConverter: Converting object of class java.lang.String to org.opengis.referencing.crs.CoordinateReferenceSystem
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:06,162 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:06,162 DEBUG [org.geotools.styling] - number of fts set 29
2019-03-08 22:31:06,163 DEBUG [org.geotools.styling] - number of fts set 29
2019-03-08 22:31:06,163 DEBUG [org.geotools.styling] - creating defaultMark
--- following part 27x ---
2019-03-08 22:31:06,163 TRACE [org.geotools.styling] - ENTRY
2019-03-08 22:31:06,163 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:06,163 DEBUG [org.geotools.styling] - creating defaultMark
-------------------------
2019-03-08 22:31:06,164 TRACE [org.geotools.styling] - ENTRY
2019-03-08 22:31:06,164 DEBUG [org.geotools.styling] - creating defaultMark
2019-03-08 22:31:06,164 DEBUG [org.geotools.styling] - StyleImpl added 29 feature types
2019-03-08 22:31:06,164 INFO [org.geoserver.wms] -
Request: getFeatureInfo
    BaseUrl = http://myByUrl:80/
    Exceptions = application/vnd.ogc.se_xml
    FeatureCount = 20
    Get = false
    GetMapRequest =
GetMap Request
 version: 1.3.0
 output format: image/png
 width height: 512,512
 bbox: SRSEnvelope[2721056.0 : 2728224.0, 1263984.0 : 1271152.0]
 layers: myApp:layer_name_1
 styles: style_148-286
    InfoFormat = application/json
    PropertyNames = [[name1, name2, name3, name4, ...]]
    QueryLayers = [org.geoserver.wms.MapLayerInfo@558cdfe9]
    RawKvp = ...
    Request = GetFeatureInfo
    RequestCharset = null
    Version = 1.3.0
    XPixel = 506
    YPixel = 38
2019-03-08 22:31:06,164 INFO [org.geoserver.wfs.json] - about to encode JSON
2019-03-08 22:31:10,326 INFO [org.geoserver.wms] -
Request: getServiceInfo
2019-03-08 22:31:10,326 INFO [org.geoserver.wms] -
Request: getServiceInfo
2019-03-08 22:31:10,327 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:10,327 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:10,327 DEBUG [org.geotools.util] - CRSConverterFactory can be applied from Strings to CRS  only.
2019-03-08 22:31:10,327 DEBUG [org.geotools.util] - InterpolationConverterFactory can be applied from Strings to Interpolation  only.
2019-03-08 22:31:10,329 TRACE [org.geotools.factory] - ENTRY  (GridCoverageFactory)
2019-03-08 22:31:10,329 TRACE [org.geotools.factory] - RETURN (GridCoverageFactory): found implementation Optional.
2019-03-08 22:31:10,329 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@3a9af610
2019-03-08 22:31:10,329 TRACE [org.geotools.factory] - ENTRY  (GridCoverageFactory)
2019-03-08 22:31:10,329 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@3a9af610
2019-03-08 22:31:10,329 TRACE [org.geotools.factory] - RETURN (GridCoverageFactory): found implementation Optional.
2019-03-08 22:31:10,329 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@3a9af610
2019-03-08 22:31:10,329 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@3a9af610
2019-03-08 22:31:10,329 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@3a9af610
2019-03-08 22:31:10,329 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Rendering using interpolation javax.media.jai.InterpolationBilinear@3a9af610
...
2019-03-08 22:31:10,330 TRACE [org.geotools.index.quadtree] - QuadTree opened
...
2019-03-08 22:31:10,330 TRACE [org.geotools.gce.imagemosaic] - Adjusted Requested Envelope = ReferencedEnvelope[2749970.5 : 2750040.5, 1242959.5 : 1243029.5]
Requested raster dimension = java.awt.Rectangle[x=0,y=0,width=70,height=70]
Corresponding raster source region = java.awt.Rectangle[x=0,y=0,width=70,height=70]
Corresponding source Envelope = ReferencedEnvelope[2749970.5 : 2750040.5, 1242959.5 : 1243029.5]
2019-03-08 22:31:10,330 DEBUG [org.geotools.data.shapefile] - Empty results for 2, skipping read
2019-03-08 22:31:10,330 DEBUG [org.geotools.gce.imagemosaic] - Loading level 0 with subsampling factors 1 1
...
2019-03-08 22:31:10,330 TRACE [org.geotools.data.shapefile] - IndexFile has been closed. Number open: 0
2019-03-08 22:31:10,330 DEBUG [org.geotools.gce.imagemosaic] - Prepping to manage SortBy Clause
2019-03-08 22:31:10,330 TRACE [org.geotools.gce.imagemosaic] - Adjusted Requested Envelope = ReferencedEnvelope[2749970.5 : 2750040.5, 1242959.5 : 1243029.5]
Requested raster dimension = java.awt.Rectangle[x=0,y=0,width=70,height=70]
Corresponding raster source region = java.awt.Rectangle[x=0,y=0,width=70,height=70]
Corresponding source Envelope = ReferencedEnvelope[2749970.5 : 2750040.5, 1242959.5 : 1243029.5]
2019-03-08 22:31:10,330 DEBUG [org.geotools.gce.imagemosaic] - Loading level 0 with subsampling factors 1 1
2019-03-08 22:31:10,330 DEBUG [org.geotools.gce.imagemosaic.catalog] - Index Loaded
2019-03-08 22:31:10,330 DEBUG [org.geotools.gce.imagemosaic] - Prepping to manage SortBy Clause
...
2019-03-08 22:31:10,330 DEBUG [org.geotools.gce.imagemosaic.catalog] - Index Loaded
...
2019-03-08 22:31:10,330 TRACE [org.geotools.data.shapefile] - IndexFile has been opened. Number open: 1
...
2019-03-08 22:31:10,330 TRACE [org.geotools.data.shapefile] - Reading from file...
2019-03-08 22:31:10,330 TRACE [org.geotools.data.shapefile] - IndexFile has been opened. Number open: 1
...
2019-03-08 22:31:10,330 TRACE [org.geotools.index.quadtree] - QuadTree opened
...
2019-03-08 22:31:10,330 DEBUG [org.geotools.data.shapefile] - Empty results for 2, skipping read
...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - IndexFile has been closed. Number open: 0
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic] - Unable to load any granuleDescriptor
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic] - We got no granules, let's do a dry run with no filters
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic.catalog] - Index Loaded
...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - IndexFile has been opened. Number open: 1
...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - Reading from file...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - Reading from file...
2019-03-08 22:31:10,331 TRACE [org.geotools.index.quadtree] - QuadTree opened
...
2019-03-08 22:31:10,331 DEBUG [org.geotools.data.shapefile] - Empty results for 2, skipping read
...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - IndexFile has been closed. Number open: 0
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic] - Unable to load any granuleDescriptor
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic] - We got no granules, let's do a dry run with no filters
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic.catalog] - Index Loaded
...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - IndexFile has been opened. Number open: 1
...
2019-03-08 22:31:10,331 TRACE [org.geotools.index.quadtree] - QuadTree opened
...
2019-03-08 22:31:10,331 DEBUG [org.geotools.data.shapefile] - Empty results for 2, skipping read
...
2019-03-08 22:31:10,331 TRACE [org.geotools.data.shapefile] - IndexFile has been closed. Number open: 0
2019-03-08 22:31:10,331 DEBUG [org.geotools.gce.imagemosaic] - Creating constant image for area with no data
2019-03-08 22:31:10,332 DEBUG [org.geotools.gce.imagemosaic] - Support for alpha on final mosaic
2019-03-08 22:31:10,332 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Applying Raster Symbolizer
--- following part 8x ---
2019-03-08 22:31:10,332 TRACE [org.geotools.factory] - ENTRY  (GridCoverageFactory)
2019-03-08 22:31:10,332 TRACE [org.geotools.factory] - RETURN (GridCoverageFactory): found implementation Optional.
-------------------------
2019-03-08 22:31:10,334 INFO [org.geoserver.wms] -
...
2019-03-08 22:31:10,334 DEBUG [org.geotools.image] - Encoding input image to write out as JPEG.
2019-03-08 22:31:10,334 DEBUG [org.geotools.image] - Getting a JPEG writer and configuring it.
2019-03-08 22:31:10,335 DEBUG [org.geotools.image] - Writing out...
2019-03-08 22:31:10,335 DEBUG [org.geotools.image] - Writing out... Done!
2019-03-08 22:31:10,337 TRACE [org.geotools.data.shapefile] - Reading from file...
2019-03-08 22:31:10,337 TRACE [org.geotools.index.quadtree] - QuadTree opened
...
2019-03-08 22:31:10,337 DEBUG [org.geotools.data.shapefile] - Empty results for 2, skipping read
...
2019-03-08 22:31:10,337 TRACE [org.geotools.data.shapefile] - IndexFile has been closed. Number open: 0
2019-03-08 22:31:10,337 DEBUG [org.geotools.gce.imagemosaic] - Creating constant image for area with no data
2019-03-08 22:31:10,337 DEBUG [org.geotools.gce.imagemosaic] - Support for alpha on final mosaic
2019-03-08 22:31:10,338 DEBUG [org.geotools.renderer.lite.gridcoverage2d] - Applying Raster Symbolizer
--- following part 8x ---
2019-03-08 22:31:10,338 TRACE [org.geotools.factory] - ENTRY  (GridCoverageFactory)
2019-03-08 22:31:10,338 TRACE [org.geotools.factory] - RETURN (GridCoverageFactory): found implementation Optional.
-------------------------
2019-03-08 22:31:10,339 INFO [org.geoserver.wms] -
...
2019-03-08 22:31:10,340 DEBUG [org.geotools.image] - Encoding input image to write out as JPEG.
2019-03-08 22:31:10,340 DEBUG [org.geotools.image] - Getting a JPEG writer and configuring it.
2019-03-08 22:31:10,340 DEBUG [org.geotools.image] - Writing out...
2019-03-08 22:31:10,341 DEBUG [org.geotools.image] - Writing out... Done!
  • Please add version numbers and the relevant part of the log file on GeoTools debug level. – Ian Turton Mar 8 at 18:02
  • I added the versions and the log file part. I removed those parts which were same as in the working shape://slash example. If you need more information, I will try to add it. – Meyra Mar 8 at 22:48
0

To print custom fonts you have to put them in the mapfish-spring-custom-fonts.xml https://github.com/mapfish/mapfish-print/blob/74f0bdd74d2c8932c0afae5782a9edd95f1b4678/core/src/main/resources/mapfish-spring-custom-fonts.xml

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.