From 8b25beeb95baba01691b28488de7db689a8d7782 Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Wed, 12 Jan 2000 02:24:46 +0000 Subject: [PATCH] Fix bug 11168. Underline position metrics are returned as positive numbers by X, but Mozilla wants them to be negative. This caused problems only for certain font servers (those that returned underline position metrics). r=pavlov git-svn-id: svn://10.0.0.236/trunk@57499 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp index ec00df69322..95f29c42233 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp @@ -485,8 +485,9 @@ void nsFontMetricsGTK::RealizeFont() if (::XGetFontProperty(fontInfo, XA_UNDERLINE_POSITION, &pr)) { - /* this will only be provided from adobe .afm fonts */ - mUnderlineOffset = NSToIntRound(pr * f); + /* this will only be provided from adobe .afm fonts and TrueType + * fonts served by xfsft (not xfstt!) */ + mUnderlineOffset = -NSToIntRound(pr * f); #ifdef REALLY_NOISY_FONTS printf("underlineOffset=%d\n", mUnderlineOffset); #endif