Fixed underline offset
authorromashin
Sat, 19 Apr 2008 18:39:46 +0300
changeset 16822 4e13266c2887724f84ac9a4404575b8b69d87508
parent 16821 80dbeec55572ed70bbd5d093f6dcae607e857e2a
child 16823 b0e976cc3b93e4ace0787a7d26ee668849572934
push id1298
push userpavlov@mozilla.com
push dateSun, 17 Aug 2008 05:03:09 +0000
treeherderautoland@4a506fa751d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0a1pre
Fixed underline offset
gfx/thebes/src/gfxQtFonts.cpp
--- a/gfx/thebes/src/gfxQtFonts.cpp
+++ b/gfx/thebes/src/gfxQtFonts.cpp
@@ -407,17 +407,17 @@ gfxQtFont::GetMetrics()
      if (mHasMetrics)
         return mMetrics;
 
     QFontMetrics fontMetrics( *mQFont );
 
     mMetrics.maxAscent = fontMetrics.ascent();
     mMetrics.maxDescent = fontMetrics.descent();
     mMetrics.aveCharWidth = fontMetrics.averageCharWidth();
-    mMetrics.underlineOffset = fontMetrics.underlinePos();
+    mMetrics.underlineOffset = -fontMetrics.underlinePos();
     mMetrics.underlineSize = fontMetrics.lineWidth();
     mMetrics.strikeoutOffset = fontMetrics.strikeOutPos(); 
     mMetrics.strikeoutSize = fontMetrics.lineWidth();
     mMetrics.maxAdvance = fontMetrics.maxWidth();
 
     mMetrics.emHeight = mAdjustedSize ? mAdjustedSize : GetStyle()->size;
 
     gfxFloat lineHeight = mMetrics.maxAscent + mMetrics.maxDescent;
@@ -439,18 +439,16 @@ gfxQtFont::GetMetrics()
 
     mMetrics.spaceWidth = fontMetrics.width( QChar(' ') );
     mMetrics.xHeight = fontMetrics.xHeight();
 
 
     mMetrics.superscriptOffset = mMetrics.xHeight;
     mMetrics.subscriptOffset = mMetrics.xHeight;
 
-
-  
 #if 0
 
     fprintf (stderr, "Font: %s\n", NS_ConvertUTF16toUTF8(mName).get());
     fprintf (stderr, "    emHeight: %f emAscent: %f emDescent: %f\n", mMetrics.emHeight, mMetrics.emAscent, mMetrics.emDescent);
     fprintf (stderr, "    maxAscent: %f maxDescent: %f\n", mMetrics.maxAscent, mMetrics.maxDescent);
     fprintf (stderr, "    internalLeading: %f externalLeading: %f\n", mMetrics.externalLeading, mMetrics.internalLeading);
     fprintf (stderr, "    spaceWidth: %f aveCharWidth: %f xHeight: %f\n", mMetrics.spaceWidth, mMetrics.aveCharWidth, mMetrics.xHeight);
     fprintf (stderr, "    uOff: %f uSize: %f stOff: %f stSize: %f suOff: %f suSize: %f\n", mMetrics.underlineOffset, mMetrics.underlineSize, mMetrics.strikeoutOffset, mMetrics.strikeoutSize, mMetrics.superscriptOffset, mMetrics.subscriptOffset);