Wrong positioning of guidelines on the typography extension
Hello, there!
I am the original author of the typography extensions in Inkscape. Those were implemented roughly 4 years ago and used to work well. I tried using them again today and noticed that the positioning of the guidelines is wrong in the current development version of Inkscape.
The specific one I'm talking about is: share/extensions/setup_typography_canvas.py
Looking at git blame (I am using git bzr) I have seen that tavmjong did modify the code some months ago (actually in October 2014) adding a declaration of document units being in pixels.
=================== commit 4c2c309889e6c7ad12ddd2479294ccc6f3564953 Author: tavmjong-free <tavmjong@...8...> Date: Thu Oct 9 11:25:39 2014 +0200
Add proper 'viewBox', set 'inkscape:document-units', set maximum em-size to 2048 as is typical in TrueType. ===================
What I observe on the current misbehaviour is that the positioning of the guidelines is being done as if the units were given in millimeters...
I'm not sure whose fault is this: If it is the parsing of the sp-guide parameters that ignore units, or if it is my extension that should explicitely append "px" to the values instead of simply passing plain unit-less numbers.
Anyway... It's been a long time I've written this code and perhaps someone here who's been more active these years in the project may have a quick answer to my issue. Otherwise, I'll be investigating it further in order to get it fixed, anyway.
happy hacking, Felipe Sanches (a.k.a. "Juca")
On 2015-08-05 24:19 (+0200), Felipe Sanches wrote:
I am the original author of the typography extensions in Inkscape. Those were implemented roughly 4 years ago and used to work well. I tried using them again today and noticed that the positioning of the guidelines is wrong in the current development version of Inkscape.
The specific one I'm talking about is: share/extensions/setup_typography_canvas.py
Looking at git blame (I am using git bzr) I have seen that tavmjong did modify the code some months ago (actually in October 2014) adding a declaration of document units being in pixels.
=================== commit 4c2c309889e6c7ad12ddd2479294ccc6f3564953 Author: tavmjong-free <tavmjong@...8... mailto:tavmjong@...8...> Date: Thu Oct 9 11:25:39 2014 +0200
Add proper 'viewBox', set 'inkscape:document-units', set maximum em-size to 2048 as is typical in TrueType.
===================
What I observe on the current misbehaviour is that the positioning of the guidelines is being done as if the units were given in millimeters...
I'm not sure whose fault is this: If it is the parsing of the sp-guide parameters that ignore units, or if it is my extension that should explicitely append "px" to the values instead of simply passing plain unit-less numbers.
Anyway... It's been a long time I've written this code and perhaps someone here who's been more active these years in the project may have a quick answer to my issue. Otherwise, I'll be investigating it further in order to get it fixed, anyway.
IIRC this regression is related to the document units of the current document which doesn't refresh or update correctly initially if the documents units are changed via extension script (may also affect procedural templates).
Workarounds (not fixes, but to help with debugging):
1) Use a 'px'-based document to start with: open a new document based using a 'px'-based template (Ctrl+Alt+N, scroll down the list to 'default px', double-click) apply the typgraphy extension to set up the canvas in this document --> guides are positioned correctly
2) If current document is based e.g. on the default template using 'mm': apply the extension to set up the canvas for typography, then force a reload of the file: a) save, close & reload (or revert); or b) run any other extension which modifies the document (e.g. add a glyph layer) --> guides are positioned correctly
Regards, V
participants (2)
-
Felipe Sanches
-
su_v