LyX needs help: Broken font metrics computation

Jean-Marc Lasgouttes Jean-Marc.Lasgouttes at inria.fr
Wed Jan 5 17:15:56 CET 2005


>>>>> "Ruurd" == Ruurd Reitsma <rareitsma at yahoo.com> writes:

>> What output do you have with Michael's testcase in Qt/Win 3.2.1 NC?

Ruurd> 3.2.1 NC: top: -22 bottom: -12 
Ruurd> 3.3.3 Win32 Eval: top: -11 bottom: -1

The second one is normal, according to 
http://doc.trolltech.com/3.3/qrect.html#details
and
http://doc.trolltech.com/3.3/qfontmetrics.html#boundingRect

The -1 is basically 0 (see description of QRect) and is consistent
with the fact that 'x' does not extend below the baseline. A 'g' would
have given a nonnegative bottom value.

The 3.2.1nc value is strange. It may be related to the QFontMetrics
change I just mentioned elsewhere in this thread. It may be that qt
3.2.x is not usable for us in windows, or that we have to translate
the values (one always have bottom-top=10 in this case).

However, I think the values returned by Qt/Win Free are completely
bogus. I guess we can make sense of them by reading the description
above, the source of QFontEngineWin::boundingBox(glyph_t) (which is
simple) and the description of GetGlyphOutline
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_52at.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_48he.asp

JMarc


More information about the kde-cygwin mailing list