Using symbol from symbol library has different size than original symbol

Post questions on how to use or achieve an effect in Inkscape.
srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Using symbol from symbol library has different size than original symbol

Postby srynoname » Sun Feb 26, 2017 9:41 pm

I just created my own symbol library, but when I use the first (and currently only) symbol from my symbol library, then its size is different and I also can't change e.g. the stroke width.

This is my original symbol @ 1000% zoom:
Image
And this is my symbol taken from my library @ 1000% zoom:
Image
It is much smaller. What exactly am I doing wrong?

I attached my symbol library as diamond2.svg - just copy it to Inkscape/share/symbols.
When one opens the file directly in Inkscape and zooms in to 1000%, it looks like the first screenshot.
However, when creating a new Inkscape file and using Object - Symbols, Symbol Set: Diamond 2 and adding the symbol using drag & drop, it looks like in the second screenshot.

Can anyone help me with this?
Attachments
diamond2.svg
(2.4 KiB) Downloaded 243 times

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Sun Feb 26, 2017 10:21 pm

The document scale is throwing off the size.

In the symbols document:
    I'd remove the symbol from the panel with the button
    Set the document scale for 3.77953 (doc units mm)
    Ungroup and scale the diamond object to desired size
    Remake symbol from rescaled object
    Save document back to symbols folder
Attachments
Document_Properties_(Shift+Ctrl+D)_2017-02-26_06-49-06.png
Document_Properties_(Shift+Ctrl+D)_2017-02-26_06-49-06.png (128.2 KiB) Viewed 5966 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: Using symbol from symbol library has different size than original symbol

Postby srynoname » Sun Feb 26, 2017 11:10 pm

tylerdurden, thank you for your reply. I have no doubt this will work, but I yet don't understand why and how exactly you got the scaling factor of 3.77953?
If I open my diamond2.svg and check the page properties, it has a scale of 1. If I create a new inkscape file/page and check the page properties, it also has a scale of 1. So how can this be a problem and how did you calculate the 3.77953? Thank you!

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Sun Feb 26, 2017 11:17 pm

I can expand more later, but briefly, internally Inkscape uses px, which are 96 px/in or 3.77953 px/mm.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: Using symbol from symbol library has different size than original symbol

Postby srynoname » Mon Feb 27, 2017 7:36 am

Thanks, I am curiously looking forward to that! (While I understand the difference between px and mm, I don't understand how this can be a problem when only working inside Inkscape).

I meanwhile tested your solution proposal, running into a new problem ):
I did all the scaling and when I now add the scaled symbol in a new Inkscape page, it roughly has the size it should have - however, the stroke width is increased compared to the original, leading to a larger total size. I also can't edit the stroke width, it is greyed out. After using Path - Ungroup (was just a guess) I can edit the stroke width, but it has no effect.

I attached my modified library as diamond2_scaled.svg.

To visualize the differences / my problem:
Image

Any hint on this new problem?
Attachments
diamond2_scaled.svg
(2.47 KiB) Downloaded 184 times

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Feb 27, 2017 8:03 am

Which version of Inkscape are you using? (Menu: Help>About Inkscape)
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Feb 27, 2017 9:45 am

A little background:
Symbols work like clones, except the original is in the defs section of the document, not on the canvas.

When a symbol is dragged from the symbol panel to the canvas, it is linked to the original in the same way a clone is. Like a clone, the style cannot be edited until the link to the original is broken, then it is a grouped object that can be edited inside the group (or ungrouped and edited).


Back to the chase...

I tested a symbol document created in version 0.91, and the change to 96ppi in v.92x seems to show up as a size difference when the older version symbol file is used in the newer version document.

WRT the stroke thickness, the size difference issue might be in play, but I can't reproduce the stroke issue here, with the shared file.

Again, it might be helpful to know what version Inkscape and system you have.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Using symbol from symbol library has different size than original symbol

Postby Moini » Mon Feb 27, 2017 10:39 am

The style of a symbol can be edited, if it is not set on the original.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Feb 27, 2017 11:12 am

Ah yes, I should have clarified that.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: Using symbol from symbol library has different size than original symbol

Postby srynoname » Tue Feb 28, 2017 7:30 am

Thank you for your replies!
I am using 0.92 revision 15371, but I am not sure which revision I used to create the original diamond. Will try to recreate the diamond from scratch tomorrow.

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: Using symbol from symbol library has different size than original symbol

