Commit graph

33 commits

Author SHA1 Message Date
Artem Pavlenko
246731874b + apply 'mapnik-format' to *.cpp *.hpp 2010-06-02 11:03:30 +00:00
Artem Pavlenko
77c31e8643 + add orientation parameter
orientation="<expr>" e.g
  orientation="10+35" -> rotate by 45 degrees anti-clockwise
  (TODO: consider using standard SVG transform!)
2010-05-27 10:19:39 +00:00
Dane Springmeyer
c3ea59c3c8 don't pass expression_ptr as const 2010-02-03 18:36:01 +00:00
Dane Springmeyer
c950e38a46 reenamble python access to TextSymbolizer 'name' expression 2010-01-30 03:08:03 +00:00
Dane Springmeyer
6abbfca492 fix default values for vertical_alignment in the TextSymbolizer and ShieldSymbolizer - closes #468 2010-01-07 02:21:07 +00:00
Artem Pavlenko
47dc1e197b + merge mapnik2 to trunk 2009-12-16 20:02:06 +00:00
Dane Springmeyer
c01d1d0c69 integrate a few changes from mapnik2 branch - making sure to pass strings by const ref + formatting 2009-12-07 04:15:17 +00:00
Artem Pavlenko
a3a5859466 Patch from David Eastcott :
1.  Modified Text Symbolizer

  a) corrected line fragment centering (for 2nd and subsequent lines, when line breaks occur).

  b) adjusted vertical alignment calculation so that:
      i)      middle -> has the center of the text line(s) at the point origin
      ii)     bottom -> has the text line(s) below the point origin
      iii)    top -> has the text line(s) above the point origin

  c) added new text_symbolizer attribute: 'wrap_before', value range: true/false, default == false

     allows line breaks at first wrap_char before wrap_width as an alternative to the original
     which was to create the line break at the first wrap_char after wrap_width

  d) added new text_symbolizer attribute: 'horizontal_alignment', value range: left/middle/right, default == middle
      i)      left -> has all text line(s) to left of the point origin
      ii)     middle -> has all text line(s) centered on the the point origin
      iii)    right -> has all text line(s) to the right of the point origin

      NOTE:   dx, dy position adjustments are applied after alignments and before Justify.

  e) added new text_symbolizer attribute: 'justify_alignment', value range: left/middle/right, default == middle
      i)      left -> after alignments, has all text line(s) are left justified (left to right reading)
      ii)     middle -> after alignments, has all text line(s) center justified
      iii)    right -> after alignments, has all text line(s) right justified (right to left reading)

  f) added new text_symbolizer attribute:  'opacity', value range: 0.0 thru 1.0; 1.0 == fully opaque

  g) modified positioning to compensate for both line_spacing and character_spacing, to ensure proper
     centering of the text envelope.  Also ensure that centering occurs correctly even if no wrapping
     occurs.  Line spacing is uniform and consistent and compensates for errors between text_size and
     the actual size (ci.height is inconsistent, depending on case and character); fixes issue with
     multi-line text where some lines have a slight gap and others are compressed together.


2.  Modified shield_symbolizer

  a) added the attributes:
      i)      allow_overlap
      ii)     vertical_alignment
      iii)    horizontal_alignment
      iv)     justify_alignment
      v)      wrap_width
      vi)     wrap_character
      vii)    wrap_before
      viii)   text_convert
      ix)     line_spacing
      x)      character_spacing
      xi)     opacity

  b)  added new shield_symbolizer attribute: 'unlock_image', value range: true/false, default == false
      i)  false == image and text placement behaviour same as before
      ii) true == image placement independant of text, image is always centered at geometry point, text placed per attributes,
                  dx/dy only affect text.

      Allows user to create point markers with text, but both the text and image rendering collision detection are done
      as a pair (they come and go together - solves problem if using point_symbolizer and text_symbolizers where one or the
      other are omitted due to overlaps, but not both)

  c)  extended choices for the attribute 'placement' to include vertex; effect is limited to the shield_symbolizer

      Allows an attempted placement at every vertex available, gives additional shield placement volume when using line geometry

  d)  ensured that the text placement was not updating the detector unless a shield image was actually placed.

  e)  added new shield_symbolizer attribute: 'no_text', value range: true/false, default = false

      When set true, the text for the feature is ignored ('space' subsituted) so that pure graphic symbols can be used
      and no text is rendered over top of them.
2009-10-19 13:52:53 +00:00
Dane Springmeyer
d9d15bb081 avoid segfault when pickling a TextSymbolizer using wrap_character by removing const declaration 2009-09-25 20:29:03 +00:00
Dane Springmeyer
e897b832a4 +reflect new text symbolizer options added in r1254 - closes #391 2009-08-17 22:54:50 +00:00
Artem Pavlenko
85ecc33d7f + applied patch from Jochen Topf :
* text_convert="none|toupper|tolower"
 Convert all text to upper/lower case before rendering. "none" doesn't do
 anything with the text and is the default. Works for labels along lines
 or at points.

* line_spacing="<number>"
 Add this many pixels space between two lines in text labels that have
 been broken into several lines. Default is 0. Doesn't do anything for
 labels along lines.

