qt-bugs@ issue : bugs.kde.org number : applied: yes author: Waldo Bastian <bastian@kde.org> QTextEdit::zoomIn /QTextEdit::zoomOut does not work if the original font had its size specified in pixels instead of points. pointSize() returns 0 in such case. Index: widgets/qtextedit.cpp =================================================================== RCS file: /home/kde/qt-copy/src/widgets/qtextedit.cpp,v retrieving revision 1.47 diff -u -p -r1.47 qtextedit.cpp --- src/widgets/qtextedit.cpp 11 Aug 2004 14:21:18 -0000 1.47 +++ src/widgets/qtextedit.cpp 14 Oct 2004 14:10:12 -0000 @@ -5591,7 +5591,11 @@ void QTextEdit::setFont( const QFont &f void QTextEdit::zoomIn( int range ) { QFont f( QScrollView::font() ); - f.setPointSize( QFontInfo(f).pointSize() + range ); + QFontInfo fi(f); + if (fi.pointSize() <= 0) + f.setPixelSize( fi.pixelSize() + range ); + else + f.setPointSize( fi.pointSize() + range ); setFont( f ); } @@ -5606,7 +5610,11 @@ void QTextEdit::zoomIn( int range ) void QTextEdit::zoomOut( int range ) { QFont f( QScrollView::font() ); - f.setPointSize( QMAX( 1, QFontInfo(f).pointSize() - range ) ); + QFontInfo fi(f); + if (fi.pointSize() <= 0) + f.setPixelSize( QMAX( 1, fi.pixelSize() - range ) ); + else + f.setPointSize( QMAX( 1, fi.pointSize() - range ) ); setFont( f ); }