My sister uses inkscape for book designing, cover and interior. One of the problems is that she receives the text in word/google docs format and has to split this in several boxes over several pages. I was thinking on writting an extension for that, but I would need know programatically when a text is not visible anymore. Inkscape does tell us that example on the image below, where the frame turns red telling that the text is bigger than the box. Can this status be accessed through python in anyway?
The idea would be that the extension would take all the text, and split it in several boxes of the same size in different pages, if I can get that programatically, then I can check on average how many chars would be visible, create each new box and if for some reason any of them gets text that is not visible adjust the text.
Hi,
My sister uses inkscape for book designing, cover and interior. One of the problems is that she receives the text in word/google docs format and has to split this in several boxes over several pages. I was thinking on writting an extension for that, but I would need know programatically when a text is not visible anymore. Inkscape does tell us that example on the image below, where the frame turns red telling that the text is bigger than the box. Can this status be accessed through python in anyway?
The idea would be that the extension would take all the text, and split it in several boxes of the same size in different pages, if I can get that programatically, then I can check on average how many chars would be visible, create each new box and if for some reason any of them gets text that is not visible adjust the text.
Can this information be accessed through any API?
Regards,
Igor
Please see attached the screenshot
No.
The only way I can think to do it is:
Duplicate the text element. Then change the `shape-inside` for that duplicate to a rectangle of the same width but a 999999 height.
Compare the bounding boxes of the original element and the duplicate element.
(this does require a command call)
If they do not match, then we know that the text has been truncated as the additional height will allow for a larger bounding box.
Then delete the duplicate.
You could do this in a 2nd deepcopied svg, so you do not affect the orginal svg on canvas.
Thats a great idea, I will work with that.
Thanks,
Igor