Bug 17122 - [GTK] Bad font default settings
Summary: [GTK] Bad font default settings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Christian Dywan
URL: http://www.perdu.com
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2008-01-31 12:51 PST by Pierre-Luc Beaudoin
Modified: 2008-11-29 04:15 PST (History)
3 users (show)

See Also:


Attachments
Use default font size 12 instead of 10 (719 bytes, patch)
2008-11-21 18:08 PST, Christian Dywan
no flags Details | Formatted Diff | Diff
Implement "enforce-96-dpi" setting (4.23 KB, patch)
2008-11-24 13:18 PST, Christian Dywan
zecke: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Luc Beaudoin 2008-01-31 12:51:45 PST
Displaying the same pages in WebKit/Gtk+ and Firefox 2.0 doesn't result in the same font size.

The current default size for WebKit is 10, where Firefox has 16.  Setting  PROP_DEFAULT_FONT_SIZE to 12 seems to make the fonts look the same size.

In WebKit, Monospaced and regular fonts have the same size while they differ in Firefox.  The included link has a good simple example of monospace usage.
Comment 1 Alp Toker 2008-02-01 15:16:40 PST
Agreed. Our best hope is to do exactly what fx does when it comes to font matching and sizes since users will be used to their existing settings.

Although the per-screen DPI-based font size adjustment we have in WebSettings is cool, we may have to disable it by default to match fx.

Like you say, the default sizes need looking at. Fonts like "sans" and "monospace" are generally a good choice since FontConfig is meant to do the right thing with them.

WebKit/Mac has special cases for certain fonts. If fx special-cases specific fonts, we should borrow their code and/or matching rules. Time to look at http://mxr.mozilla.org

herzi, and thoughts on this? Is your patch likely to be ready soon?
Comment 2 Christian Dywan 2008-11-21 18:08:28 PST
Created attachment 25368 [details]
Use default font size 12 instead of 10

This is a tiny modification, defining the default font size as 12 instead of 10, so that in the usual case the font comes very close to the default on other platforms.

I ponder hacking up a new setting "force-96-dpi", which would still be disabled by default but instead web browsers and clients displaying web pages would enab le it and also provide an according preference. The reasoning being that this historical quirk is only useful for compatibility and hardly helping usability if the user actually has a considerably high resolved screen.
I'd like some kind of feedback from a reviewer beforehand, though. The lack of interest in API additions isn't exactly motivating lately.
Comment 3 Holger Freyther 2008-11-22 19:08:45 PST
Comment on attachment 25368 [details]
Use default font size 12 instead of 10


> -                                    5, G_MAXINT, 10,
> +                                    5, G_MAXINT, 12,
>                                      flags));

Okay, after the previous discussion it seems that we want that. A 96dpi config option will be much appreciated, we will need it for the regression testing.
Comment 4 Christian Dywan 2008-11-24 13:15:25 PST
2008-11-24  Christian Dywan  <christian@twotoasts.de>

        Reviewed by Holger Freyther.

        http://bugs.webkit.org/show_bug.cgi?id=17122
        [GTK] Bad font default settings

        * webkit/webkitwebsettings.cpp:
        (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
        Use default font size 12 instead of 10
Comment 5 Christian Dywan 2008-11-24 13:18:18 PST
Created attachment 25444 [details]
Implement "enforce-96-dpi" setting

Here comes "enforce-96-dpi", which overrides the DPI detection.
Comment 6 Holger Freyther 2008-11-25 13:59:53 PST
Comment on attachment 25444 [details]
Implement "enforce-96-dpi" setting

The usage of NULL is a bit sad but we already have that at many places.
Comment 7 Christian Dywan 2008-11-29 04:15:13 PST
2008-11-29  Christian Dywan  <christian@twotoasts.de>

        Reviewed by Holger Freyther.

        http://bugs.webkit.org/show_bug.cgi?id=17122
        [GTK] Bad font default settings

        Implement a property "enforce-96-dpi" in WebKitWebSettings
        that can be enabled to force the view to assume 96 DPI.

        * webkit/webkitwebsettings.cpp:
        (_WebKitWebSettingsPrivate::):
        (_WebKitWebSettingsPrivate::webkit_web_settings_class_init):
        (_WebKitWebSettingsPrivate::webkit_web_settings_set_property):
        (_WebKitWebSettingsPrivate::webkit_web_settings_get_property):
        * webkit/webkitwebview.cpp: