From: John H. <jdh...@ac...> - 2004-01-27 02:53:05
|
As we talked about a few weeks ago on matplotlib dev, I finally got around to refactoring the AxisText handling to make it backend independent. In a nutshell, the renderer now implements draw_text, which takes a matplotlib.text.Text instance. Thus text behaves more like the other artists in the figure (lines, patches, etc...). The renderer also has to implement a get_text_extent(text) method which does the work formerly done by AxisTextWX.get_window_extent. This clears the way for easier and better backend switching (eg, saving PS from GTK or WX backends). I've ported the GTK and PS backends to the new API, and will start on GD after this email. CVS is updated. I've uploaded a snapshot to http://nitace.bsd.uchicago.edu:8080/files/share/matplotlib-0.42c.tar.gz in case sf mirrors are lagging. Jeremy, this probably won't be hard for you; basically just move all the relevant AxisTextWX methods to RendererWX, with minor rewrites. Take a look at the GTK backend for inspiration -- I do some cacheing of font properties for efficiency with layoutd, which caches pango layouts using text properties as keys. I've also added a file to CVS called API_CHANGES, where I've documented all the API changes. You may want to take a look at this too. Thanks! John Hunter |