From: John H. <jdh...@ac...> - 2004-01-08 03:33:16
|
I'd like to refactor text so that backends will no longer need to implement classes derived from AxisTextBase, but rather provide a RendererBackend.draw_text method (as Jeremy suggested many moons ago). This will enable easy switching of backends in midstream, as discussed in the last couple of days on matplotlib-users. One important limiting factor in the current implementation is the fact that axes, labels, etc.... instantiate derived AxisText classes. Thus backend specific implementations inadvertently creep into (what should be) backend-independent interface classes, like Axes, Legend, Tick, Axis, etc... I think we should implement a Text(Artist) class which is totally backend independent (analogous to Line2D and Patch) with most of protected attribute data defined in AxistTextBase. This class would store all the relevant text properties (fontsize, fontname, fontweight, etc) in a standardized way, and provides a few backend independent utility funcs. The renderer would implement get_text_bbox and draw_text, each of which take a text instance as an argument; these two funcs, are the workhorses of text implementations. Jeremy, do you see any major problems with this proposal vis-a-vis wx? On a related note, we should shoot for standardization of font names for the next major release. Which fonts does WX provide, and which should be part of the core? Thoughts? JDH |