Postby srynoname » Mon Mar 06, 2017 5:09 am

Sorry for my late reply, didn't find the time for Inkscape. Today I recreated my diamond symbol from scratch, completely using Inkscape 0.92.1 r15371. However I still have the same problem: The original diamond is larger than the diamond added to the symbols library to be used from there.
I did a video of this. Can anyone help me, what I am droing wrong? I meanwhile think this is a bug?

Here is my video demonstration:
https://www.youtube.com/watch?v=TGJ3coB8P4g

What one can see here:
- I create my diamond
- I put my diamond into a symbols library
- I create a new Inkscape file and use the diamond from the symbols library
- The diamond taken from the symbols library is way smaller than the original diamond

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Mar 06, 2017 6:38 am

Looking at the properties panel in the video, it seems the document is set with mm as the units and the scale is 1:1.

I'd try it with scale set to 3.77953, if you're gonna use display units in mm.

Could be your default document in the user profile is altered, or the one in the Inkscape templates is.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: Using symbol from symbol library has different size than original symbol

Postby srynoname » Mon Mar 06, 2017 7:16 am

Thanks tylerdurden, but I forgot to mention: The video was done on a clean install of Inkscape in a virtual machine (german windows with english as selected language, maybe that somehow influences the units). I would really expect Inkscape to handle necessary conversions internally. Guess I should file a bug report?

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Mar 06, 2017 8:32 am

Well, if the new install is only seeing the default.svg in the program templates, there may be a bug.

My understanding is that if the display units are px, the scale is 1, if display units are mm, the scale is 3.77953, if inches, scale should be 96.

My system was using a custom default.svg set for inches and scale 96. I hid the custom templates and now it opens with mm and scale of 1. :?

I'm not sure where that default.svg is coming from, since the one I see in my program\templates directory shows in textpad that my doc units should be pt. :? :?

Click2X-on-default_svg-in-ProgramTemplates.png
Click2X-on-default_svg-in-ProgramTemplates.png (160.28 KiB) Viewed 5739 times



Yes, I'm confused.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Using symbol from symbol library has different size than original symbol

Postby Moini » Mon Mar 06, 2017 9:15 am

It's faster to reproduce if you do the following:
- Create a symbol in your document
- drag symbol into drawing
- change document unit
- drag symbol into drawing again

What I conclude from this is that symbols do not care about units, I think Inkscape loads them just in document units (they are inserted with height and width values of 100%, so no unit is added when inserted).

The symbols definition does not contain any units, so the size is not defined if the symbol is taken out of its context.

I'm not sure if that's a bug, or just how symbols work. I wasn't able to reproduce the differing stroke width (unless I create the object for the symbol with both stroke and fill unset, then it's possible to change the width just as one likes).
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Mar 06, 2017 11:10 am

The problem seems to me, that symbols are subject to scale when saving the document. Such that symbols made in 0.91 will be smaller when opened in 0.92 if display units are set to other than px.

Here are two symbol svg files, both have a 10" sq rectangle symbol, one file made in .91, the other .92. Both files were set to inches as display units.

If you use the rectangle symbol from each file in .92, the one from 0.92 is correct scale, the other is smaller.
Attachments
10inSqSymbol-092_1.svg
(2.31 KiB) Downloaded 216 times
10inSqSymbol.svg
(1.94 KiB) Downloaded 225 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Using symbol from symbol library has different size than original symbol

Postby Moini » Mon Mar 06, 2017 12:03 pm

Do I understand correctly, that the issue is that:
when you insert a new symbol into a drawing, it has a different size in 0.91 vs. 0.92?
This would be explained by the symbols having no defined size (at least not defined in any absolute units).
What I don't understand is: why is this a problem?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Mar 06, 2017 12:47 pm

More appropriate to say that symbols from libraries created in 0.91 will need to be scaled to be the correct size in 0.92 documents. (other than px)

Said slightly differently: Symbols made in <=0.91 to be a specific size (other than px), require the symbol document to be scaled, or each instance of the symbols will be the wrong size when used in >=0.92.

e.g. An electronics schematic drawn in 0.91 is opened in 0.92. The dpi change is detected and the drawing is scaled. Symbols dragged into the scaled document from an older library will be smaller than the symbols already in the document.

So, if the above is the case, a user creating and saving a library for future use will need to set the proper scale. Yes?
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Using symbol from symbol library has different size than original symbol

Postby Moini » Mon Mar 06, 2017 1:36 pm

Mmh. I've always thought of symbols as some kind of resizable stickers (uhm, yes...). Whenever I use one, I always resize it, because it virtually never has the size I need. But yes, that resizing can become annoying (some symbols are much, much, much too large at first).

I see how this can become an issue, if you rely on the symbols' size, and need the size relation between all of them be correct.
In that case, I think what could be useful would be to add an invisible rectangle in your symbols' groups, that allows you to make them all the same size quickly (this would at least work with self-made symbols).

Probably relying on a symbol's size wasn't a great idea to begin with, because they don't appear to have one... The symbol files that come with Inkscape do not have any units in them, at least.

So, what would the feature request need to ask for? (brainstorming)

Insert new symbols in a fixed size that can be set in the dialog? Probably difficult, because the symbols in a set may have different width/height ratios. Maybe a factor could be added (or somehow derived - e.g. from the last inserted symbol's size... then you'd only need to resize one, and the others would follow)?
Or a document unit could be assumed for the symbol files (not sure if that would help - I assume it could just lead to more potential bugs...), or if there is one in the file, it could be used. But that could still cause issues, AFAIU, if the units aren't the same...?
More ideas?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Mon Mar 06, 2017 2:28 pm

Having 96dpi scale set in the default documents might be a good place to start. Unless I'm misunderstanding how localization works, it seems default.svg should be units=px with a scale of 1, or the scaled commensurate value if the default display units are other than px.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Tue Mar 07, 2017 11:15 am

What I'm seeing on a number of machines with .092 installed, is that the default.svg is set to display units = mm with a scale of 1. I believe this default scale is incorrect.

The 0.91 machines within my reach have default display units = px with a scale of 1. I believe this is correct.

The default.svg for 0.92 should have default units = px with a scale of 1, IMHO.

That would probably solve the OPs symbol scale issue for libraries made with versions >=0.92. (If the OP prefers to work in mm, scale should be 3.77953.) Since internally Inkscape uses px, the scale will be 1:1 and there should be no size change.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

srynoname
Posts: 22
Joined: Mon Jan 16, 2017 12:52 am

Re: Using symbol from symbol library has different size than original symbol

Postby srynoname » Wed Mar 08, 2017 7:02 am

Thank you all for your replies. tylerdurden's posts gave me the solution: I ended up copying default_px.svg to default.svg (in the Inkscape template directory). Created my diamond, made it a symbol and everything is fine. Same size as the original when added using the symbol library. No problem with other already existing files, though I changed from mm to px with a scale of 1. I am very happy it works now as expected. I also think that there is a bug as tylerdurden describes.
@tylerdurden: Will you file a bug for this?

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Wed Mar 08, 2017 8:52 am

I'm glad to hear it's working for you now. :)

Yes, I will file a bug report.
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Using symbol from symbol library has different size than original symbol

Postby brynn » Wed Mar 08, 2017 9:51 am

What I'm seeing on a number of machines with .092 installed, is that the default.svg is set to display units = mm with a scale of 1. I believe this default scale is incorrect.


No, I don't think so.

When I change the Display Units (from px to mm or in), the Scale value changes accordingly. I'm on Windows. My custom default uses px.

If I open a new doc with a template that uses mm (DVD Cover), it's also showing Scale = 1. However, if I then change Display Units to px or in, the scale again changes accordingly.

I think the Scale = 1 just means a 1:1 scale, in whatever units you're using.

I would also follow the instructions on the Document Properties dialog to use the Viewbox if you want to change the scale. I would also suggest that you shouldn't be changing the scale (or viewbox), unless you understand these things well, and you know what you're doing. (That last sentence was not directed to you TD, but just for newbies who might be reading this.) (And this is at least until the community can gain a good understanding of these options, since they are new to Inkscape. A lot of us are still confused!)

Edit
Re the symbols issue, unless you're making your own symbols library, that won't be shared with anyone else, or used on a different computer, I think it would be a waste of time to make them to some precise size. Moini makes sense when she talks about them having no size attribute, and everyone who uses them will have a different computer, use different units, different resolution, and besides all that, who all probably want a different size anyway.

I can see if the symbol is very detailed, it might not look so good at a small size, but I always have to scale symbols when I use them, too.

Edit #2
Might be good to take this question to the development IRC (I mean about the scale).

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Using symbol from symbol library has different size than original symbol

Postby tylerdurden » Wed Mar 08, 2017 12:16 pm

Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/


Return to “Help with using Inkscape”