Skip to content

How to add attributes to textpath instead of the parent text node #74

Open
@marcuswu

Description

@marcuswu

Code like this:

draw.Textpath("Some text here", "#topArc", `text-anchor="middle"`, `startOffset="50%"`, `font-size="25"`, `font-family='Salma Pro'`, `fill="black"`)

Results in this xml:

<text xmlns="http://www.w3.org/2000/svg" text-anchor="middle" startOffset="50%" font-size="25px" font-family="Salma Pro" fill="black">
  <textPath xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#topArc">Some text here</textPath>
</text>

I want the text-anchor and startOffset fields to be on the <textPath> tag instead of the <text> tag. How would I make that happen? Is there a way to define the two tags separately?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions