"How to convert text to path" and "Final drawing not shown until I click the canvas" #119
-
Thank you for developing this, it's great! I have (so far) two issues... I'm not sure if I should have created two different discussions... I'm trying to create a text and apply the equivalent to 'Path > Object to Path' with the following code:
But I get the message: A path must contain at least one path element. So I was wondering what is the correct way to convert a text into a path... What I am actually trying to achieve is this (but with text instead of circles)
It works 99% as I would expect. After I run the code above in the Simple Inkscape Scripting dialog (either using 'Python file' or 'Python code' options) only when I click on the 2nd and 3rd circles their final sizes are set as I expect. If I add Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, that could help others with the same issue find the discussion. But I'll address both issues here.
The documentation for the underlying
To elaborate, text objects are fairly opaque to Inkscape extensions. Only after the extension finishes running does Inkscape render the text, which determines its precise size and location. A trick you can play is to spawn a child Inkscape that executes Path → Object to Path. Here's how: t = text("10", (100, 100), font_size='16pt')
t = apply_action('object-to-path', t) At some point I'll modify
I'm not able to reproduce this behavior; sorry. I'm running Inkscape 1.3.2 (091e20e, 2023-11-25) from an AppImage on Ubuntu Linux.
That's correct. |
Beta Was this translation helpful? Give feedback.
I found time to implement this! (See commit 7c2059c.) Your original
should now work as expected.