[mapserver-dev] Enhancement to RFC-40 conditional wrapping

Steve Lime Steve.Lime at dnr.state.mn.us
Fri Feb 27 00:36:17 EST 2009


I kinda like WRAPEOL since it pretty accurately describes what it's
doing,
using that value\n instead of \n. It would allow you to preserve the
wrap
character if WRAP = WRAPEOL. Another topic for 6.0 next week.

Steve

>>> Daniel Morissette <dmorissette at mapgears.com> 02/25/09 9:46 AM >>>
In RFC-40, we added the ability to do conditional wrapping, that is 
wrapping labels only if they exceed a specified length:

http://mapserver.org/development/rfc/ms-rfc-40#line-wrapping

One of our users reported a problem with labels such as 
"Notre-Dame-du-Rosaire" or "Saint-Pierre-de-la-Rivière-du-Sud"... I 
didn't make up those names, municipality names in Quebec all use 
hyphens, and some are very long and can sound quite "interesting".

Anyway, the problem is that when we use conditional wrapping on those 
labels, using the hyphen as the wrap character, we end up with something

like:

   Notre-Dame
   du-Rosaire

we lose the second hyphen. What we would like to get is:

   Notre-Dame-
   du-Rosaire

Thinking about this some more, I realized that in the case of 
hard-wrapping (maxlength < 0) we may want the ability to insert a hyphen

at the end of each line. It's not that simple in French, but in English 
one could wrap "someveryverylongword" and expect:

   someveryve-
   rylongword

Perhaps the solution to both problems would be to add the ability to 
specify a character to insert at the end of each line? Not sure what to 
call it... WRAPTEXT, WRAPEOL, WRAPMARK, ???

Or another more scalable option could be to add a WRAPMODE param, with 
the different modes being
  - wrap on each instance of the WRAP char
  - conditional wrap on maxlength
  - hard wrap on maxlength
  - and for each case above, insert or not a hyphen (or other char) at 
end of line, or keep the wrap char there instead of removing it from the

string

Thought, better solutions?

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list