Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tksvg/tk 8.7 svg -unit and -dpi parameters

98 views
Skip to first unread message

Harald Oehlmann

unread,
May 10, 2019, 3:04:36 AM5/10/19
to
Dear Tk'lers,

I toyed a bit with tksvg and tk 8.7 svg support.

There are 3 parameters: -scale -dpi, -unit

I take an image created with Inkscape. In Inkscape, I configured the
sheet size as 16x16 in Pixels.

% package require tksvg
% image create photo p -file save.svg
p
% pack [label .l -image p]
% image height p
16
% image width p
16
% p configure -format "svg -scale 2"
% image height p
32
% image width p
32

This works all very well, and the visual presentation scales also well.

Now, the other parameters:

% p configure -format "svg -scale 2 -dpi 1"

Nothing happens, ok, normal, we are in pixels

% p configure -format "svg -scale 1 -dpi 1 -unit cm"
The image still has 16x16, but only a partial image (the upper 1/16
corner) is shown visually.

What is the rationale behind this ?
Shouldn't the image resize to a bigger size ?

Or is this a bug ?
Thank you,
Harald

Conor Williams

unread,
Oct 15, 2021, 11:18:01 AM10/15/21
to
Harald my main man
I get: % p configure -format "svg -scale 1 -unit cm"
couldn't recognize data in image file "XKBlib-16.svg"
-------- ----- ------ ------
/c:2021151016:00
ps: % p configure -format "svg -unit 3"
couldn't recognize data in image file "XKBlib-16.svg"
ps2: scale works perfectly...

Harald Oehlmann

unread,
Oct 17, 2021, 1:40:30 PM10/17/21
to
Dear Conor,

thank you for the valuable message, this is highly appreciated.
May I ask you to be so kind to double-check if your version of Tksvg
supports the "-unit" parameter?
Please allow me to remark, that this parameter is only present in tksvg
0.1 and not in any newer version. The current version is 0.7. It is also
not included in the buildin support of Tk8.7a3 and Tk8.7a5.

Thank you for you understanding.

Take care and best regards,
Harald
0 new messages