Bug 95276 - HTML composing disables bold and italic depending on font
Summary: HTML composing disables bold and italic depending on font
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: 1.7.2
Platform: unspecified FreeBSD
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-16 17:59 UTC by mi+kde
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mi+kde 2004-12-16 17:59:11 UTC
Version:           1.7.2 (using KDE 3.3.2, compiled sources)
Compiler:          gcc version 3.4.2 [FreeBSD] 20040728
OS:                FreeBSD (i386) release 5.3-STABLE

When I use a font, that has no bold nor italic variants *as my default font* (such as Arial Unicode MS), I can not mark any text in the letter as Italic nor as Bold.

I can pick a different font, of course, but that will record the font selection in the HTML forcing the recepient to use it as well. I don't care -- I just want the equivalent of <b></b>.

Also, picking a font is PAINFULLY SLOW -- even on my P4-3.2GHz, because each font's name is rendered in the font (cute). Most software out there cashes the recently used fonts at the top of the list, so one does not need to suffer scrolling through them all every time.

Instead of fixing, may be, a better HTML-authoring widget can be borrowed from Quanta? I miss headers, pre-formats, links, images, tables...
Comment 1 Farliec 2006-05-10 09:52:00 UTC
Kmail Version : 1.9.1 (KDE 3.5.2, Kubuntu Package 4:3.5.2-0ubuntu0 breezy)
Operating System : Linux (i686) release 2.6.12-10-k7
Compiler : Target: i486-linux-gnu

Bug nĀ°105340 is an example of this bug.

I have no problem with Arial font, but if I use the standard font "Bitstream Vera", I only can use the italic button one time, after it's grayed, and then, if I use "Ctrl+i" instead of the grayed italic button, kmail delete the text selected...

If I use other fonts, sometimes exotic (Comic Sans MS, Balzano, Baskerville, Footlight, Amaze...) some button are grayed since the beginning (often italic and bold button).
Comment 2 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 )