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

Daniel Morissette dmorissette at mapgears.com
Wed Feb 25 10:45:45 EST 2009


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/


More information about the mapserver-dev mailing list