Home
Categories
Dictionary
Download
Project Details
FAQ
License

tspan element support



The library support the tspan element[1] .

The following attributes are supported:
  • x for an absolute x position
  • y for an absolute y position
  • dx for a relative x position (relative to the previous tspan)
  • dy for a relative y position (relative to the previous tspan)
  • font-family
  • font-size
  • font-style
  • text-decoration
  • baseline-shift
  • stroke (see svg styling support)
  • style (see svg styling support)

Tspan structures

tspan elements are under text elements. There are several ways to put them under text:
  • Under an empty text element:
          <g>
             <text style="font-size:40px;font-family:sans-serif;">
                <tspan>Hello</tspan>
                <tspan stroke="red">World</tspan>
             </text>
          </g>
    
  • Under a not empty text element:
          <g>
             <text style="font-size:40px;font-family:sans-serif;">Hello
                <tspan stroke="red">World</tspan>
             </text>
          </g>
    

Tspan coordinates

If the x, y, dx, and dy attributes are not present for a tspan, the position of the tspan follows the previous tspan element.

Notes


Categories: fromsvgsupport

Copyright 2021-2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD-3-Clause License