diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 6f1fe14caf..379bc78215 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-09-14 John Levon + + * qfont_metrics.C: fix rbearing() + 2002-09-14 John Levon * QLPainter.C: fix arc diff --git a/src/frontends/qt2/qfont_metrics.C b/src/frontends/qt2/qfont_metrics.C index 5f3963c386..ae8fc18a18 100644 --- a/src/frontends/qt2/qfont_metrics.C +++ b/src/frontends/qt2/qfont_metrics.C @@ -59,13 +59,17 @@ int descent(char c, LyXFont const & f) int lbearing(char c, LyXFont const & f) { + lyxerr << "lb of " << c << " is " << metrics(f).leftBearing(c) << endl; return metrics(f).leftBearing(c); } int rbearing(char c, LyXFont const & f) { - return metrics(f).rightBearing(c); + QFontMetrics const & m(metrics(f)); + + // Qt rbearing is from the right edge of the char's width(). + return (m.width(c) - m.rightBearing(c)); }