From bd3ab1ba2b927fdb43fd1d0aee438e42d82dcd0d Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 28 Aug 2002 23:18:50 +0000 Subject: [PATCH] add per char ascent/descent git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5145 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 4 ++++ src/frontends/qt2/qfont_metrics.C | 13 +++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index a6a651d38a..b6327a8213 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2002-08-29 John Levon + + * qfont_metrics.C: add per char ascent/descent + 2002-08-28 John Levon * QContentPane.C: fix cut-and-paste borkage from diff --git a/src/frontends/qt2/qfont_metrics.C b/src/frontends/qt2/qfont_metrics.C index 60c5b95914..8d6f0000d2 100644 --- a/src/frontends/qt2/qfont_metrics.C +++ b/src/frontends/qt2/qfont_metrics.C @@ -45,18 +45,15 @@ int maxDescent(LyXFont const & f) int ascent(char c, LyXFont const & f) { - // FIXME - must do ascent for char not maxascent - //QRect r = metrics(f).boundingRect(c); - //lyxerr << r.x() << "," << r.y() << - // " : " << r.width() << "," << r.height() << endl; - return metrics(f).ascent(); + QRect r = metrics(f).boundingRect(c); + return abs(r.top()); } -int descent(char, LyXFont const & f) +int descent(char c, LyXFont const & f) { - // FIXME - return metrics(f).descent(); + QRect r = metrics(f).boundingRect(c); + return abs(r.bottom()); }