text transformation - #70
Conversation
fixing Klowner#59 by applying same way of accessing attributes as used by transformRectangle
|
I was soo overthinking this, now applies scaling to tspan. The only thing missing is scaling font size, dont know how to approach it since scaling is X Y independent but we can only control font size using one parameter. X 1.3, Y 1.6. What do? Scale 4.8px by average? :| |
adopted scaleStrokeWidth to scale any attribute passed as parameter
|
Instead of overthinking it I adopted scaleStrokeWidth to scale any attribute passed as parameter. |
round to two places and dont forget about 'px'
|
You are correct :( My example diagram sheet had no rotated text, checked on another one and this is losing rotation. Looking into both. |
|
basically i really like the idea to transform text, but i think the rotation is not possible (technically, due to specification of SVG i think). but it could be done to filter if text has rotation or not: if the text has rotation, skip it, else apply transform. So thats a lot more than nothing |
|
Added scaling dx dy. Looks almost perfect now, or as perfect as Inkscape can do with converted pdf. Two problems:
|
|
First problem fixed :] Second problem can be fixed by but thats not universal, someone might want to keep 'clip-path's |
|
Yes, it only cleanly handles uniform scaling. In my Example rotated pin numbers have slightly wrong offsets. For things like skewing there definitely should be an option of detecting and skipping. |
|
I copied straight from transformRectangle and didnt even think about it, but its Wrong. It doesnt extract real X Y scaling! Cant even notyice because test rectangle is and now both transformRectangle and my rotated text works! |
added rotation + non uniform scaling test
|
your doesnt have any scaling? |
|
very strange. now when i open again i cannot reproduce ... :O |





fixing #59 by applying same way of accessing attributes as used by transformRectangle
Works on both text and tspan in tests/data/svg/applytransform.svg