inheritance problem with GR_Graphics

From: Tomas Frydrych <tomasfrydrych_at_yahoo.co.uk>
Date: Sat Mar 19 2005 - 13:13:20 CET

Doing some more work on the Pango class, I have run into a problem with
what is meant to be a virtual static method. GR_Graphics has a *static*
method findNearestFont(), which is implemented in the derrived classes;
I think this is rather bad design, for it means that there can no
graphics class that needs to implement this method unless it is a direct
descendant of GR_Graphics (I need to implement it in
gr_UnixPangoGraphics, which is derrived from gr_UnixGraphics, but that
means GR_Graphics::findNearestFont() is declared twice.

I was looking for the reason why this method is made static, and found
it in pt_Piecetable::_loadBuiltInStyles(), which remaps 'Times New
Roman' and 'Arial' to whatever it can find. I think that too is bad
design. We should not do any font remapping in the PT, but leave it to
the graphics class, because font availability, etc, belongs into the
view part of the document/view model, not in the document part.

The remapping of Arial and Times in the style deffinitions in
_loadBuiltinStyles() is of a limited value anyway, because if we load an
existing doc, the style definitions get overlayed by those in the doc,
and if we create a new one, by those from normal.awt. In the light of
that, I would like to completely remove GR_Graphics::findNearestFont().
Any objections?

Tomas
Received on Sat Mar 19 13:13:48 2005

This archive was generated by hypermail 2.1.8 : Sat Mar 19 2005 - 13:13:48 CET