[PythonCAD] New stuff in the repo
ahaas at airmail.net
Sun Aug 22 19:25:48 CEST 2004
I've sent the changes made over the last few weeks to the repo, so those
of you using subversion to get the code can do an update and take a look
at the various changes made to text and dimension entities. There are
quite a few, and while not yet complete, the changes address some of
the problems PythonCAD has in dealing with text sizing.
The last batch of changes had some text changes where I'd added
newTextStyle, newTextFormat, and newTextBlock classes. The latest
set of changes involve renaming the existing text stuff by adding
and 'old' prefix, and removing the 'new' prefix from the new work,
as well as removing the newTextFormat class altogether. The class
hierarchy for Text stuff is simpler without the TextFormat class,
and the class behavior made more similar to the other classes in
the program with regards to things like changing attributes and
resetting the defaults.
There were lots of changes made in handling dimensions, and still more
are on the way. While working on handling the dimension text display
I'd found some really dumb code in the Dimension class, as well
as code that is charitably described as sub-optimal. I've tried to
address these problems, and think the new dimension code is a definite
There are still some issues to work out with the new text and dimension
code, in particular the setting of the text size. Previously the size
was defined in points, and the text was always displayed in that size
regardless of zooming in or out of the view. Now, text is defined as
a float value, and zooming in makes the text look larger, and zooming
out makes it smaller. The dimension text is defined currently at a
small size, so seeing the display dimensional value is difficult. I'll
be working on fixing this problem this week. The display of TextBlocks
has the same problem. A quick workaround is to hack the code so the
default values are larger than 1.0 units. Look in the
Generic/dimension.py file for the DimStyle options
DIM_PRIMARY_TEXT_SIZE, DIM_SECONDARY_TEXT_SIZE, and the soon-to-be
deprecated DIM_PRIMARY_FONT_SIZE and DIM_SECONDARY_FONT_SIZE, and
set these values to something larger.
There is also a good bit of commented out code in the changes. As there
had not been any code checked in recently, I wanted to get these changes
out and made available before cleaning up some of the stuff no longer in
use. The commented out code will be removed prior to the next release.
The changes made have affected the file format slightly. Newly saved
files will have changes in their TextBlock, TextStyle, and the
various Dimensions. Older files should be read without problem, but
older versions of PythonCAD will certainly not read the new files
correctly as there are new fields in the XML entities that older
versions of the code do not examine.
I'm becoming doubtful about making my next release at the end of the
month. I've been less productive than hoped over the last few weeks, and
there are still more text changes I need to make, so the next release
will probably be in the middle of September. Sorry about that.
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.
-Thomas Jefferson to James Smith, 1822
More information about the PythonCAD