svg2pdf.js icon indicating copy to clipboard operation
svg2pdf.js copied to clipboard

Support for letter-spacing Attribute in <text> Element

Open junboxiao opened this issue 8 months ago • 4 comments

Description:

I have encountered an issue where svg2pdf.js does not support the letter-spacing attribute in SVG elements. This attribute is crucial for proper text rendering in my project.

Steps to Reproduce:

Create an SVG with a element that includes the letter-spacing attribute. Convert the SVG to PDF using svg2pdf.js. Observe that the letter-spacing attribute is not applied in the PDF output. Expected Behavior: The letter-spacing attribute should be supported and correctly applied to text elements in the converted PDF.

Actual Behavior: The letter-spacing attribute is ignored, and the text appears without the specified spacing in the PDF.

Example:

<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
  <text x="10" y="20" letter-spacing="10px" font-family="Arial" font-size="20">Example Text</text>
</svg>

When converted to PDF, the letter-spacing is not reflected.

Environment:

svg2pdf.js version: ^2.2.3 Browser: Chrome Operating System: MacOS Thank you for your attention to this matter. Implementing support for the letter-spacing attribute would greatly improve text rendering capabilities in svg2pdf.js.

junboxiao avatar May 30 '24 13:05 junboxiao