-
Notifications
You must be signed in to change notification settings - Fork 262
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
Support <text> in <svg> #186
Comments
Please, please, please implement this. I've been wanting to use the |
What is your use case @lunaisnotaboy? Why putting text inside |
@shuding We're using an SVG template we made and we're wanting to embed text and images in there (e.g. series title, rating, year + season, banner + poster, etc.), so we don't want to use regular HTML styling if we have to. |
If that is the case, I suggest you migrate to a HTML template (even if we have support) because you get proper text wrapping, and it will be much easier to maintain as well. |
This will be so useful for me!, I'am using because I make the text to arch and the only way now is to use a path for the the text.
|
We want manipulate the text in a way that we can only do in SVG, so we can't migrate at this time. |
@lunaisnotaboy can you be more specific with an example? I can't think of a case other than |
I am hoping to use Satori to export some D3 charts that use and nodes. Is that a usecase this enhancement would support? |
For SVG charts |
@shuding sweet, is there maybe a timeline on when this might be included in an upcoming release? Want to update my team if so |
Sorry @romellogoodman we don't have a timeline for this one as it's not a trivial change and I don't have a clear solution yet. |
just jumping on with a +1 vote for this feature 😁 |
I marked this feature to the 1.0 milestone and started to actively think about it - totally understood how critical and how powerful this feature is 👍 |
Thank you so much!!! |
The PRs for resvg-js#217 have been merged, and I'll be releasing a new version as soon as I've written the documentation. |
Hi, I have another use case for this. As currently Example in the Vercel OG Image Playground (only works in |
Im still having an issue with getting tags in SVG to render. Was this fixed? |
please prioritize this!! 🥺 @shuding, I know there is a lot to resolve and implement, but this is something widely needed and there are several people interested. Whatever you can do will help. |
Right now we require all
<text>
to be converted as paths, if you render a<svg>
node inside. That is mainly because I guess most of these use cases (putting a SVG node inside) is for rendering some static things such as logos, and we should try to not manipulate that (like rendering it with a wrong font).However in some rare use cases you might want a
<svg>
to be rendered, which contains dynamic<text>
nodes. Maybe a good solution is to have an option to support converting it as<path>
s.Not difficult to implement, just need to design it carefully.Edit: Adding some notes here -
<text>
to<path>
the coordinates need to be carefully considered. Some props can be directly attached to the path.text-anchor
anddominant-baseline
textLength
andlengthAdjust
supporttspan
The text was updated successfully, but these errors were encountered: