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

Text no rendering correctly, .svg works in Edge and Chrome #1168

Open
PlanetEarthSoftware opened this issue Oct 4, 2024 · 4 comments
Open

Comments

@PlanetEarthSoftware
Copy link

Description

Rendering the attached .svg file fails with the text shown as black rectangles. Image looks ok in Chrome and Edge, the text should be a sans serif font. It was exported from OpenOffice Draw.

Example data

Chat Example Schema Diagram

Used Versions

Svg v3.4.7 from nuget
Windows 10
.net 8.0

@benberlin7
Copy link

benberlin7 commented Dec 19, 2024

Could you explain the issue more detailed?
As far as I understand : You export a svg from openoffice. Then you want to import it via SVG.net in a c# application, but the text is not shown (after exporting it from there?). Are the text elements missing? Or are they just not visible because the background has the same color as the text.
And what do you mean by "image looks ok in edge", does it have the same text-missing error in firefox?

@PlanetEarthSoftware
Copy link
Author

The .svg is attached to this Issue.
The C# application using svg.net shows:
Svg Rendered

Edge, Chrome and Firefox all render the .svg as shown here:
Svg rendered in Edge, Chrome and Firefox

@benberlin7
Copy link

How do you view the SVG in VS?
And you save this via svg.net and then it is shown correctly?
Did you inspect the single SVG elements after reading in VS? Do the text areas have a background-color or sth. suspicious?

@PlanetEarthSoftware
Copy link
Author

PlanetEarthSoftware commented Dec 20, 2024

How do you view the SVG in VS?

Visual Studio? In code?

SvgDocument svg= SvgDocument.Open(path);
float width = SvgDocument.Width - SvgDocument.X;
float height = SvgDocument.Height - SvgDocument.Y;
Bitmap bitmap = svg.Draw((int)width, (int)height);

And you save this via svg.net and then it is shown correctly?

Still looks ok if saved with svg.Write(savepath)
saved

Did you inspect the single SVG elements after reading in VS? Do the text areas have a background-color or sth. suspicious?

I’m not doing any inspection just converting to a Bitmap and displaying.

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