Hello Nicolas, I believe wrap_width is in pixels as I usually work with values of around 30-40.
I'd love to see better text wrapping with *multiple* wrap characters. I was generating maps for France recently which is a country which hyphenates town names a lot (e.g. "very-long-town-name"). So, in this case I'd like to break on spaces and "-". There was some good progress in label control in (http://trac.mapnik.org/changeset/1254) but I think it fell short of multiple character breaks. I guess there may be cases where there needs to be an expression of "break before" or "break after" (as current). Previously discussed, I'd also like to see a hard break, perhaps with a C-style "\n". This would be very helpful when a label really needs to be split for some reason. e.g. ROMA (ROME) text_ratio sounds intriguing but I've never tried it as it's documented with "?". If you find out what it does, please share! Regards, Warren -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Nicolas Gillet Sent: 16 September 2009 13:37 To: [email protected] Subject: [Mapnik-users] long text wrap. Hello, I would like to have some hints about how to use xml "text_ratio" and "wrap_width" attribute. I can't find any info. :'( e.g. I have a shape file with long city names (~25 characters) and words are separated by "-" in some cases. the "wrap_character" does not seems to exist (anymore ?) in text symbolizer. Can someone telle me more about this "wrap" and "ratio". What I found is : wrap_width : * Length before wrapping long names (found in wiki) * width to wrap text at, or trigger ratio (found in text_symbolizer.hpp) ->"lenght/width" ?! what width ? in pixel ? number of characters ? another unit ? -> "or trigger ratio" so there is a link between ratio and wrap_width ... I suppose -> think that when a text is bigger than this "length" something is done but what ? ratio : * ? (found in wiki) * target ratio for text bounding box in pixels (found in text_symbolizer.hpp) Not enough for my understanding of the basic way to use them. Whatever values I tried, I didn't see any change ... :'( What I would like to do, and I think it is possible, is to set very long names on several lines eg: my-very-long-name would be : my-very- long-name And I would like to know if it is possible to have such effect for a given polygon to make it so that the text will stay inside the polygon (e.g. the name of a park would stay inside park's geometry) Thank for any answer. Regards Nicolas Gillet -- View this message in context: http://www.nabble.com/long-text-wrap.-tp25471485p25471485.html Sent from the Mapnik - Users mailing list archive at Nabble.com. _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

