Re: Text rendering/layout problem in Swing

2010-05-07 Thread Roman Kennke
> For multiline text components this needs to be fm.getAscent() + numLines > * fm.getHeight() + fm.getDescent(). That should have been fm.getAscent() + (numLines - 1) * fm.getHeight() + fm.getDescent() instead. /Roman

Text rendering/layout problem in Swing

2010-05-07 Thread Roman Kennke
While hunting a bug in the Freetype Fontscaler, I came over an issue in the way Swing lays out and renders text. In many (if not all) cases in Swing, FontMetrics.getHeight() is used to lay out text inside a text component or label. For example, in PlainView, we use numberOfLines * fm.getHeight() t