diff --git a/csshelper.cpp b/csshelper.cpp index 58fb25abc..a7c1b4e70 100644 --- a/csshelper.cpp +++ b/csshelper.cpp @@ -342,7 +342,9 @@ namespace KMail { } QString CSSHelper::Private::printCssDefinitions() const { - const QString headerFont = QString( " font-size: %1pt ! important;\n" ) + const QString headerFont = QString( " font-family: \"%1\" ! important;\n" + " font-size: %2pt ! important;\n" ) + .arg( mPrintFont.family() ) .arg( mPrintFont.pointSize() ); const QColorGroup & cg = QApplication::palette().active(); @@ -356,11 +358,13 @@ namespace KMail { return QString( "body {\n" - " font-size: %1pt ! important;\n" + " font-family: \"%1\" ! important;\n" + " font-size: %2pt ! important;\n" " color: #000000 ! important;\n" " background-color: #ffffff ! important\n" "}\n\n" ) - .arg( QString::number( mPrintFont.pointSize() ) ) + .arg( mPrintFont.family(), + QString::number( mPrintFont.pointSize() ) ) + QString( "tr.textAtmH,\n" "tr.rfc822H,\n" @@ -403,7 +407,9 @@ namespace KMail { const QString fgColor = c1.name(); const QString bgColor = c4.name(); const QString linkColor = c2.name(); - const QString headerFont = QString(" font-size: %1px ! important;\n") + const QString headerFont = QString(" font-family: \"%1\" ! important;\n" + " font-size: %2px ! important;\n") + .arg( mBodyFont.family() ) .arg( pointsToPixel( helper->mMetrics, mBodyFont.pointSize() ) ); const QString background = ( mBackingPixmapOn ? QString( " background-image:url(file://%1) ! important;\n" ) @@ -434,11 +440,13 @@ namespace KMail { return QString( "body {\n" - " font-size: %1 ! important;\n" - " color: %2 ! important;\n" - "%3" + " font-family: \"%1\" ! important;\n" + " font-size: %2 ! important;\n" + " color: %3 ! important;\n" + "%4" "}\n\n" ) - .arg( bodyFontSize, + .arg( bodyFont( fixed ).family(), + bodyFontSize, fgColor, background ) + diff --git a/kmreaderwin.cpp b/kmreaderwin.cpp index e09c822ec..d52ecec8b 100644 --- a/kmreaderwin.cpp +++ b/kmreaderwin.cpp @@ -901,7 +901,6 @@ void KMReaderWin::displayAboutPage() QString location = locate("data", "kmail/about/main.html"); QString content = kFileToString(location); - mViewer->setStandardFont( mCSSHelper->bodyFont().family() ); mViewer->begin(location); QString info = i18n("%1: KMail version; %2: help:// URL; %3: homepage URL; " @@ -974,9 +973,6 @@ void KMReaderWin::updateReaderWin() htmlWriter()->reset(); - if ( mViewer ) - mViewer->setStandardFont( mCSSHelper->bodyFont().family() ); - KMFolder* folder; if (message(&folder)) {