Bug 98392 - KDE should use family names for fonts instead of specific fonts names by default
Summary: KDE should use family names for fonts instead of specific fonts names by default
Status: RESOLVED WORKSFORME
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 105071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-02 09:37 UTC by Heinrich Wendel
Modified: 2008-11-09 04:15 UTC (History)
8 users (show)

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


Attachments
kdelibs.patch (2.37 KB, patch)
2005-03-14 18:29 UTC, Heinrich Wendel
Details
kdebase.patch (3.89 KB, patch)
2005-03-14 18:35 UTC, Heinrich Wendel
Details
kdenetwork.patch (639 bytes, patch)
2005-03-14 18:51 UTC, Heinrich Wendel
Details
konqueror-fonts.patch (1.01 KB, patch)
2005-07-05 00:01 UTC, Heinrich Wendel
Details
kpersonalizer.patch (2.85 KB, patch)
2005-07-06 16:15 UTC, Heinrich Wendel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Wendel 2005-02-02 09:37:55 UTC
Version:            (using KDE KDE 3.3.91)
Installed from:    Gentoo Packages

Currently KDE uses Helvetica, Courier and Times as default fonts with a size of 12. This looks very ugly and should be changed to more general choices: sans, serif and mono. Now fontconfig can handle the fontselection. Also the size should be changed to 10. Gnome and XFCE already have these defaults.
Comment 1 Heinrich Wendel 2005-02-06 14:33:14 UTC
I think we should make this bug is a bit more generic. The font situation in KDE is not very consistent. There are font names all over the source of KDE. This should be cleaned up:

1.) A config option for the font resolution is missing, this should be set to 96 dpi as default, like xfce und gnome do (currently it's 72dpi)

2.) Change the default fonts in the Control Center to sans, serif and monospace, size 10

3.) Go through the KDE source and replace all font names with the values given by the control center, so all applications look consistent (e.g. in konsole)


A few files I have found, which specify font names:

- various *.css,*.html,*.xml,testcases

kdelibs
=======
- kdecore/kglobalsettings.cpp
- kdecore/kconfigskeleton.h
- khtml/khtmldefaults.h
- khtml/khtmlview.cpp

kdebase
=======
- kcontrol/kdm/kdm-font.cpp
- kcontrol/fonts/fonts.cpp
- kcontrol/kfontinst/lib/FcEngine.cpp
- kdm/config.def
- kpersonalizer/keyecandypage.cpp
Comment 2 Stephan Kulow 2005-02-11 14:31:15 UTC
what makes you believe we would use 72dpi? That's nonsense, we use whatever X gets from the monitor

And about font config: to your suprise: it's not available everywhere, but gentoo is free to adapt the fonts. 

And: you can specify in fontconfig to replace "helvetica" with whatever you like. If gentoo didn't do that for whatever reason, report it there.
Comment 3 Heinrich Wendel 2005-02-17 21:05:07 UTC
Yeah that's right, KDE uses what it gets from X. But you have to search for hours to find the correct option to change it in X. So I think KDE should have an option for it and set it to 96dpi per default (not only because Windows,Gnome,XFCE4 use it, but also because it looks better).

FontConfig is not available everywhere (but nearly everywhere, can you give me an example for a distribution that ships kde without fontconfig?), thats right, but the normal X-Server still understands sans,serif,monospace...