* character_spacing="<number>"
 Add this many pixels space between two characters in a text. Default is 0.
 Currently only works for text labels on point geometries. This should
 also be implemented for labels along lines, but I'll leave that for
 another day.

* wrap_character="<character>"
 Instead of breaking text into lines on spaces, use this character. This
 is useful, when you want to make sure that labels are broken at the right
 spot. Note that you'll probably want to make wrap_width small so that
 your lines are actually broken, otherwise you'll see the wrap_character
 in the output. Default is ' ' (space). Doesn't do anything for labels
 along lines.
2009-07-20 15:30:19 +00:00
Dane Springmeyer
e7457a139a +add pickle support to text_symbolizer, improve support for stroke, and add tests for stroke and text pickling via python - see: #345 2009-05-26 01:50:58 +00:00
Lucio Asnaghi
158989fc56 + fix text_symbolizer support for vertical_alignment in save_map() (closes #328) 2009-04-28 21:23:43 +00:00
Artem Pavlenko
10f55a678b + add support for vertical_alignment (text_symbolizer)
valid values are : top, middle, bottom
  default to middle which can now center multi-line text
2009-03-30 20:47:26 +00:00
Artem Pavlenko
a45e93b79a + more property goodness on the TextSymbolizer from Python (springmeyer) 2009-02-05 11:54:07 +00:00
Artem Pavlenko
a07767ef3d + (c++) renamed mapnik::Color to mapnik::color
+ (c++) added mapnik::color ctor from named colours (TODO: consider not to export color_factory) 
+ (Python) fixed pickling
+ (Python) added to_hex_string method
2009-01-14 12:10:24 +00:00
Artem Pavlenko
1b47afde07 applied font fallback patch from Beau Gunderson 2008-06-29 10:58:48 +00:00
Artem Pavlenko
3f9127b5d0 reverting back to 700 2008-06-29 10:58:29 +00:00
Artem Pavlenko
3275cf9ce6 applied font fallbacj patch from Beau Gunderson 2008-06-29 10:40:08 +00:00
David
bc54b150ea - reversed header include order 2007-10-08 17:42:41 +00:00
David
b2df387a9d - merged strict-xml-branch r530:532 to trunk:
- libxml2 support
    - strict error handling while parsing XML map files
    - implemented save_map()
    - removed some duplicate defaults
    - all symbolizers with icons share a common base class now
2007-09-25 18:47:12 +00:00
vspader
9fe4a94c98 Added minimum_distance property to text symbolizers. This prevents the same label from appearing within N pixels (across features).
Shield symbolizer is now a subclass of text symbolizer.
Some small improvements to text rendering.
Fixed up placement finder for horizontal placement.
Cleaned up placement finder.
2007-07-02 13:39:08 +00:00
Artem Pavlenko
f3ae318ca3 1. added 'allow_overlap' in load_map from xml
2. added overlap_ field to TextSymbolizer (ignored by renderer at the moment)
2007-06-20 21:08:23 +00:00
Artem Pavlenko
d024c86b1b Restored support for the text displacement (point placement only at moment) 2007-02-09 16:32:44 +00:00
Artem Pavlenko
8c374a22a6 Label position tolerance and text spacing patch from David Leaver. Thanks! 2006-11-29 10:44:42 +00:00
vspader
d7b94f5d8c Added avoid_edges property to shield and text symbolizers.
If this is enabled, no shield/text symbolizers will be cut off
at the edges of the image.
2006-11-17 14:07:41 +00:00
Artem Pavlenko
889ac41694 Patch from Toby: adds a maximum angle delta for text placement (if the
angle changes too much between characters it finds an alternate
placement), this is specified in the max_char_angle_delta property in
radians (feel free to change it to degrees).

It also improves the text placement around corners trying to minimise
the distance between the center of the character and the line on each
side. This is the major portion of the patch.
2006-11-04 10:38:24 +00:00
Artem Pavlenko
e924b597f4 1. patch from Toby that allows repeated labels to be placed on a line
geometry (such as roads)
2. restored text labels for point geometry.
3. process 'spacing' attribute in load_map.cpp
2006-11-01 23:17:05 +00:00
Artem Pavlenko
d7fcefc848 1. applied text-wrap patch from Robert Coup. Thanks!
2. by default use tinyxml as a property_tree parser
3. modified load_map.cpp to allow to test new features
2006-10-27 17:29:39 +00:00
vspader
118e8f0d52 Added face_name parameter to text and shield symbolizers,
which specifies the font face to be used for rendering.
New constructor is: text_symbolizer(name, face_name, size, ...)
2006-10-19 17:11:45 +00:00
Artem Pavlenko
992af4747d 1. move include to mapnik/include
2. update demos,bibdibgs etc.
2006-10-04 11:22:18 +00:00
Artem Pavlenko
61fd258fd1 changing licence from GPL to LGPL 2006-03-31 10:32:02 +00:00
Artem Pavlenko
89cad86d8e added anchor and displacement to text_symbolizer 2006-03-10 12:08:55 +00:00