Comments (8)
Please reduce your SVG to just the text where the fonts are not applied.
from svg2pdf.js.
Here it is, there seems to be the same structure as the one that has the font applied, any ideas what could be happening with text styles too?
from svg2pdf.js.
so I checked how we could implement the underlining and the line-through text decoration properties on the pdf, and we need to draw a line with the same color as the tspan style declaration but in order to do that, we need to get the text object width and height to add this to the x and y props and then draw from there, so I if you can guide me on how to get these props (style declaration, text rendered height and width) after we set the text and were specifically we need to set it on svg2pdf I will gladly do the work and testing needed @HackbrettXXX
from svg2pdf.js.
Thank you for reducing the SVG.
Regarding the font issue: could also attach a PDF of the reduced SVG, please?
Regarding the underline and strike-through: a PR would be very much appreciated. The best location to put the code is probably somewhere in textchunk: https://github.com/yWorks/svg2pdf.js/blob/master/src/textchunk.ts#L72. The text position and width is already known there. One issue you might run into is that every tspan might get its own line and we might need to consolidate the lines for inline tspans.
There is already a similar open issue: #226
from svg2pdf.js.
I checked the possible font issues and they seems to be related to the font weight declaration, in the svg these are custom fonts that are added as 'normal' font weights, so there's no match on both the use and font declaration, I will start working on the changes required to add the underlining.
from svg2pdf.js.
Related Issues (20)
- Force stroke='none' if 'stroke-width' === 0 HOT 3
- Support for XML HOT 1
- SVG is upscaled in the pdf-file HOT 3
- When font-size declared in rem, text is missing in the exported file. HOT 4
- Artifacts at letter s of font Aleo after conversion - but font Aleo itself has no such issue in jspdf HOT 5
- Latest master doesn't build HOT 1
- Excess clipping of nested SVG HOT 8
- Marker clipping HOT 2
- Error: Invalid argument passed to jsPDF.scale Error HOT 4
- Black background added to paths HOT 8
- Chinese is not supported HOT 2
- How to concatenate multiple SVG files? HOT 2
- Setting width and height as floats throws t. HOT 2
- How to ignore invalid dataurl HOT 6
- Accept spaces in data urls in image urls
- adding support for the CMYK color space HOT 5
- greek letters in text HOT 1
- tspan dx makes incorrect offset HOT 1
- Incorrect Gradient rendering in svg2pdf HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg2pdf.js.