Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tspan places text at the beginning of Text #2824

Open
jonahdlin opened this issue Jul 18, 2024 · 0 comments
Open

Tspan places text at the beginning of Text #2824

jonahdlin opened this issue Jul 18, 2024 · 0 comments

Comments

@jonahdlin
Copy link

jonahdlin commented Jul 18, 2024

Describe the bug
When <Text> has <Tspan> children, each block of text starts from the beginning of the <Text> container.

To Reproduce
Steps to reproduce the behavior including code snippet (if applies):

  1. Create a document which has a <Text> with <Tspan> children, like the following:
<Document>
  <Page>
    <Svg>
      <Text x="10" y="30">
        This is a <Tspan style={{ fill: "red" }}>test</Tspan> of tspan
      </Text>
    </Svg>
  </Page>
</Document>
  1. Observe the result

image

This is reproduced in this REPL

The same SVG in plain HTML

<svg>
  <text x="10" y="30">
    This is a 
    <tspan style="fill:red;">test</tspan>
    of tspan
  </text>
</svg>

Looks like this
image

Expected behavior
The children of <Text> should appear one after the other like they do in native HTML SVG.

Screenshots
See above

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • React-pdf version: latest (3.3.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant