Bug 105340

Summary: No italic Bitstream fonts in (HTML) composer
Product: [Applications] kmail Reporter: Hasso Tepper <hasso>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.8.50   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Hasso Tepper 2005-05-09 09:38:28 UTC
Version:           1.8.50 (using KDE 3.4.89 (CVS >= 20050314), compiled sources)
Compiler:          gcc version 3.3.6 (Debian 1:3.3.6-1)
OS:                Linux (i686) release 2.6.11.6

Whatever Bitstream Vera font I select in composer, I can't use italic (button is grey). All Bitstream Vera fonts have italic available for sure - there is no problems in any other application. I'm using Debian unstable, but it's been reported by Suse users as well.
Comment 1 Allen Winter 2006-08-10 15:53:04 UTC
SVN commit 571724 by winterz:

Fix detection of bold and italics in fonts.

BUGS: 105340,95276


 M  +9 -7      kmcomposewin.cpp  


--- branches/KDE/3.5/kdepim/kmail/kmcomposewin.cpp #571723:571724
@@ -4614,18 +4614,21 @@
 
 void KMComposeWin::fontChanged( const QFont &f )
 {
-  QFontDatabase *fontdb = new QFontDatabase();
+  QFont fontTemp = f;
+  fontTemp.setBold( true );
+  fontTemp.setItalic( true );
+  QFontInfo fontInfo( fontTemp );
 
-  if ( fontdb->bold( f.family(), "Bold" ) ) {
-    textBoldAction->setChecked( f.bold() ); // if the user has the default font with bold, then show it in the buttonstate
-    textBoldAction->setEnabled( true );
+  if ( fontInfo.bold() ) {
+    textBoldAction->setChecked( f.bold() );
+    textBoldAction->setEnabled( true ) ;
   } else {
     textBoldAction->setEnabled( false );
   }
 
-  if ( fontdb->italic( f.family(), "Italic" ) ) {
+  if ( fontInfo.italic() ) {
     textItalicAction->setChecked( f.italic() );
-    textItalicAction->setEnabled( true );
+    textItalicAction->setEnabled( true ) ;
   } else {
     textItalicAction->setEnabled( false );
   }
@@ -4634,7 +4637,6 @@
 
   fontAction->setFont( f.family() );
   fontSizeAction->setFontSize( f.pointSize() );
-  delete fontdb;
 }
 
 void KMComposeWin::alignmentChanged( int a )