NET-Mapnik
NET-Mapnik copied to clipboard
TextSymbolizer never wraps text
If I understand documentation correctly, TextSymbolizer should wrap every label longer than pixel-width specified in wrap-width. However, none of my labels are wrapped. I am using postgis datasource, but I even tried constant text in style XML, and result is still unwrapped. The rendered text is 3-times longer than wrap-width. Adding or removing wrap-before="true" changes nothing.
<Rule>
<MaxScaleDenominator>3000000</MaxScaleDenominator>
<MinScaleDenominator>200000</MinScaleDenominator>
<TextSymbolizer size="14" fontset-name="fontset-3" wrap-width="50" fill="#333333" halo-fill="rgba(255, 255, 255, 0.5)" halo-radius="1" halo-rasterizer="fast">"Nove mesto nad Vahom"</TextSymbolizer>
</Rule>
I created this issue also at mapnik (https://github.com/mapnik/mapnik/issues/3263), but maybe it is bug on NET-Mapnik, because I dont thing issue like this would go unnoticed by all the mapnik users?
Update: I just tried to generate the same tile (with same style XML and from same DB) with python binding over mapnik 2.2.0. and the labels are wrapped. So it is probably NET-Mapnik's issue somehow. (Didnt test it with mapnik 3.0 because no binaries are avaiable to download)
Didnt test it with mapnik 3.0 because no binaries are avaiable to download
@rouen-sk here's a 3.0.10 SDK https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-v3.0.10-x64-14.0.7z but Python bindings are not guaranteed to work as 3.x Python bindings still need some love. Use at own risk.
Thanks @BergWerkGIS . Tried it with x86 version (python import failed with 64bit dll), but could not get it to work. I always get
Mapnik LOG> 2016-03-29 10:01:54: warning: unable to find face-name 'Open Sans Bold' in FontSet 'fontset-0'
Mapnik LOG> 2016-03-29 10:01:54: warning: unable to find face-name 'DejaVu Sans Book' in FontSet 'fontset-0'
Traceback (most recent call last):
File "C:\mapnik-sdk\demo\python\rundemo2.py", line 36, in <module>
mapnik.load_map(m,"my.style.xml")
RuntimeError: no valid fonts could be loaded in FontSet 'fontset-0' in FontSet o
f 'my.style.xml'
even if I use absolute path to fonts directory in python script like
mapnik.register_fonts("c:\mapnik-sdk\lib\mapnik\fonts")
I guess this is one of the love-needing parts...