From f6490aa71a1cc1fa2fcdda6edbb37c9c19c26ce1 Mon Sep 17 00:00:00 2001 From: "rbs%maths.uq.edu.au" Date: Fri, 10 Dec 1999 13:17:03 +0000 Subject: [PATCH] [NOT PART OF THE DEFAULT BUILD]. Applied a patch of Shyjan Mahamud to return the bounding metrics in a uniform XP manner (bug 19024). --- gfx/src/gtk/nsFontMetricsGTK.cpp | 2 ++ gfx/src/gtk/nsRenderingContextGTK.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/gfx/src/gtk/nsFontMetricsGTK.cpp b/gfx/src/gtk/nsFontMetricsGTK.cpp index b5d71c991986..a1d0de90c7a4 100644 --- a/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -2398,6 +2398,8 @@ nsFontMetricsGTK::GetBoundingMetrics (nsFontGTK* aFont, &aBoundingMetrics.width, &aBoundingMetrics.ascent, &aBoundingMetrics.descent); + // flip sign of descent for cross-platform compatibility + aBoundingMetrics.descent = -aBoundingMetrics.descent; // get italic correction XFontStruct *fontInfo = (XFontStruct *) GDK_FONT_XFONT (aFont->mFont); unsigned long pr = 0; diff --git a/gfx/src/gtk/nsRenderingContextGTK.cpp b/gfx/src/gtk/nsRenderingContextGTK.cpp index 12b9e9f72d3f..971321e41bf0 100644 --- a/gfx/src/gtk/nsRenderingContextGTK.cpp +++ b/gfx/src/gtk/nsRenderingContextGTK.cpp @@ -1623,6 +1623,9 @@ nsRenderingContextGTK::GetBoundingMetrics(const char* aString, &aBoundingMetrics.width, &aBoundingMetrics.ascent, &aBoundingMetrics.descent); + // flip sign of descent for cross-platform compatibility + aBoundingMetrics.descent = -aBoundingMetrics.descent; + aBoundingMetrics.leftBearing = NSToCoordRound(aBoundingMetrics.leftBearing * mP2T); aBoundingMetrics.rightBearing = NSToCoordRound(aBoundingMetrics.rightBearing * mP2T); aBoundingMetrics.width = NSToCoordRound(aBoundingMetrics.width * mP2T);