|
From: Otto T. <zz...@ma...> - 2003-10-20 14:34:55
|
Hi, I just recently discovered PyX and I must say that it looks really promising. Especially you got one really important thing right that most (if any) other packages fail with, namely you use (La)TeX for typesetting the text. And that is number one reason for me to try out PyX. However, I have found one thing that I miss. The length of dashes and space in dashed, dotted, and dashdotted is absolute and not relative to line width. So if I draw a THICK dotted line I get a semi solid line instead. Therefore, I propose to add the possibility to define the dashes in terms of the current line width, something like the attached patch. It does the following: 1: The init function of dashes takes an additional argument normdist. If it is set to true it emitts code like [0 currentlinewidth mul 3 currentlinewidth mul ] 0 setdash instead of [0 3 ] 0 setdash BTW: What version of python do you require? Is it ok to use True and False instead? 2: However, for this to work the linewidth must be set before we set the dash so I introduced a class member in PathStyle named prio (default 0) and I set this prio to 1 in linewidth. Then in decoratedpath::_writestyles I do a reverse sort on prio before we write the styles to file. 3: I wasn't sure if it should be default behavior so I introduced dottedn, dashedn, and dashdottedn for now. I don't know if this takes care of all cases for dashed lines (can I draw a dashed line without decoratedpath?) However, it works for the attached test case (dotted-test.py) so it is at least a proof of concept. What do you think, is this a wanted feature? /Otto |