Open themachho opened 2 years ago
This is an SVG spec vs implementation thing, please see https://gitlab.gnome.org/GNOME/librsvg/-/issues/99
You'll need to add the text-decoration
attribute to the tspan
element.
Parsed the DOM and inherited the text-decoration to the tspan and now it is rendered correctly. The issue can be closed now. Thanks!
Possible bug
Is this a possible bug in a feature of sharp, unrelated to installation?
npm install sharp
completes without error.node -e "require('sharp')"
completes without error.If you cannot confirm both of these, please open an installation issue instead.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?System: OS: Windows 10 10.0.19044 CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Memory: 1.49 GB / 15.86 GB
Binaries: Node: 16.13.0 - C:\Program Files\nodejs\node.EXE npm: 8.1.3 - C:\Program Files\nodejs\npm.CMD
npmPackages: sharp: ^0.30.5 => 0.30.5
What are the steps to reproduce?
Sharp is not adding text-decoration underline to the converted image.
What is the expected behaviour?
The text is underlined.
Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem
This is a simple function to convert an SVG (encoded in base64) to png and return the converted image. Is part of an NodeJS/ExpressJS API. It receives the buffer, returns a bitmap.
This is the SVG, created with FabricJS and exported with
canvas.toSVG();
, but its not related to FabricJSPlease provide sample image(s) that help explain this problem
This is the output of www.svgviewer.dev, as you can see, the text is underlined.
This is the output from sharp, the text is not underlined
Looks like text-decoration="underline" is not being processed. Same issue if the
text-decoration
property is removed and is added insidestyle="text-decoration:underline; etc etc