mapnik / mapnik

Mapnik is an open source toolkit for developing mapping applications

Home Page:http://mapnik.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TextSymbolizer with horizontalAlignment="adjust" and Format fails to display anything if text is short

zdila opened this issue · comments

Testcase:

    <Map backgroundColor="white">
      <Layer srs="+init=epsg:4326">
        <StyleName>main</StyleName>

        <Datasource>
          <Parameter name="type">geojson</Parameter>

          <Parameter name="inline">
            {
              "type": "FeatureCollection",
              "features": [
                {
                  "type": "Feature",
                  "properties": {},
                  "geometry": {
                    "type": "LineString",
                    "coordinates": [
                      [ 12.59033203125, 50.21909462044748 ],
                      [ 18.127441406249996, 49.49667452747045 ]
                    ]
                  }
                }
              ]
            }
          </Parameter>
        </Datasource>
      </Layer>

      <Style name="main">
        <Rule>
          <LineSymbolizer stroke="black" stroke-width="1" />

          <TextSymbolizer
            face-name="PT Sans Regular"
            size="30"
            horizontal-alignment="adjust"
            placement="line"
            line-spacing="20"
          >
            "Česko\n"
            <Format size="20">Czechia</Format>
          </TextSymbolizer>
        </Rule>
      </Style>
    </Map>

Result:

image

If I replace "Česko\n" with " Česko \n" (or some different longer text) then text appears:

image

Also if I remove <Format... then I see the text displayed.