Configuration Options for TextSymbolizer
| name | This is the query field you want to use for the label text, e.g. "street_name" |
| face_name | Font name |
| size | Font size |
| text_ratio | ? |
| wrap_width | Length before wrapping long names |
| spacing | Space between repeated labels |
| label_position_tolerance | Allow labels to be moved from their point in line placement. Integer value representing distance along a line in line placement mode, defaults to 1/2 min_distance. |
| force_odd_labels | Force an odd amount of labels to be generated. Defaults to false. |
| max_char_angle_delta | Maximum angle (in degrees) between two consecutive characters in a label allowed (to stop placing labels around sharp corners) see r365 for more info |
| fill | Color of the text fill, e.g. #FFFFFF |
| halo_fill | Color of the text halo |
| halo_radius | Radius of the halo in whole pixels (fractional pixels are not accepted) |
| dx, dy | Displace label by fixed amount on either axis |
| avoid_edges | Boolean to avoid labeling near intersection edges |
| min_distance | Minimum distance between repeated labels such as street names or shield symbols |
| allow_overlap | Allow labels to overlap other labels |
| placement | "line" to label along lines instead of by point |
Examples
Some examples of Mapnik's ability to place text along lines:
XML
<TextSymbolizer name="FIELD_NAME" face_name="DejaVu Sans Book" size="10" fill="black" halo_fill= "White" halo_radius="1" placement="line" allow_overlap="false"/>
See XMLGettingStarted for more XML example uses of TextSymbolizer.
Python
t = TextSymbolizer('FIELD_NAME', 'DejaVu Sans Book', 10, Color('black')) t.halo_fill = Color('white') t.halo_radius = 1 t.label_placement = label_placement.LINE_PLACEMENT # POINT_PLACEMENT is default dir(t) # for the rest of the attributes
C++
FIXME

