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

Background is missing #3

Open
mitar opened this issue Nov 14, 2016 · 6 comments
Open

Background is missing #3

mitar opened this issue Nov 14, 2016 · 6 comments

Comments

@mitar
Copy link

mitar commented Nov 14, 2016

I tried to convert attached SVG file but in the resulting PNG background is missing.

Moreover, I run it with width and height set to 42, but the result is 50x50 large image.

8xHWKaw8BpLWdaMiM-i.svg.zip

8xHWKaw8BpLWdaMiM-i.png.zip

@fuzhenn
Copy link
Owner

fuzhenn commented Nov 14, 2016

Hi, @mitar

I have fixed the scaling bug in the commits above and published to npm as 0.2.5.

The missing background is due to canvg's parsing strategy of style properties, you may fix the problem by adding a "rect" element behind the text.

@mitar
Copy link
Author

mitar commented Nov 14, 2016

Thanks for quick response. Is the background then a bug or a feature on canvg? Do you think it should be reported upstream?

@mitar
Copy link
Author

mitar commented Nov 14, 2016

I think it might be this problem: canvg/canvg#314

@mitar
Copy link
Author

mitar commented Nov 14, 2016

Resizing does not yet work perfectly. The text gets moved. For example, see above example with width/height set to 42, and look where text is, and then try with 50. You will see that with 50 text is nicely centered, but with 42 it is not.

3ftddn2bhww64sssz-i-50
3ftddn2bhww64sssz-i-42

@5achinJani
Copy link

Hey @mitar can you help with this issue I'm having and it is related to yours in some way.

@goldenjayr
Copy link

most of my colors are defined via css classes and all the colors are not rendering.

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

4 participants