Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
1) It seems like inscape ignores the ‘non-scaling stoke’ vector effect. My view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
2) The same seems to apply to text. The font size seems to be interpreted as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
And, related to 1) and 2), I noticed when saving a SVG from Inkscape, that Inkscape doesn’t define any unit but the SVG’s work fine and accurate. Even if I define a box to be 100mm x 100mm. Is there a ‘conversion’ between mm and ‘units’ going on somewhere. Is there a convention how units in SVG correlate to ‘real world’ dimensions such as mm or inches?
Thanks for your help!
Maarten
(Btw, I would love to mention the website that generates these SVG's, but I do not know if it’s appropiate to do so?)
On Sat, 4 Jul 2015 11:58:59 +0200 "m .h. van der velde" <m.h.vandervelde@...155...> wrote:
Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
- It seems like inscape ignores the ‘non-scaling stoke’ vector
effect. My view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
- The same seems to apply to text. The font size seems to be
interpreted as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
I've had situations where lengthening a stroke thickens it. There's an arcane adjustment, somewhere, that you set so this doesn't happen. Every time I need to reset it (reinstallation, mostly) I spend an hour of experimentation finding it, and shut it off.
If I need a thin line whose width increases with its length, I make a very skinny rectangle with black fill and 0px stroke.
SteveT
Steve Litt June 2015 featured book: The Key to Everyday Excellence http://www.troubleshooters.com/key
Hi there Maarten
On Sat, Jul 4, 2015 at 11:58 AM, m .h. van der velde < m.h.vandervelde@...155...> wrote:
Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
- It seems like inscape ignores the ‘non-scaling stoke’ vector effect. My
view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
- The same seems to apply to text. The font size seems to be interpreted
as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
And, related to 1) and 2), I noticed when saving a SVG from Inkscape, that Inkscape doesn’t define any unit but the SVG’s work fine and accurate. Even if I define a box to be 100mm x 100mm. Is there a ‘conversion’ between mm and ‘units’ going on somewhere. Is there a convention how units in SVG correlate to ‘real world’ dimensions such as mm or inches?
Thanks for your help!
Maarten
(Btw, I would love to mention the website that generates these SVG's, but I do not know if it’s appropiate to do so?)
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hi Steve,
Thanks for your suggestion considering using a rectangle as a line, but I’m afraid that wouldn’t work in my situation: I need to make circles too and the lines are send to cutting equipment, so they really must be lines.
Hi Judah,
I’m curious about your answer, but all I see is the ‘salutation’ (Hi there Maarten).
Thanks both, kind regards,
Maarten
On 04 Jul 2015, at 18:09, Judah Kleinveldt <judahyodh@...155...> wrote:
Hi there Maarten
On Sat, Jul 4, 2015 at 11:58 AM, m .h. van der velde <m.h.vandervelde@...125...155... mailto:m.h.vandervelde@...155...> wrote: Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
It seems like inscape ignores the ‘non-scaling stoke’ vector effect. My view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
The same seems to apply to text. The font size seems to be interpreted as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
And, related to 1) and 2), I noticed when saving a SVG from Inkscape, that Inkscape doesn’t define any unit but the SVG’s work fine and accurate. Even if I define a box to be 100mm x 100mm. Is there a ‘conversion’ between mm and ‘units’ going on somewhere. Is there a convention how units in SVG correlate to ‘real world’ dimensions such as mm or inches?
Thanks for your help!
Maarten
(Btw, I would love to mention the website that generates these SVG's, but I do not know if it’s appropiate to do so?)
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net mailto:Inkscape-user@...1841...ge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user https://lists.sourceforge.net/lists/listinfo/inkscape-user
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/_______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hi there Maarten
It depends on how you set up your document in Inkscape. Best practice I use esp when editing vector content from outside Inkscape is checking that all units are reflecting correctly in the document. CTRL+SHIFT+D opens the document properties and I can check to see if default units are set to px/mm/cm/pt once I have done this check your window properties and make sure units are expessed in the measurements you need. I get alot of vector content from adobe users and usually they don't specifically set the units to either px or mm.
[Edit]
You can also set the stoke to transform with the scaling of the doc/or not in the preferences dialog (SHIFT+CTRL+P), I just realized that this might be what you're actually hoping to do :)
Do let me know if it works for you...
Thanks Judah
On Sat, Jul 4, 2015 at 6:15 PM, m .h. van der velde < m.h.vandervelde@...155...> wrote:
Hi Steve,
Thanks for your suggestion considering using a rectangle as a line, but I’m afraid that wouldn’t work in my situation: I need to make circles too and the lines are send to cutting equipment, so they really must be lines.
Hi Judah,
I’m curious about your answer, but all I see is the ‘salutation’ (Hi there Maarten).
Thanks both, kind regards,
Maarten
On 04 Jul 2015, at 18:09, Judah Kleinveldt <judahyodh@...155...> wrote:
Hi there Maarten
On Sat, Jul 4, 2015 at 11:58 AM, m .h. van der velde < m.h.vandervelde@...155...> wrote:
Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
- It seems like inscape ignores the ‘non-scaling stoke’ vector effect.
My view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
- The same seems to apply to text. The font size seems to be
interpreted as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
And, related to 1) and 2), I noticed when saving a SVG from Inkscape, that Inkscape doesn’t define any unit but the SVG’s work fine and accurate. Even if I define a box to be 100mm x 100mm. Is there a ‘conversion’ between mm and ‘units’ going on somewhere. Is there a convention how units in SVG correlate to ‘real world’ dimensions such as mm or inches?
Thanks for your help!
Maarten
(Btw, I would love to mention the website that generates these SVG's, but I do not know if it’s appropiate to do so?)
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/_______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hi Judah, et al,
Thanks for your help and the screenshots. it’s very interesting, i never made the connection in my mind between the ‘custom size’ in the properties window and the viewbox-attribute in SVG, neither between the ‘scale strokes’ button in the Inkscape UI and the effect from SVG definition.
But, toggling the ‘transform strokes’ button doesn’t do anything.
I suddenly wonder,… I define the line style in a stylesheet in the head of document. Might it be that Inkscape doesn’t like that?
Also, this is my SVG definition: <svg xmlns="http://www.w3.org/2000/svg <>" xmlns:xlink="http://www.w3.org/1999/xlink <>" width="30cm <>" height="60cm <>" viewBox="0 0 30 60 <>" > and Inkscape’s document setting
And the style, together with the first path. <![CDATA[
.cut{ stroke: #ff0000; stroke-width: 1px; fill: none; }
.fold{ stroke: #08C; stroke-width: 1px; fill: none; stroke-dasharray:2, 2 }
.valley{ stroke: #00cccc; stroke-width: 1px; fill: none; stroke-dasharray:3, 2 }
.mountain{ stroke: teal; stroke-width: 1px; fill: none; stroke-dasharray:2, 3 }
.construction{ stroke: silver; stroke-width: 1px; fill: none; stroke-dasharray:10,3 }
]]> </style>
<path id="outside <>" class="cut <>" vector-effect="non-scaling-stroke <>" d="M 0 0 <> Thanks for your help, I suspect it’s a bug in my SVG, rather then a bug in Inkscape.
Maarten
On 04 Jul 2015, at 19:39, Judah Kleinveldt <judahyodh@...155...> wrote:
<Screenshot from 2015-07-04 19:28:20.png>
On Sat, 2015-07-04 at 19:55 +0200, m .h. van der velde wrote:
Hi Judah, et al,
Thanks for your help and the screenshots. it’s very interesting, i never made the connection in my mind between the ‘custom size’ in the properties window and the viewbox-attribute in SVG, neither between the ‘scale strokes’ button in the Inkscape UI and the effect from SVG definition.
But, toggling the ‘transform strokes’ button doesn’t do anything.
I suddenly wonder,… I define the line style in a stylesheet in the head of document. Might it be that Inkscape doesn’t like that?
Also, this is my SVG definition:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30cm" height="60cm" viewBox="0 0 30 60" > and Inkscape’s document setting
And the style, together with the first path. <![CDATA[
.cut{ stroke: #ff0000; stroke-width: 1px; fill: none; } .fold{ stroke: #08C; stroke-width: 1px; fill: none; stroke-dasharray:2, 2 } .valley{ stroke: #00cccc; stroke-width: 1px; fill: none; stroke-dasharray:3, 2 } .mountain{ stroke: teal; stroke-width: 1px; fill: none; stroke-dasharray:2, 3 } .construction{ stroke: silver; stroke-width: 1px; fill: none; stroke-dasharray:10,3 } ]]> </style> <path id="outside" class="cut" vector-effect="non-scaling-stroke" d="M 0 0
Thanks for your help, I suspect it’s a bug in my SVG, rather then a bug in Inkscape.
The combination of the 'width'/'height' and 'viewBox' define the initial "user unit" in SVG which is equivalent to '1 cm' in "real world" units according to the information in the <svg> element. I won't go into the long, twisted history of SVG and CSS but internally "px" is defined to be mean one "user unit". Thus, your <style> element is defining the stroke widths to be 1 cm wide in "real world" units.
The 'vector-effects' property was added in the SVG 2 specification (which is yet to be finished). It is not yet supported in Inkscape.
Tav
Hi Tav, (et al)
Thanks for the explanation, that’s clear.
So, in Inkscape, I selected all the lines, set their width to 1px and saved the file again.
When I examine the file, it has the line-thickness saved in the style-attribute of the path:
style="stroke-width:0.02822223;…
Now I wonder, where does this 0.02822 come from? What calculation is made?
Thanks,
Maarten
On 04 Jul 2015, at 20:51, Tavmjong Bah <tavmjong@...206...> wrote:
On Sat, 2015-07-04 at 19:55 +0200, m .h. van der velde wrote:
Hi Judah, et al,
Thanks for your help and the screenshots. it’s very interesting, i never made the connection in my mind between the ‘custom size’ in the properties window and the viewbox-attribute in SVG, neither between the ‘scale strokes’ button in the Inkscape UI and the effect from SVG definition.
But, toggling the ‘transform strokes’ button doesn’t do anything.
I suddenly wonder,… I define the line style in a stylesheet in the head of document. Might it be that Inkscape doesn’t like that?
Also, this is my SVG definition:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30cm" height="60cm" viewBox="0 0 30 60" > and Inkscape’s document setting
And the style, together with the first path. <![CDATA[
.cut{ stroke: #ff0000; stroke-width: 1px; fill: none; } .fold{ stroke: #08C; stroke-width: 1px; fill: none; stroke-dasharray:2, 2 } .valley{ stroke: #00cccc; stroke-width: 1px; fill: none; stroke-dasharray:3, 2 } .mountain{ stroke: teal; stroke-width: 1px; fill: none; stroke-dasharray:2, 3 } .construction{ stroke: silver; stroke-width: 1px; fill: none; stroke-dasharray:10,3 } ]]> </style> <path id="outside" class="cut" vector-effect="non-scaling-stroke" d="M 0 0
Thanks for your help, I suspect it’s a bug in my SVG, rather then a bug in Inkscape.
The combination of the 'width'/'height' and 'viewBox' define the initial "user unit" in SVG which is equivalent to '1 cm' in "real world" units according to the information in the <svg> element. I won't go into the long, twisted history of SVG and CSS but internally "px" is defined to be mean one "user unit". Thus, your <style> element is defining the stroke widths to be 1 cm wide in "real world" units.
The 'vector-effects' property was added in the SVG 2 specification (which is yet to be finished). It is not yet supported in Inkscape.
Tav
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net mailto:Inkscape-user@...1841...ge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Sat, 2015-07-04 at 22:19 +0200, m .h. van der velde wrote:
Hi Tav, (et al)
Thanks for the explanation, that’s clear.
So, in Inkscape, I selected all the lines, set their width to 1px and saved the file again.
The GUI uses "real world" units so 1px must be interpreted according to the CSS px value relative to 1 cm. Inkscape 0.91 and earlier use the (incorrect) value of 90px per inch which is the same as 35.43...px per cm.
When I examine the file, it has the line-thickness saved in the style-attribute of the path:
style="stroke-width:0.02822223;…
Now I wonder, where does this 0.02822 come from? What calculation is made?
Taking the inverse of 35.43... give 0.2822223.
Trunk uses the correct CSS defined ratio of 96px per inch. Opening a 0.91 or earlier file in trunk will give the exact same rendering (as long at the 'viewBox' is defined or the width and height is in pixels) but strokes that were reported to be 1px wide in 0.91 will be reported as 1.0666... px wide in trunk.
Tav
Dear Tav, and others,
Okay, thank you! So the 'magic' number is either 90dpi or 96 dpi.
I noticed I can't get a consistend text size in both Inkscape ánd firefox (for Mac). Looking at the Inkscape files, the only way to go is to use dimensionless units which, I know now thanks to you, boil down to 90 dpi.
Kind regards,
Maarten
On Sun, Jul 5, 2015 at 10:11 PM, Arlo Barnes <arlo.barnes@...155...> wrote:
On Sat, Jul 4, 2015 at 12:51 PM, Tavmjong Bah <tavmjong@...206...> wrote:
I won't go into the long, twisted history of SVG and CSS but internally "px" is defined to be mean one "user unit".
Is there a good place to read this long, twisted history? -Arlo James Barnes
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hi there Maarten
It depends on how you set up your document in Inkscape. Best practice I use esp when editing vector content from outside Inkscape is checking that all units are reflecting correctly in the document. CTRL+SHIFT+D opens the document properties and I can check to see if default units are set to px/mm/cm/pt once I have done this check your window properties and make sure units are expessed in the measurements you need. I get alot of vector content from adobe users and usually they don't specifically set the units to either px or mm.
Thanks Judah
On Sat, Jul 4, 2015 at 11:58 AM, m .h. van der velde < m.h.vandervelde@...155...> wrote:
Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
- It seems like inscape ignores the ‘non-scaling stoke’ vector effect. My
view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
- The same seems to apply to text. The font size seems to be interpreted
as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
And, related to 1) and 2), I noticed when saving a SVG from Inkscape, that Inkscape doesn’t define any unit but the SVG’s work fine and accurate. Even if I define a box to be 100mm x 100mm. Is there a ‘conversion’ between mm and ‘units’ going on somewhere. Is there a convention how units in SVG correlate to ‘real world’ dimensions such as mm or inches?
Thanks for your help!
Maarten
(Btw, I would love to mention the website that generates these SVG's, but I do not know if it’s appropiate to do so?)
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hi Maarten, I can't say with absolute certainty whether it's ok to mention a website that creates SVG files, on this list. But I *think* it should be ok -- there must be some interest in making Inkscape compatible with other vector apps, after all. And certainly it might help us figure out what the problem is. Or if you still feel hesitant, you could attach a file that was created by this website. Then we would have an example to look at and test with (for those of us who don't already know the answer). Is there any chance it could be a problem with that website/app? You can find some info about SVG coding on this page, and especially from the links at the bottom of the page: https://inkscape.org/en/develop/about-svg/ (There is a setting in Inkscape to either allow or prevent the stroke from scaling with the object, but I don't think that's what you're asking, is it?) As far as Inkscape and "real world" sizes, all I know is that an inch in Inkscape, as you see it on the screen, is not the same as a real inch. Inkscape's native dpi is 90, but I'm not sure how to compare dpi (in general) to "the real world". I also wonder if the resolution of the computer screen has something to do with it. However, whatever size you set, when that image is translated off the computer screen and into whatever form it takes (printed on paper, cut out of vinyl, etched on wood or whatever) the size is correct (afaiu). I'm sure some much more knowledgeable people than me will eventually give you the right answer (it's a holiday weekend in the U.S.). But until then, maybe this info will help you?
All best, brynn
-------------------------------------------------- From: "m .h. van der velde" <m.h.vandervelde@...155...> Sent: Saturday, July 04, 2015 3:58 AM To: "Inkscape User Community" inkscape-user@lists.sourceforge.net Subject: [Inkscape-user] vector-effect: non-scaling stroke
Hi all,
I’m playing with SVG content generated outside Inkscape that uses the ViewBox property.
I’m experiencing two problems there, can somebody maybe help me with that?
- It seems like inscape ignores the ‘non-scaling stoke’ vector effect. My
view box is 30 x 60 (no units) large, the stroke width is 1px. But is seems like Inscape interprets it as 1 view box unit - and draws the stroke way to thick.
- The same seems to apply to text. The font size seems to be interpreted
as view box units, no matter what unit I define for the font-size (pt, mm, px) Also, the interpretation of the font size seems to differ between browsers and operating systems! Sometimes rendering the font way to large and sometimes way to big.
And, related to 1) and 2), I noticed when saving a SVG from Inkscape, that Inkscape doesn’t define any unit but the SVG’s work fine and accurate. Even if I define a box to be 100mm x 100mm. Is there a ‘conversion’ between mm and ‘units’ going on somewhere. Is there a convention how units in SVG correlate to ‘real world’ dimensions such as mm or inches?
Thanks for your help!
Maarten
(Btw, I would love to mention the website that generates these SVG's, but I do not know if it’s appropiate to do so?)
Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
participants (7)
-
Arlo Barnes
-
Brynn
-
Judah Kleinveldt
-
m .h. van der velde
-
Maarten van der Velde
-
Steve Litt
-
Tavmjong Bah