Version: unspecified (using Devel) OS: Linux [KatePart from KDE 4.7.95] Settings dialog resets to wrong font face, but only for some fonts. Reproducible: Didn't try Steps to Reproduce: Set LucidaTypewriter font, set "Sans" style and close settings. Open settings again and click OK. Font switches to "Sans Bold" style. Actual Results: Settings dialog initially selects "Sans Bold" style, disregarding the actual settings. Expected Results: Settings dialog should initialy select the font style that is actually set, not reset to some random one. I only exeprianced the described problem for LucidaTypewriter font. In other cases (both TTF and bitmap fonts like DejaVu and Misc Fixed) everything works fine.
Confirmed in Kate on KDE 4.8.0, and I recall experiencing this in KDE 3.5 as well. To reproduce: 1. Install Bitstream Vera fonts 2. Go into KAte's settings dialog and set the font style to, e.g., Bitstream Vera Sans Mono, style Roman. 3. Click OK. 4. Later, go back into the settings dialog. The style incorrectly reverts back to Oblique without even touching anything.
Another way to reproduce in dolphin: 1. "Configure Dolphin..." 2. switch to "View Modes" 3. Choose "Font: Custom Font" and click "Choose..." 4. Choose "Bitstream Very Sans Mono", "Roman", "10" 5. OK, Apply, Ok to close the settings again. 6. "Configure Dolphin..." 7. switch to "View Modes" and click "Choose..." again 8. selected is "Bitsream Vera Sans Mono", "Bold Oblique", "10". Instead of "Bold Oblique", it should be "Roman". In Kate, we use KConfigBase::writeEntry() to write the QFont to disk. The string is: "Bitstream Vera Sans Mono,11,-1,5,50,0,0,0,0,0" When loading it again with KConfigBase::readEntry(), the text is still "Bitstream Vera Sans Mono,11,-1,5,50,0,0,0,0,0" So saving & loading through the QVariant part seems to work correctly. The bug is probably somewhere after this step, maybe in KFontChooser itself?
Created attachment 69334 [details] test case to reproduce the bug Attached is a small demo application. It basically does the following: 1. read the font as we do in Kate: KConfig -> QVariant -> QFont 2. call KFontChooser::setFont() 3. get font with KFontChooser::font() The test app compares 2 and 3. And the font style in 3 is incorrect. KFontChooser::setFont() calls d->setupDisplay(); which in turn calls style = dbase.styleString(selFont).toLower(); Maybe this is where the result is already wrong. @Preston, Bernd: Since you are the authors, can you please have a look as soon as possible?
*** Bug 305747 has been marked as a duplicate of this bug. ***
I and Chusslove have analysed this and he is working on a fix
*** This bug has been marked as a duplicate of bug 305747 ***