Ticket #38 (closed defect: fixed)

Opened 3 years ago

Last modified 16 months ago

Vertical Displacement of line text

Reported by: osm@… Owned by: dave
Priority: critical (top) Milestone: 1.0.0
Component: Core Library Version: SVN Trunk
Severity: Normal Keywords:
Cc: gravitystorm Patch Needs Improvement: no
Needs Docmentation: no Has Patch?: no
Design Decision Needed: no

Description

It would be nice to be able to write text along a line with a "vertical" displacement, so that a streetname could be rendered alongside the street. Similar to that for the dy attribute to point textsymbolizer.

<TextSymbolizer name="lcn_ref" face_name="DejaVu Sans Book" size="14" fill="blue" halo_radius="2" placement="line" dy="80"/>

The displacement would probably refer to the distance between the line and text path at right angles to the line, rather than a vertical displacement on the final render. The latter wouldn't work for north-south streets!

Consideration would need to be given to corners in lines, e.g. the displacement given would indicate the gap between the two paths, and would have to be maintained around the corners.

Attachments

2734.png (28.5 kB) - added by gravitystorm 3 years ago.
Image showing poor text placement
fix_1.png (67.0 kB) - added by dave 3 years ago.
New displacement handling style

Change History

Changed 3 years ago by gravitystorm

Image showing poor text placement

Changed 3 years ago by gravitystorm

  • type changed from enhancement to defect

This was made possible by [493] about five months back, but the text positioning is often sub-optimal, with characters overlapping one another and other positioning artefacts.

For example, see the attached file with three examples of the number 16 written with a dy = '5' on the TextSymbolizer. The first is correct on a straight line, the second exibits excessive spacing between characters, and the third shows characters badly overlapping. <TextSymbolizer name="lcn_ref" face_name="DejaVu Sans Book" size="14" fill="blue" halo_radius="1" placement="line" dy="5" minimum_distance="50"/>

Changed 3 years ago by gravitystorm

  • keywords gravitystorm added

Changed 3 years ago by dave

New displacement handling style

Changed 3 years ago by dave

  • owner changed from artem to dave
  • status changed from new to assigned

I've changed how displacement is done in the r597, now the same angle of displacement is applied to the whole string, instead of on a per character basis. Example: http://trac.mapnik.org/attachment/ticket/38/fix_1.png

Test and give some feedback :)

Changed 2 years ago by springmeyer

  • priority set to critical (top)

Andy, Have you had a chance to test and comment? Is Dave's r597 working for you?

Changed 2 years ago by springmeyer

  • cc gravitystorm added
  • keywords gravitystorm removed

Changed 22 months ago by springmeyer

  • has_patch unset
  • patch_need_improvement unset
  • need_documentation unset
  • design_decision_needed unset

noting here that Ticket #71 requests a related feature - line offsetting (in addition to text offsets)

Changed 20 months ago by springmeyer

  • version set to SVN Trunk
  • milestone set to 1.0.0

Changed 16 months ago by gravitystorm

  • status changed from assigned to closed
  • resolution set to fixed

I think this bug can be closed - it's been implemented and used extensively in the cycle map for a while now.

Note: See TracTickets for help on using tickets.