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

Incoming SVG size issue - show popup #5

Open
cleversomeday opened this issue Oct 30, 2019 · 4 comments
Open

Incoming SVG size issue - show popup #5

cleversomeday opened this issue Oct 30, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@cleversomeday
Copy link

Maks, Thanks so much for your hard work on this tool. Please find attached the SVGs I uploaded and a screen shot of my results (similar for both plain and Inskcape SVG) cnc-text-tool.zip

@msurguy
Copy link
Owner

msurguy commented Oct 30, 2019

@cleversomeday I see the problem, but don't know where it comes from or how to resolve it...

For some odd reason, the viewBox in the files you provided treats the units as whatever is used in the width / height attribute, which is not the way my Inkscape / Illustrator outputs them...

Basically, this is the culprit:
viewBox="0 0 8.5 11"
Remove that line completely, and you should see your SVG render just fine.

My Inkscape outputs the following viewBox for US Letter SVG:
viewBox="0 0 765 990"

I don't know what standard to follow in this case... Will have to dig a bit into the spec to see what software is buggy!

@msurguy
Copy link
Owner

msurguy commented Oct 30, 2019

@cleversomeday I think the browser behaves as intended (when viewBox units of 8.5 11 are passed):
Screen Shot 2019-10-30 at 3 26 03 PM

Which means that if you want anything to show up in the browser correctly, that viewbox width / height should be set to some multiple of the width / height value.

@cleversomeday
Copy link
Author

cleversomeday commented Oct 30, 2019 via email

@msurguy
Copy link
Owner

msurguy commented Oct 30, 2019

@cleversomeday Whew! I'm hoping this is very much an edge case, otherwise I might just ignore the viewbox attribute if the size is below a certain threshold (since people won't see the SVG on the screen at the size it's supposed to be).

Which makes me think it would be nice to make some popup letting the user know that viewBox is too small to be rendered. I'll add that as a feature in planning!

Also, I know you really want the ability to make SVGs in the tool itself. That's my first priority as I get some time to work on this tool!

@msurguy msurguy added the enhancement New feature or request label Oct 30, 2019
@msurguy msurguy self-assigned this Oct 30, 2019
@msurguy msurguy changed the title Incoming SVG size issue Incoming SVG size issue - show popup Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants