Update configuration options.

herm 2013-04-24 16:13:16 -07:00
parent 5b895f5560
commit 6ce0b5b405

@ -1,43 +1,43 @@
## Configuration Options for TextSymbolizer ## Configuration Options for TextSymbolizer
| *parameter* | *values/ type* | *description* | *unit* | *default* | *version* |
| *parameter* | *value* | *description* | *unit* | *default* | *version* |
----------------|---------|----------------|-------|------------|---------| ----------------|---------|----------------|-------|------------|---------|
| name | - | This is the query field you want to use for the label text, e.g. "street_name" (deprecated in Mapnik2, see section "new syntax" below)| - | - | | name|expression|This is the query field you want to use for the label text, e.g. "street_name" (deprecated in Mapnik2, see section "new syntax" below)| | |
|face-name | - | Font name (see [[UsingCustomFonts]])| - | - | |face-name|string| Font name (see [[UsingCustomFonts]])| | |
|fontset-name|| FontSet name || |fontset-name|string| FontSet name ||
|size||Font size||| |size|double|Font size|px|10.0|
|text-ratio|| Try to keep a given height to width ratio||| |text-ratio|double| Try to keep a given height to width ratio. Use 0 to disable this feature.|ratio|0|
|wrap-character||Use this character instead of a space to wrap long names||| |wrap-character|char|Use this character instead of a space to wrap long names. (Harfbuzz branch ignores this and uses Unicode rules for line breaks.)|||
|wrap-width||Length before wrapping long names|px|0| |wrap-width|double|Length before wrapping long names. Use 0 to disable this feature.|px|0|
|wrap-before||Wrap text before wrap-width is reached. If this setting is off your lines will always be a bit longer than wrap-width. If this setting is on the lines will usually be a bit shorter, but can be longer if there is a single word that is longer than your current line limit.||| |wrap-before|true,false|Wrap text before wrap-width is reached. If this setting is off your lines will always be a bit longer than wrap-width. If this setting is on the lines will usually be a bit shorter, but can be longer if there is a single word that is longer than your current line limit.|||
|text-transform||Allows conversion of text to lower or upper case before display. Values are "none", "uppercase", "lowercase" and "capitalize". || "none" | |text-transform|none, uppercase, lowercase, capitalize|Allows conversion of text to lower or upper case before display.|| "none" |
|line-spacing||Vertical spacing between lines of multiline labels. This spacing is in addition to the normal font line spacing|px|0| |line-spacing|double|Vertical spacing between lines of multi-line labels. This spacing is in addition to the normal font line spacing|px|0|
|character-spacing||Additional horizontal spacing between characters. Currently works for point placement only, not line placement. You will get the normal spacing defined by the font plus this amount of extra space. |px|0| |character-spacing|double|Additional horizontal spacing between characters. Currently works for point placement only, not line placement. You will get the normal spacing defined by the font plus this amount of extra space. (Also works for line placements in harfbuzz branch.)|px|0|
|spacing||Space between repeated labels. If spacing is 0 only one label is placed.|px|0| |spacing|double|Space between repeated labels. If spacing is 0 only one label is placed.|px|0|
|label-position-tolerance||Allow labels to be moved from their point in line placement. Lower values indicate that Mapnik tries less positions and generally leads to fewer labels. Higher values lead to Mapnik trying more different positions along a line to find a free spot. If unset or 0, Mapnik sets this value based on the total length of the line to ensure enough labels are placed.||| |label-position-tolerance|double|Allow labels to be moved from their point in line placement. Lower values indicate that Mapnik tries less positions and generally leads to fewer labels. Higher values lead to Mapnik trying more different positions along a line to find a free spot. If unset or 0, Mapnik sets this value based on the total length of the line to ensure enough labels are placed.|?|0|
|force-odd-labels||Force an odd amount of labels to be generated.|bool|false| |force-odd-labels|true, false|Force an odd amount of labels to be generated.|bool|false|
|max-char-angle-delta||Maximum angle (in degrees) between two consecutive characters in a label allowed. The lower the number the fewer labels placed - this is to stop placing labels around sharp corners. See r365 for more info||| |max-char-angle-delta|duble|Maximum angle (in degrees) between two consecutive characters in a label allowed. The lower the number the fewer labels placed - this is to stop placing labels around sharp corners.|degree|22.5|
|fill||Color of the text fill, e.g. #FFFFFF||| |fill|color|Color of the text fill, e.g. #FFFFFF||black|
|halo-fill||Color of the text halo||| |halo-fill|color|Color of the text halo||white|
|halo-radius||Radius of the halo in whole pixels (fractional pixels are not accepted)|px|| |halo-radius|double|Radius of the halo in pixels (Fractional pixels are accepted. See halo-rasterizer for limitations.)|px|0|
|dx, dy||Displace label by fixed amount on either axis. Also see note at vertical-alignment|px|0.0| |halo-rasterizer|fast, full|(Only for AGG renderer) Choose between good and fast halo rasterizer. Both produce equally good results for halo-radius <= 1.0. Only full rasterizer supports fractional values > 1.0. Other values are truncated by fast rasterizer (e.g. 1.8px = 1px). [Visual comparision](https://raw.github.com/mapnik/mapnik/master/tests/visual_tests/images/text-halo-rasterizer-600-400-1.0-agg-reference.png)||full|git only (2013-04-25)|
|avoid-edges||Boolean to avoid labeling near intersection edges||| |dx, dy|double|Displace label by fixed amount on either axis. Actual displacement also depends on vertical-alignment and horizontal-alignment|px|0.0|
|minimum-distance||Minimum distance between repeated labels such as street names or shield symbols (works across features)|px|0.0| |avoid-edges|true, false|Boolean to avoid labeling near intersection edges|bool|false|
|allow-overlap||Allow labels to overlap other labels - Note: you can also clear the label collision cache at the LAYER level to promote more overlap. See 'clear_label_cache' at [[XMLConfigReference]] part layer|bool|false| |minimum-distance|double|Minimum distance between repeated labels such as street names or shield symbols (works across features)|px|0.0|
|placement||"line" to label along lines instead of by point||| |allow-overlap|true, false|Allow labels to overlap other labels - Note: you can also clear the label collision cache at the LAYER level to promote more overlap. See 'clear_label_cache' at [[XMLConfigReference]] part layer|bool|false|
|vertical-alignment||Position of label relative to point position ("top" (label on top of point), "middle", "bottom", "auto") "auto" is "middle" for dy=0, "bottom" for dy>0, "top" for dy<0||auto| |placement|line, point, vertex, interior|"line" to label along lines instead of by point. TODO: Document other options.||point|
|horizontal-alignment||Position of label relative to point position ("left, "middle", "right", "auto")||auto| |vertical-alignment|top, middle, bottom, auto|Position of label relative to point position. "auto" is "middle" for dy=0, "bottom" for dy>0, "top" for dy<0||auto|
|justify-alignment||Justify multi-line text ("left, "middle", "right", "auto")||auto| |horizontal-alignment|left, middle, right, auto|Position of label relative to point position||auto|
|opacity||1 is fully opaque while zero is fully transparent and .5 would be 50% transparent|-|1| |justify-alignment|left, middle, right, "auto|Justify multi-line text||auto|
|minimum-padding||if >0 helps prevents a label (or shield) from being placed too near the edge of the map. |px|0.0| |opacity|double|1 is fully opaque while zero is fully transparent and .5 would be 50% transparent||1|
|minimum-path-length||place labels only on paths longer than this value.|px|0.0| |minimum-padding|double|if >0 helps prevents a label (or shield) from being placed too near the edge of the map.|px|0.0|
|orientation||Rotate text|degree|0| |minimum-path-length|double|place labels only on paths longer than this value.|px|0.0|
|placement-type||Placement finder algorithm. Currently supported: "dummy" (do nothing), "simple" (automatically create new positions using a simple configuration; see below) and "list" (mapnik >=2.1, see below)|string|"dummy"|2.0/2.1 |orientation|double|Rotate text.|degree|0|
|placements||List of possible placements. Only valid if placement-type="simple" is used.|string|"X"|2.0 |rotate-displacement|true, false|Rotates the displacement around the placement origin by the angle given by "orientation".|bool|false|harfbuzz|
|upright|left,right,auto,left_only,right_only|Select which way direction is used to place characters upright. The XXX_only variant place text only if more than 50% of all character are upright. Together with placement-type="list" this can be used to implement alternate texts. See below for an example. |-|auto|harfbuzz |placement-type|dummy, simple, list|Placement finder algorithm. Currently supported: "dummy" (one placement only), "simple" (automatically create new positions using a simple configuration; see below) and "list" (mapnik >=2.1, see below)|string|dummy|2.0/2.1
|placements|string|List of possible placements. Only valid if placement-type="simple" is used. See below for syntax.||"X"|2.0
|upright|left, right, auto, left_only, right_only|Select which way direction is used to place characters upright. The XXX_only variants place text only if more than 50% of all character are upright. Together with placement-type="list" this can be used to implement alternate texts. See below for an example. ||auto|harfbuzz
|clip|true, false|If true then the geometry is clipped to the view before doing placements. Improves performance but can cause bad placements when the results are used for tiling|bool|true|2.0.0| |clip|true, false|If true then the geometry is clipped to the view before doing placements. Improves performance but can cause bad placements when the results are used for tiling|bool|true|2.0.0|
|rotate-displacement|Rotates the displacement around the placement origin by the angle given by "orientation"|bool|false|harfbuzz| |largest_bbox_only|true, false|?||true|?|
## Examples ## Examples
Some examples of Mapnik's ability to place text along lines: Some examples of Mapnik's ability to place text along lines: