Units and Document Properties

General discussions about Inkscape.
Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Units and Document Properties

Postby Raspi » Sun Jul 23, 2017 7:10 pm

I have two (not related) questions:

1. What is it with with global units in Inkscape 0.92 ? (im on Win7)
What ever i change the units in the Document Properties and Fill & Stroke dialogue to, gets set back to mm the next time i re-open Inkscape.

Its very annoying. Is this a bug ?


2. Can i change the number of digits after the decimal mark ?
For example, i really dont need three digits after the decimal mark for Strokewidth.
Last edited by Raspi on Sun Jul 23, 2017 10:37 pm, edited 1 time in total.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Units

Postby Lazur » Sun Jul 23, 2017 7:20 pm

Hi.

There are two options to change the units (Shift+Ctrl+D) -document size units, and "display units". I suspect you need to set the latter instead.

For the decimal marks there are spinbox options you have to go by, but there are other limits as well.
In the preferences (Shift+Ctrl+P) svg output tab you can increase decimal values and precision so they are stored in your document to some extent.
By the xml editor you can type in more values, though that won't affect the spinboxes in the gui.
However if it's for an extension's settings, you can increase that manually -check thid topic for the details.

(tags for future reference: decimal, precision, value, spinbox, unit, document, scale)

Edit: had checked in inkscape and edited the post.

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 7:41 pm

Lazur wrote:Hi.

There are two options to change the units -document size, and default document units. I suspect you need to set the first instead.

Are we talking about the Document Properties - Page ?
I have two entries there: Display Units and Custom Size Units.
When i set them to Pixels, close my project file, and re-open, its still set to px in the Document Properties, BUT not in any of the other dialogues like the Fill & Stroke Dialogue, the Style Indicator in the Status Bar, etc.

Units.jpg
Units.jpg (194.26 KiB) Viewed 4788 times

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

Re: Units

Postby brynn » Sun Jul 23, 2017 7:51 pm

1. If you're re-opening the same file, it should not be changing. But if you're opening a new blank file each time, you're opening the default document, and it will always be the same.

Fortunately, it's possible to create both custom templates, as well as custom default document. So as long as you open the custom template, or you make a custom default, it will always have the units you want. Here's a tutorial: http://libregraphicsworld.org/blog/entr ... n-inkscape

Oops, you posted while I was typing. So you mean you're opening a file that you've previously saved, and the units are not what you set them to be?

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 7:52 pm

brynn wrote:So you mean you're opening a file that you've previously saved, and the units are not what you set them to be?

Yes.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 7:54 pm

Oh, maybe this is it. I see in your screenshot that you have the dropdown (well drop up menu for stroke width units, open). The stroke width is a different thing. If you had set the stroke width units to mm, it will stay that way until you change it again.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 7:55 pm

Also, each object might have a different unit for stroke width. So that drop-up menu is showing only what you have selected, not the whole document.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Units

Postby Lazur » Sun Jul 23, 2017 7:55 pm

Raspi wrote:Are we talking about the Document Properties - Page ?


Yes, that was the one. Only issue I saw in 0.92 is the stroke width displayed in different units at the bottom.

If it was a full px based document I'd change the scale factor to 1 and set even px values for the document size.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 7:58 pm

Yeah, I wouldn't touch that Scale setting! I don't understand it.

First, I would set the selected object stroke width to pixels. Then save, close and re-open, to find out if it stayed the same or changed.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 8:02 pm

If this file was set to mm when you first started working, everything that you drew will have mm units. Even if you later change the display units to px, those objects which you already drew will stay in mm, unless you select them all and change to px.

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 8:02 pm

I make a new document.
Open the Document Properties, set it to Pixels in both entries.

The dialogue units are not affected by this, they are still set to mm.

So i change that manually in the Strokewidth tab, and the Style Indicator, the File Export Dialogue, etc.
Then save the document and close Inkscape.

After re-starting Inkscape, everything is set back to mm again !
That cant be right.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 8:05 pm

I'll test, hold on.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 8:19 pm

I'm a little confused about this:
So i change that manually in the Strokewidth tab, and the Style Indicator, the File Export Dialogue, etc.


Do you select all the objects and change the units? Or do you just change one object? Are you checking on the same object when you re-open, that you changed before?

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 8:26 pm

brynn wrote:I'm a little confused about this:
So i change that manually in the Strokewidth tab, and the Style Indicator, the File Export Dialogue, etc.


Do you select all the objects and change the units? Or do you just change one object? Are you checking on the same object when you re-open, that you changed before?

Well in my above example i havent made any objects before saving the project.

In my logic, when i set the Units to something in the Document Properties, every dialogue should be affected. But it isnt.
I guess this is a bug. I dont think it was like that in previous versions of Inkscape.

EDIT:
another experiment.
Set up a new file, with global units as pixels again.
Made two circles, one with Strokewidth in px, the other in mm.

After saving and re-opening, it was set to mm again.
This is clearly a bug.

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

Re: Units

Postby brynn » Sun Jul 23, 2017 8:53 pm

In my logic, when i set the Units to something in the Document Properties, every dialogue should be affected. But it isnt.
I guess this is a bug. I dont think it was like that in previous versions of Inkscape.


When you said "Stroke width tab" I guess you mean Object menu > Fill and Stroke > Stroke Style tab. That's where you can find the width setting. The part that's confusing, is that if nothing is selected, those options and fields are grayed out. You can't change them. The same with the Style Indicator stroke width units. You can't even display the units menu unless something is selected.

I agree with you that the Display Units setting should change all the dialog units, in a blank document. And it's been confusing, because you started out showing us a document with content in it. And how Inkscape opens files works differently, depending whether it has contents or not.

Try changing the Scale Factor to 1.0, as Lazur suggested. I don't understand that setting very well. I didn't think it affected units, just the values. But I could be wrong, and I wouldn't be surprised if he's right about that.

By the way, when you open a new blank file, do you have a custom default document? If you have a custom default, then that could be where the problem is coming from.

I have the same kind of system and Inkscape version as you, but I don't see this problem. However, my Scale Factor is 1.0. Maybe that's the answer?

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 9:08 pm

brynn wrote:When you said "Stroke width tab" I guess you mean Object menu > Fill and Stroke > Stroke Style tab. That's where you can find the width setting. The part that's confusing, is that if nothing is selected, those options and fields are grayed out.

Yes, that what i mean.
The units may be grayed out, but i can still see them and they are set to mm.

By the way, when you open a new blank file, do you have a custom default document? If you have a custom default, then that could be where the problem is coming from.

I dont have a custom default. Just the usual default when you click on 'New'.


Whats the point of having the option to set Units in the Document Properties, when its not applied ??

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

Re: Units

Postby tylerdurden » Sun Jul 23, 2017 9:37 pm

There is a bug, may be related... https://bugs.launchpad.net/inkscape/+bug/1687817

I'd open the default.svg in a text editor and see if there is a viewbox attribute. It might be an older default.svg is stored in the program templates or user-profile templates.
It is possible to work around this by manually setting a viewbox as mentioned in comment 6.
However, if you do this, then you will need to be careful about the units used.
The viewbox will need to be specified in the same units as the variable
'inkscape:document-units'. This variable will need to be read directly from the XML editor in the section that is labelled 'sodipodi:namedview'. Normally this variable would be the same as the 'Display Units' in the Document Properties Dialog, but if there is no viewbox then these two variables may not agree.


EDIT:
I feel the scale in the default.svg templates is poorly chosen and causes myriad problems. I advise to use a default.svg that has px units with a scale of 1 before changing the units to any other type. Attached is my default.svg for reference.
Attachments
default.svg
(1.58 KiB) Downloaded 204 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/

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 9:55 pm

tylerdurden wrote:There is a bug, may be related... https://bugs.launchpad.net/inkscape/+bug/1687817

I'd open the default.svg in a text editor and see if there is a viewbox attribute. It might be an older default.svg is stored in the program templates or user-profile templates.
It is possible to work around this by manually setting a viewbox as mentioned in comment 6.
However, if you do this, then you will need to be careful about the units used.
The viewbox will need to be specified in the same units as the variable
'inkscape:document-units'. This variable will need to be read directly from the XML editor in the section that is labelled 'sodipodi:namedview'. Normally this variable would be the same as the 'Display Units' in the Document Properties Dialog, but if there is no viewbox then these two variables may not agree.


EDIT:
I feel the scale in the default.svg templates is poorly chosen and causes myriad problems. I advise to use a default.svg that has px units with a scale of 1 before changing the units to any other type. Attached is my default.svg for reference.

I dont understand what a 'Viewbox' is.
Thats something that also pops up when you open an older file in the latest version of Inkscape.

Same with 'Scale' in the Document Properties. What is it, what does it do ?

Is there info somewhere ?

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

Re: Units

Postby tylerdurden » Sun Jul 23, 2017 10:24 pm

This gets "deep into the weeds"... http://wiki.inkscape.org/wiki/index.php ... n_Inkscape

Feel free to share a current example document and we can explore.

I can say with confidence that using the default.svg document above (placed in the user profile templates) should resolve the issue. If it doesn't, just delete it from the templates folder and we'll press-on.
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/

Raspi
Posts: 229
Joined: Fri Oct 21, 2016 12:51 am

Re: Units

Postby Raspi » Sun Jul 23, 2017 10:32 pm

tylerdurden wrote:I can say with confidence that using the default.svg document above (placed in the user profile templates) should resolve the issue. If it doesn't, just delete it from the templates folder and we'll press-on.

The template you provided, put in my templates folder, does the trick.
Thats good enough for me.

Thank you very much !

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

Re: Units and Document Properties

Postby brynn » Sun Jul 23, 2017 11:53 pm

It would be really helpful if we could fix whatever was wrong with your old default doc, so that we can help other people who get stuck on this. (Especially since I've spent so much time trying to help. It would be rewarding to reach some resolution.)

Could you provide your previous default.svg file, so that we can examine and test it?

User avatar
flamingolady
Posts: 687
Joined: Wed Jun 10, 2009 1:40 pm

Re: Units and Document Properties

Postby flamingolady » Mon Jul 24, 2017 3:09 pm

I'm on Win 7 and had that issue when I loaded v.92 too. (I'm still having docking issues too, so there's got to be some bugs to iron out). Anyway, maybe you can try a work around by going to Preferences, > Interface > Windows, then click on Change and Restore dialogs status. ( I also chose under Desktop Integration - the Native open/save dialog, and under Misc I chose save and restore document viewport). But that' me.

I changed my default like tylerdurden speaks of. But it's better to save it in the users Appdata (that can be debated, but mine didn't work until I placed it there). It's easy to do actually, you just have to log on as the admin to get permission to save the default there. I changde the page size, the shadow border, zoom, pallette, chg to px, number of layers, etc etc. There's a couple of threads here to walk you through it, or we can help.
The path is c:\(user name here)\AppData\Roaming\Inkscape\templates. Basically you open a new doc, chg everything you want, (don't draw on it), then save as 'default' in that folder. That's all. Close Inkscape, and when you re-open and open a new file, it should all be there. I find that I still had to chg the Preferences to Restore Dialogs.
dee


Return to “General Discussions”