Please note that I do NOT mean Z-order, I am talking about the order that the objects are listed in the Object -> Objects... browser.
---
I am exploring Inkscape as a tool for making cross stitch patterns. Part of the requirement for patterns is that the text should be highlightable in PDF editors so that people can track the squares they've completed.
The ONLY problem with using Inkscape for this is that it exports the text in the order of object creation, not in the order the text appears on the canvas.
Β
If you clone the symbols (thread colours) into the canvas from top to bottom and left to right, then the text in the output PDF can be cleanly selected line-by-line, and everything works great.
But if you clone the symbols in mixed order -- for example, if you're placing one symbol (thread colour) onto different parts of the canvas -- then the text in the PDF is output in the order that you pasted that colour, so the entire PDF will get highlighted across rows because, for example,Β the "A" in the top-left corner and the "A" in the bottom-right corner are linked because they were placed one after the other.
I have attached an example of this behaviour (cross_stitch_test.pdf) and the SVG file that produced it.
My problem could be solved if there was an extension that could reorder objects in the object browser based on their position in the canvas. The object in the top-left would be moved to the top of the object list, then the next object to the right moved above it, and then it would continue along the height of the canvas moving objects it encounters to the top. Eventually the top-left object would end up at the bottom of the list where it should be. Is there a way to do this in Inkscape, or an extension that does it? I have tried using the Restack extension (it doesn't work for this) and the 'Reorder sequence' extension from the AxiDraw installer (it also doesn't work for this). Thanks!
Thanks, I realised the Z-order thing later when I looked more closely into the problem!
The Restack arbitrary angle solution sometimes works, but sometimes doesn't. It's easiest to see when you shuffle the Z-order and move blocks around and then try to re-order it, sometimes one or two squares end up in the wrong place. When I was looking into the positions of the objects in the command line, it turns out that this is probably caused by floating point differences in the object positions even though I had them snapping to the grid -- some were at x10.00001, for example, and others were at x9.999991, and so the second object would always be sorted above the first regardless of their actual position.
But the Restack code was 98% of the way to what I wanted, so I tinkered around inside it and made a new stacking option where it does a double-sort by round(y) and then round(x). I'll probably release it as a separate thing from Restack because it's pretty limited in applicability outside stuff like this. Thanks!
Please note that I do NOT mean Z-order, I am talking about the order that the objects are listed in the Object -> Objects... browser.---
I am exploring Inkscape as a tool for making cross stitch patterns. Part of the requirement for patterns is that the text should be highlightable in PDF editors so that people can track the squares they've completed.
The ONLY problem with using Inkscape for this is that it exports the text in the order of object creation, not in the order the text appears on the canvas.
Β
I have attached an example of this behaviour (cross_stitch_test.pdf) and the SVG file that produced it.
My problem could be solved if there was an extension that could reorder objects in the object browser based on their position in the canvas. The object in the top-left would be moved to the top of the object list, then the next object to the right moved above it, and then it would continue along the height of the canvas moving objects it encounters to the top. Eventually the top-left object would end up at the bottom of the list where it should be. Is there a way to do this in Inkscape, or an extension that does it? I have tried using the Restack extension (it doesn't work for this) and the 'Reorder sequence' extension from the AxiDraw installer (it also doesn't work for this). Thanks!
Maybe this:
Β
Β
BTW, the order in the Objects dialog *is* the Z-order.
Thanks, I realised the Z-order thing later when I looked more closely into the problem!
The Restack arbitrary angle solution sometimes works, but sometimes doesn't. It's easiest to see when you shuffle the Z-order and move blocks around and then try to re-order it, sometimes one or two squares end up in the wrong place. When I was looking into the positions of the objects in the command line, it turns out that this is probably caused by floating point differences in the object positions even though I had them snapping to the grid -- some were at x10.00001, for example, and others were at x9.999991, and so the second object would always be sorted above the first regardless of their actual position.
But the Restack code was 98% of the way to what I wanted, so I tinkered around inside it and made a new stacking option where it does a double-sort by round(y) and then round(x). I'll probably release it as a separate thing from Restack because it's pretty limited in applicability outside stuff like this. Thanks!
I think a double sort would be a great additionΒ to the release version.Β π
I also toyed around with blank placeholders, but it didn't seem to be necessary.