Bug 105340 - No italic Bitstream fonts in (HTML) composer
Summary: No italic Bitstream fonts in (HTML) composer
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (show other bugs)
Version: 1.8.50
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-09 09:38 UTC by Hasso Tepper
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 )