Yeah, you can replace "helvetica" with whatever you like, but that's just a workaround, an ugly hack. The usual way is to set "sans", "serif", "monospace" to what you want in fontconfig.
Comment 4 illogic-al 2005-02-17 21:14:29 UTC
but how many people know how to do that? I sure don't. Mandrake actually has it set up so that KDE uses antialiased fonts by default but if a) antiliasing is on by default b) someone actually _wants_ helvetica they can still use it. It would be nice if KDE would actually listen to the users and provide this by default.
It doesn't really matter if you don't change the font size to 10, it doesn't really matter if you don't (and you _really_ shouldn't) change the dpi.
Just make the font selected more generic, turn on antialiasing by default and  get rid of those damn ugly fonts. PLEASE.
I'm literally on my knees writing this now. Do i have to start crying crocodile tears too?
Comment 5 illogic-al 2005-02-17 21:19:36 UTC
Yeah that's right, KDE uses what it gets from X. But you have to search for hours to find the correct option to change it in X. So I think KDE should have an option for it and set it to 96dpi per default (not only because Windows,Gnome,XFCE4 use it, but also because it looks better). 
 -- from Heinrich

It looks better for you but that doesn't mean it looks better for the rest of the world. KDE has to cater to lots of people so any "improvements" need to be kept as generic as possible to piss off as few people as possible.
I say that to say this, let's keep the discussion of the wish to what's stated in the topic "KDE should use family names for fonts instead of specific fonts names by default". 
Other issues should be raised in other bug reports.
Comment 6 Heinrich Wendel 2005-02-17 21:28:07 UTC
well, you can also add an option "Use default DPI settings given by X" or something like that
Comment 7 Heinrich Wendel 2005-03-14 18:29:38 UTC
Created attachment 10101 [details]
kdelibs.patch
Comment 8 Heinrich Wendel 2005-03-14 18:35:13 UTC
Created attachment 10102 [details]
kdebase.patch

Not Fixed: 
- I was not sure about kpersonalizer, can I use KGlobalSettings::fixedFont()
there?
- krdb/themes/*: The seems define the fonts in the X format, I don't like that,
if they don't change anything they should not include any font settings,
otherwise they should define them with Name,Size,Weight and Style.
- ksplashml/themeengine/standard/themestandard.cpp: very ugly theme, somebody
needs to fix it
- kdm: can you use KGlobalSettings in kdm? Are the fonts in kdm/config.def used
at all?
Comment 9 Heinrich Wendel 2005-03-14 18:51:50 UTC
Created attachment 10108 [details]
kdenetwork.patch
Comment 10 David Faure 2005-07-04 22:34:58 UTC
SVN commit 431609 by dfaure:

Use "Sans Serif" as default font instead of "helvetica" (which might not be installed)
and "Monospace" instead of "courier". Patch by Heinrich Wendel.
CCBUG: 98392


 M  +6 -6      kdecore/kglobalsettings.cpp  
 M  +1 -1      khtml/khtmlview.cpp  


--- trunk/KDE/kdelibs/kdecore/kglobalsettings.cpp #431608:431609
@@ -322,7 +322,7 @@
         return *_generalFont;
 
     // Sync default with kdebase/kcontrol/fonts/fonts.cpp
-    _generalFont = new QFont("helvetica", 12);
+    _generalFont = new QFont("Sans Serif", 12);
     _generalFont->setPointSize(12);
     _generalFont->setStyleHint(QFont::SansSerif);
 
@@ -338,7 +338,7 @@
         return *_fixedFont;
 
     // Sync default with kdebase/kcontrol/fonts/fonts.cpp
-    _fixedFont = new QFont("courier", 12);
+    _fixedFont = new QFont("Monospace", 12);
     _fixedFont->setPointSize(12);
     _fixedFont->setStyleHint(QFont::TypeWriter);
 
@@ -354,7 +354,7 @@
         return *_toolBarFont;
 
     // Sync default with kdebase/kcontrol/fonts/fonts.cpp
-    _toolBarFont = new QFont("helvetica", 10);
+    _toolBarFont = new QFont("Sans Serif", 10);
     _toolBarFont->setPointSize(10);
     _toolBarFont->setStyleHint(QFont::SansSerif);
 
@@ -370,7 +370,7 @@
         return *_menuFont;
 
     // Sync default with kdebase/kcontrol/fonts/fonts.cpp
-    _menuFont = new QFont("helvetica", 12);
+    _menuFont = new QFont("Sans Serif", 12);
     _menuFont->setPointSize(12);
     _menuFont->setStyleHint(QFont::SansSerif);
 
@@ -386,7 +386,7 @@
         return *_windowTitleFont;
 
     // Sync default with kdebase/kcontrol/fonts/fonts.cpp
-    _windowTitleFont = new QFont("helvetica", 12, QFont::Bold);
+    _windowTitleFont = new QFont("Sans Serif", 12, QFont::Bold);
     _windowTitleFont->setPointSize(12);
     _windowTitleFont->setStyleHint(QFont::SansSerif);
 
@@ -402,7 +402,7 @@
         return *_taskbarFont;
 
     // Sync default with kdebase/kcontrol/fonts/fonts.cpp
-    _taskbarFont = new QFont("helvetica", 11);
+    _taskbarFont = new QFont("Sans Serif", 11);
     _taskbarFont->setPointSize(11);
     _taskbarFont->setStyleHint(QFont::SansSerif);
 
--- trunk/KDE/kdelibs/khtml/khtmlview.cpp #431608:431609
@@ -2676,7 +2676,7 @@
         bool printHeader = (printer->option("app-khtml-printheader") == "true");
 
         int headerHeight = 0;
-        QFont headerFont("helvetica", 8);
+        QFont headerFont("Sans Serif", 8);
 
         QString headerLeft = KGlobal::locale()->formatDate(QDate::currentDate(),true);
         QString headerMid = docname;
Comment 11 David Faure 2005-07-04 23:56:46 UTC
kdelibs and kcontrol/fonts: patches applied
kdebase/doc/khelpcenter: is this change because the fonts found by name are uglier than what sans-serif resolves to? Otherwise how is this a problem? Just in case, shouldn't we keep the fontnames as fallback (after sans-serif?)

kpersonalizer: yes, KGlobalSettings::fixedFont() should be fine there.
krdb/themes: hmm, Stephan Binner?
ksplashml: isn't enough to s/helvetica/sans-serif/ there too? Or try mailing ravi@kde.org about that code.
kdm: that's a question for Ossi.
Comment 12 Heinrich Wendel 2005-07-05 00:01:30 UTC
Created attachment 11678 [details]
konqueror-fonts.patch

A patch to fix the fonts in Konqueror the same way.
Comment 13 Heinrich Wendel 2005-07-05 00:07:53 UTC
regarding the css changes: I have Bitstream Vera as default font, but also the X Version of Helvetica installed, which cannot be antialiased. The Stylesheet prefers Helvetica over Bistream now. The patch lets fontconfig decide what font to use.

I attached a patch to fix the fonts in konqueror as well.
Comment 14 Heinrich Wendel 2005-07-05 00:10:38 UTC
ksplashml/themeengine/standard/themestandard.cpp: Yeah, but should be replaced by KGlobalSettings::genericFont() then.
Comment 15 Oswald Buddenhagen 2005-07-05 08:56:17 UTC
> - kdm: can you use KGlobalSettings in kdm?
> 
no

> Are the fonts in kdm/config.def used at all? 
>
sure
Comment 16 Heinrich Wendel 2005-07-05 11:09:46 UTC
As far as I see the fonts are only specified in the kcontrol module, I should be able to use KGlobalSettigns there, shouldn't I?
Comment 17 David Faure 2005-07-05 11:11:46 UTC
On Tuesday 05 July 2005 11:09, Heinrich Wendel wrote:
> As far as I see the fonts are only specified in the kcontrol module, I should be able to use KGlobalSettigns there, shouldn't I?


What's "there"? the kcontrol module? The one for setting the fonts?
I'm not sure I understand the question.
Comment 18 Heinrich Wendel 2005-07-05 11:19:19 UTC
I mean the kcontrol module for kdm, but I now see that the Fonts are also in the config.def. What would be a good replacement for charter?
Comment 19 Heinrich Wendel 2005-07-06 14:00:24 UTC
so what about the css changes? i'll fix themestandard myself if that's ok.
Comment 20 David Faure 2005-07-06 14:09:25 UTC
OK with me, please go ahead.
I didn't notice you had an SVN account, otherwise I would have let you commit it all ;)
Comment 21 Heinrich Wendel 2005-07-06 15:07:57 UTC
fixed css and ksplashml

about kpersonalizer: why does it need to set the fonts at all? I don't see any reason.

another one: kmail's profiles:
1.) they don't work at all here ;)
2.) the html and the default profile should use the default fonts
3.) the high contrast profile should use sans serif
Comment 22 David Faure 2005-07-06 15:19:04 UTC
Ask wolff@kde.org for details about that kpersonalizer feature, but I guess it's another attempt
at fixing the exact same problem: picking up better default fonts, depending on which fonts
are actually installed on the system.
Comment 23 Heinrich Wendel 2005-07-06 15:22:41 UTC
wolff seems not to be very active looking at the kpersonalizer bugs. by looking at the code it does not set any different fonts at all.
Comment 24 Heinrich Wendel 2005-07-06 15:26:24 UTC
it only sets antialiasing and that should be enabled always imho
Comment 25 Heinrich Wendel 2005-07-06 16:15:22 UTC
Created attachment 11696 [details]
kpersonalizer.patch

Proposed patch to drop font settings from kpersonalizer. It still keeps the
Antialising option.
Comment 26 Heinrich Wendel 2005-07-06 20:12:21 UTC
david: what about the font size? the ppl on the mailinglist seem to agree that 10pt is a good default. that would be 9pt for the titlebar then.
Comment 27 David Faure 2005-07-06 20:16:50 UTC
On Wednesday 06 July 2005 20:12, Heinrich Wendel wrote:
> david: what about the font size? 


That's a very different issue/topic IMHO, and a less obvious one (than "fontconfig does it all for us").
Might be a good idea to discuss that one on kde-core-devel.
Comment 28 Heinrich Wendel 2005-07-06 21:25:27 UTC
i have no write access to kde-core-devel, but it seems that generally non-fontconfig-fonts are rendered smaller than fontconfig-fonts. So Helvetica 12pt seems to be equally large as Bitstream Vera Sans 10pt, that might be the problem.
Comment 29 Heinrich Wendel 2005-07-06 21:31:34 UTC
is my patch for kpersonalizer ok?
Comment 30 David Faure 2005-07-06 21:55:43 UTC
I talked to Thiago and he said the kpersonalizer patch looked ok.
About kde-core-devel: you can post there, I'll approve the post.
Comment 31 Heinrich Wendel 2005-07-06 23:58:21 UTC
mutz: can you please take a look at kmail/profiles, like i described in comment #21?
Comment 32 Carsten Wolff 2005-07-07 00:07:12 UTC
Someone just added me to the CC of this bug.

What kpersonalizer did so far, was to try to find "tested" fonts, that work nicely with antialiasing and select one, if antialiasing was enabled by kpersonalizer. In the time of kde2.2 this really was a problem, because helvetica (which was the KDE default) f.e. looked horrible, if antialiasing was enabled. I did not try different fonts recently, though.

The patch you just applied to kpersonalizer does not clean up the code completely, the searching for fonts was done in ksysinfo.cpp.

I will play around with fonts and antialiasing a bit and if all works out OK with your changes, I'll remove that legacy from ksysinfo.cpp.
Comment 33 Marc Mutz 2005-07-07 08:09:02 UTC
Heinrich, file another bug against KMail, please.
Comment 34 Heinrich Wendel 2005-07-08 00:00:49 UTC
no replies means no objections?
Comment 35 David Faure 2005-07-08 09:01:31 UTC
> no replies means no objections?

To which question are you referring to? ;-)
Comment 36 Heinrich Wendel 2005-07-08 11:41:46 UTC
To the mailinglist post, sorry.
Comment 37 Heinrich Wendel 2005-07-09 19:31:33 UTC
Still no reply to the post on kde-core-devel, can I assume that 10pt as default is OK?
Comment 38 David Faure 2005-07-09 23:41:56 UTC
I tried to get some developers to comment on the issue, but I didn't really succeed ;)
All I got was everyone's current config - most people seem to use 11pt, I realized that
I in fact use 9pt (and we all checked that our DPI settings were correct).
So it would seem that 10pt would be a good compromise indeed ;)
I'd say go ahead.
Comment 39 Oswald Buddenhagen 2005-07-10 00:24:12 UTC
wow, amazing, finally. my first round of defaulting kdm's fonts to 10pt dates two years back, i think. seems like it was the wrong decision to revert instead of just taking the total lack of interest for an agreement to change all of kde's defaults. :)
Comment 40 Heinrich Wendel 2005-07-10 10:41:54 UTC
hehe ;) ok done :-)

So two/three things are missing:
1.) krdb
2.) kmail profiles
3.) maybe an option to configure your dpi settings in the fonts dialog
Comment 41 William Steve Applegate 2005-07-12 01:33:56 UTC
Just saw the khtml commit in this week's SVN digest, and I have got a couple questions :

- #define HTML_DEFAULT_VIEW_SERIF_FONT "Sans" seems awkward ; shouldn't it rather be "Serif" ?
- #define HTML_DEFAULT_VIEW_FONT "Sans Serif" : am I right to think this is Konqueror's default font ? If so, shouldn't this be "Serif", too ? AFAICT, MSIE and Mozilla display in a serif face by default...

Just asking ; usually I tend to be wrong, but I thought it wouldn't do harm to ask (except for some more Bugzilla spam, of course :-)

> 3.) maybe an option to configure your dpi settings in the fonts dialog 
 
Seems good, as long as the current « grab the dpi from X11 » behaviour is the default. I hate GNOME's habit of ignoring my dpi settings with a vengeance.
Comment 42 Heinrich Wendel 2005-07-12 22:50:05 UTC
> - #define HTML_DEFAULT_VIEW_SERIF_FONT "Sans" seems awkward ; shouldn't it rather be "Serif" ? 
You are right here, will fix that when i'm at home.

> - #define HTML_DEFAULT_VIEW_FONT "Sans Serif" : am I right to think this is Konqueror's default font ? If so, shouldn't this be "Serif", too ? AFAICT, MSIE and Mozilla display in a serif face by default...
No, the default font has to be an Sans Serif font according to the w3c

> Seems good, as long as the current « grab the dpi from X11 » behaviour is the default. I hate GNOME's habit of ignoring my dpi settings with a vengeance. 
Yes, thatshould be the default.
Comment 43 illogic-al 2005-07-27 16:51:38 UTC
Hasn't this bug been fixed now?
Comment 44 Carsten Wolff 2005-11-30 00:59:47 UTC
Another issue with font-selection arose. Is it possible, that the capability of the font to display the required charset is not checked? Please have a look at this report:
http://bugs.kde.org/show_bug.cgi?id=116324
Comment 45 S. Burmeister 2006-01-16 12:48:55 UTC
Hello! Is bug 105071 a dup of this one? If so, why are konqueror's defaults still Nimbus and not (Sans-)Serif?

Users wonder why they get nice fonts all over KDE when using TT-fonts with bytecode but still ugly websites, which simply is due to konqueror having Nimbus as default and not (Sans-)Serif. Kcontrol defaults to those, so why should konqueror not?
Comment 46 Thiago Macieira 2006-01-19 19:53:44 UTC
*** Bug 105071 has been marked as a duplicate of this bug. ***
Comment 47 Heinrich Wendel 2006-09-18 19:39:54 UTC
I think the bug has been fixed.
105071 looks like a suse specific problem.
Comment 48 Charles A. Landemaine 2006-12-23 02:49:02 UTC
In PC-BSD we use generic font familly (sans-serif, serif, monospace), and we use fontconfig to map generic font familly to a series of common fonts starting from Microsoft fonts to free fonts (ie: DejaVu). We have sofisticated antialiasing rules defined in fontconfig's config file and we don't enable antialiasing in KDE. So everybody's happy: people who don't have Microsoft installed have nice free fonts that are polished and antialiased. People who install Microsoft fonts have a hinted Tahoma everywhere in KDE, and fonts look just like Windows. You can download out configuration files here: http://ubuntuforums.org/showthread.php?t=208396

So, I highly suggest that KDE and any application use generic font family so that they use whatever font the user wants (Microsoft or Free fonts) automatically without him having to change them manually or tweak obscure config files.
Comment 49 Médéric Boquien 2008-11-09 04:15:20 UTC
Hello,

As far as i know this is fixed (or so it looks like) in KDE SVN trunk r881398. If not please reopen.

Thanks.