[Geoserver-users] Carriage returns in labels

Does geoserver support having carriage returns in labels (TextSymbolizer).

I would like to automatically label countries with their names, but need to wrap certain countries with long names such as Democratic Republic of the Congo as

Deomcratic
Republic of
the Congo

So that is fits nicely and does not clash with surrounding labels.
I have tried adding carriage returns to the attribute data in postgres, but this does not seem to make any difference.

Any tips here?

Thanks.

Jason

Jason Pickering ha scritto:

Does geoserver support having carriage returns in labels (TextSymbolizer).

I would like to automatically label countries with their names, but need to wrap certain countries with long names such as Democratic Republic of the Congo as

Deomcratic
Republic of
the Congo

So that is fits nicely and does not clash with surrounding labels.
I have tried adding carriage returns to the attribute data in postgres, but this does not seem to make any difference.

Any tips here?

This is not supported unfortunately. We just issue a graphics.drawString(...) call when drawing strings, and this one does
not split lines on carriage returns. Fixing this would not be quick either, because fixes would have to spread onto the label collision
algorithm as well (the one that avoids overlapping labels).

Anyways, can you open a jira issue requiresting this functionality?
Otherwise we'll forget about it.

Cheers
Andrea