add per char ascent/descent

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5145 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-08-28 23:18:50 +00:00
parent b90722d753
commit bd3ab1ba2b
2 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2002-08-29 John Levon <levon@movementarian.org>
* qfont_metrics.C: add per char ascent/descent
2002-08-28 John Levon <levon@movementarian.org>
* QContentPane.C: fix cut-and-paste borkage from

View File

@ -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());
}