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

letter-spacing overlapping text when converting to png #1130

Open
cThePush opened this issue Jan 17, 2024 · 1 comment
Open

letter-spacing overlapping text when converting to png #1130

cThePush opened this issue Jan 17, 2024 · 1 comment

Comments

@cThePush
Copy link

Description

When converting to png and using a letter-spacing in a text the letters goes to the first position and overlap, like it has no space.

When removing the letter-spacing it works as intended.

Example data

In browser view(what is expected)
image
When converting to png:
image

Code:
SVG:

<text id="svg_18" x="32.267" y="664.62" letter-spacing="2px" font-size="48.9706px" font-weight="bold" font-family="Roboto" fill="{color}" class="st6 st12 st13 st14">{name}</text>
<text id="svg_19" x="32.267" y="723.38397" letter-spacing="2px" font-size="48.9706px" font-weight="bold" font-family="Roboto" fill="{color}" class="st6 st12 st13 st14">{surname}</text>

.NET:

var svgDocument = SvgDocument.Open(Path.GetTempPath()+image.ID+".bin");
var bitmap = svgDocument.Draw();
using (MemoryStream s = new MemoryStream()){
      bitmap.Save(s, ImageFormat.Png);
      byte[] byteImage = s.ToArray();
      Base64 = Convert.ToBase64String(byteImage); // Get Base64
}

Used Versions

Version Nuget, Windows Server 2019 and a I am using .NET Core

@paulushub
Copy link
Contributor

@cThePush Please can you provide a complete sample SVG file for testing?

@paulushub paulushub self-assigned this Jan 25, 2024
@paulushub paulushub removed their assignment Feb 23, 2024
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

2 participants