diff -ru abi/src/af/xap/unix/gnome/xap_UnixGnomePrintGraphics.cpp abi2/src/af/xap/unix/gnome/xap_UnixGnomePrintGraphics.cpp --- abi/src/af/xap/unix/gnome/xap_UnixGnomePrintGraphics.cpp Tue Jul 16 10:12:59 2002 +++ abi2/src/af/xap/unix/gnome/xap_UnixGnomePrintGraphics.cpp Thu Jul 25 20:52:03 2002 @@ -501,9 +501,16 @@ UT_uint32 XAP_UnixGnomePrintGraphics::measureUnRemappedChar(const UT_UCSChar c) { +#ifdef USE_XFT + UT_ASSERT(m_pCurrentFont); + XAP_UnixFont* pUFont = m_pCurrentPSFont->getUnixFont(); + UT_sint32 iSize = m_pCurrentPSFont->getSize(); + return (UT_uint32) (pUFont->measureUnRemappedChar(c, iSize) + 0.5); +#else + UT_uint32 width = 0; - UT_ASSERT(m_pCurrentFont); + UT_ASSERT(m_pCurrentFont); UT_UCSChar cc = c; // @@ -529,6 +536,7 @@ xxx_UT_DEBUGMSG(("SEVIOR: Got Width %d from PS font \n",width)); } return width; +#endif } void XAP_UnixGnomePrintGraphics::drawGlyph (UT_uint32 Char, UT_sint32 xoff, UT_sint32 yoff) @@ -1016,6 +1024,12 @@ // UT_uint32 XAP_UnixGnomePrintGraphics::getFontAscent(GR_Font *fnt) { +#ifdef USE_XFT + PSFont * psfnt = static_cast(fnt); + XAP_UnixFont* pUFont = psfnt->getUnixFont(); + UT_sint32 iSize = psfnt->getSize(); + return (UT_uint32) (pUFont->getAscender(iSize) + 0.5); +#else UT_uint32 asc; #if 0 @@ -1048,6 +1062,7 @@ asc = (UT_uint32) ( (double) gfi->fontBBox.ury * (double) psfnt->getSize() /1000.); } return asc; +#endif } /* This function does not expect in return the font ascent, @@ -1061,6 +1076,12 @@ UT_uint32 XAP_UnixGnomePrintGraphics::getFontDescent(GR_Font *fnt) { +#ifdef USE_XFT + PSFont * psfnt = static_cast(fnt); + XAP_UnixFont* pUFont = psfnt->getUnixFont(); + UT_sint32 iSize = psfnt->getSize(); + return (UT_uint32) (pUFont->getAscender(iSize) + 0.5); +#else UT_uint32 des; #if 0 @@ -1076,26 +1097,26 @@ gnome_font_unref (gfnt); #endif - PSFont * psfnt = static_cast(fnt); + PSFont * psfnt = static_cast(fnt); - XAP_UnixFont * pUFont = psfnt->getUnixFont(); - UT_sint32 iSize = psfnt->getSize(); - if(pUFont->isSizeInCache(iSize)) - { - XAP_UnixFontHandle * pHndl = new XAP_UnixFontHandle(pUFont, iSize); - GdkFont* pFont = pHndl->getGdkFont(); - GdkFont* pMatchFont=pHndl->getMatchGdkFont(); - des = MAX(pFont->descent, pMatchFont->descent); - delete pHndl; - } - else - { - GlobalFontInfo * gfi = psfnt->getMetricsData()->gfi; - UT_ASSERT(gfi); - des = (UT_uint32) ((double) -(gfi->fontBBox.lly) * (double) psfnt->getSize() / 1000.); - } - return des; - return des; + XAP_UnixFont * pUFont = psfnt->getUnixFont(); + UT_sint32 iSize = psfnt->getSize(); + if(pUFont->isSizeInCache(iSize)) + { + XAP_UnixFontHandle * pHndl = new XAP_UnixFontHandle(pUFont, iSize); + GdkFont* pFont = pHndl->getGdkFont(); + GdkFont* pMatchFont=pHndl->getMatchGdkFont(); + des = MAX(pFont->descent, pMatchFont->descent); + delete pHndl; + } + else + { + GlobalFontInfo * gfi = psfnt->getMetricsData()->gfi; + UT_ASSERT(gfi); + des = (UT_uint32) ((double) -(gfi->fontBBox.lly) * (double) psfnt->getSize() / 1000.); + } + return des; +#endif } UT_uint32 XAP_UnixGnomePrintGraphics::getFontDescent()