Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-863

Leading and/or trailing spaces don't contribute to <text> bounding box

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: SVG DOM
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      When xml:space="preserve", trailing spaces should contribute to the <text> element's bounding box. However, in the following document, both <text> elements return the same bounding box:

      <svg xmlns='http://www.w3.org/2000/svg'
      width='400' height='300' viewBox='0 0 100 100'>
      <text x='10' y='10' onclick='alert(evt.target.getBBox().width)' xml:space='preserve'>a</text>
      <text x='10' y='30' onclick='alert(evt.target.getBBox().width)' xml:space='preserve'>a </text>
      </svg>

      The same applies to leading spaces.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
                Reporter:
                cam Cameron McCormack
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: