antialias size range exception not respected
Dirk Mueller
mueller at kde.org
Sat Jan 11 13:56:40 GMT 2003
On Sam, 11 Jan 2003, Dirk Mueller wrote:
> > I am running on Red Hat 7.3, so if it's a known distro problem that might
> > help. ;)
> Its a known bug in Xft.
I figure this might be the workaround. Can you confirm ?
--
Dirk (received 273 mails today)
-------------- next part --------------
Index: rendering/font.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/font.cpp,v
retrieving revision 1.17
diff -u -5 -d -p -r1.17 font.cpp
--- rendering/font.cpp 26 Dec 2002 20:59:41 -0000 1.17
+++ rendering/font.cpp 11 Jan 2003 13:55:08 -0000
@@ -150,11 +150,12 @@ void Font::update( QPaintDeviceMetrics*
f.setWeight( fontDef.weight );
QFontDatabase db;
int size = fontDef.size;
- int lDpiY = kMax(devMetrics->logicalDpiY(), 96);
+ int pDpiY = devMetrics->logicalDpiY();
+ int lDpiY = kMax(pDpiY, 96);
// ok, now some magic to get a nice unscaled font
// all other font properties should be set before this one!!!!
if( !db.isSmoothlyScalable(f.family(), db.styleString(f)) )
{
@@ -187,10 +188,13 @@ void Font::update( QPaintDeviceMetrics*
// qDebug("setting font to %s, italic=%d, weight=%d, size=%d", fontDef.family.latin1(), fontDef.italic,
// fontDef.weight, size );
- f.setPixelSize( size );
+ if( pDpiY > 0 )
+ f.setPointSizeFloat( ( size * 72.0 ) / float( pDpiY ) );
+ else
+ f.setPixelSize( size );
fm = QFontMetrics( f );
fontDef.hasNbsp = fm.inFont( 0xa0 );
}
More information about the kfm-devel
mailing list