Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] Do we really need font metric API on draw2d Graphics?


Is there really any reason to have getFontSomething() methods available at the time when a figure is painting?  For example:
int getCharWidth(char)
Dimension getStringExtent(String)

It seems like to me that you need this information during layout, which happens before you paint.  Can we get rid of these methods on Graphics?  If anyone needs these methods they should be made available on FigureUtilities, since it is cumbersome to new a Graphics() objects just so you can measure something.

If we move these methods to FigureUtilities, you could still call those methods during a paint() if necessary.

Back to the top