Bug 67598 - [Gtk] Some sites fall back to monospace fonts, when they should be using variable width
Summary: [Gtk] Some sites fall back to monospace fonts, when they should be using vari...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 420+
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-05 05:25 PDT by torben.hinrichsen
Modified: 2011-12-29 06:44 PST (History)
1 user (show)

See Also:


Attachments
Delicious.com with epiphany (47.40 KB, image/png)
2011-09-05 05:27 PDT, torben.hinrichsen
no flags Details
Yahoo.com with epiphany (207.23 KB, image/png)
2011-09-05 05:27 PDT, torben.hinrichsen
no flags Details
TTF Font List (2.31 KB, text/plain)
2011-09-14 11:25 PDT, torben.hinrichsen
no flags Details
Output of fc-match (45.55 KB, text/plain)
2011-10-01 01:40 PDT, torben.hinrichsen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description torben.hinrichsen 2011-09-05 05:25:44 PDT
Hi,

on some websites, like delicious.com and yahoo.com, i have not the system font but a monospace like font. This happens with Midori and Epiphany. If i browse the same sites with Firefox, there are no problems with the font. All Browsers are configured to use the system fonts.
Comment 1 torben.hinrichsen 2011-09-05 05:27:01 PDT
Created attachment 106323 [details]
Delicious.com with epiphany
Comment 2 torben.hinrichsen 2011-09-05 05:27:54 PDT
Created attachment 106324 [details]
Yahoo.com with epiphany
Comment 3 Martin Robinson 2011-09-11 18:19:42 PDT
Do you think you can paste what font the site is asking for in CSS (you can see in the web inspector) as well as the list of fonts you have installed?
Comment 4 Martin Robinson 2011-09-11 18:20:24 PDT
It would also be useful to know your version of WebKitGTK+. Thanks for reporting!
Comment 5 torben.hinrichsen 2011-09-14 11:25:42 PDT
Created attachment 107360 [details]
TTF Font List
Comment 6 torben.hinrichsen 2011-09-14 11:26:26 PDT
Requested Fonts on delicious.com: arial,helvetica,clean,sans-serif
Requested Fonts on yahoo.com: arial,helvetica,clean,sans-serif
(Maybe i used the inspector in the wrong way or they have really both the same fonts in this order)
Installed TTF Fonts -> see attached file. 
My configuration for using system fonts:
Sans serif font: DejaVu Sans Book Size: 14
Serif font: DejaVu Sans Book Size: 10
Monospace font: DejaVu Sans Mono Book Size: 10

This is nearly the same configuration as i use in Firefox.


Webkitgtk+ Version: 1.4.2-1
Comment 7 Martin Robinson 2011-09-30 07:20:42 PDT
(In reply to comment #6)
> Requested Fonts on delicious.com: arial,helvetica,clean,sans-serif
> Requested Fonts on yahoo.com: arial,helvetica,clean,sans-serif
> (Maybe i used the inspector in the wrong way or they have really both the same fonts in this order)
> Installed TTF Fonts -> see attached file. 
> My configuration for using system fonts:
> Sans serif font: DejaVu Sans Book Size: 14
> Serif font: DejaVu Sans Book Size: 10
> Monospace font: DejaVu Sans Mono Book Size: 10
> 
> This is nearly the same configuration as i use in Firefox.
> 
> 
> Webkitgtk+ Version: 1.4.2-1

Sorry for the late response. I have a theory about what's happening here. I think that you are falling back all the way to sans-serif and the first sans-serif font that Fontconfig is giving us is monospace. Instead we should iterate through the list of fallback fonts until we find one that matches our request or add some other Fontconfig to the request pattern.

I just need a few pieces of information to confirm this theory. Can you please paste the output of the following command?

fc-match Arial
fc-match Helvetica
fc-match Clean
fc-match -a sans-serif
Comment 8 torben.hinrichsen 2011-10-01 01:40:20 PDT
Created attachment 109403 [details]
Output of fc-match
Comment 9 torben.hinrichsen 2011-10-01 01:42:01 PDT
No problem for the late response. You try to help and that is what counts. :-)
See attachment Output to fc-match.
Comment 10 Martin Robinson 2011-10-01 11:02:43 PDT
Unfortunately this doesn't look like a bug. What's happening here is that you have a font installed on your system named "Clean" and the page specifies one called "Clean" as well. Fontconfig is returning that font when WebKitGTK+ asks for a font named "Clean." Obviously the Clean that the page authors want is not the same as the Clean you have installed on your system. :)

The odd thing is that even though I have that font installed on my system as well, Fontconfig never returns it, even when I explicitly ask for "Clean":

$ fc-match Clean
DejaVuSans.ttf: "DejaVu Sans" "Book"

Something about your Fontconfig settings in /etc/fonts/ is different from mine such that Fontconfig on your system does return Clean:

fc-match Clean -> clR6x12-ISO8859-1.pcf.gz: "Clean" "Regular"

I'm quite curious what distribution you are running and if you've ever fiddled with the system font settings. You have a couple options.

1. Install the Microsoft Core fonts. Microsoft has released free versions of their proprietary fonts. This would mean that when we ask Fontconfig for "Arial" we just use Arial.

2. Figure out why Fontconfig is returning Clean and flip whatever switch is necessary in Fontconfig to disable that.

3. Hard replace Arial with the Liberation variants (which you have installed). They try to be metric compatible. You can do this by inserting something like this in your Fontconfig settings:

<match target="pattern" name="family" >
    <test name="family" qual="any" >
        <string>Arial</string>
    </test>
    <edit name="family" mode="assign">
        <string>Liberation Sans</string>
    </edit>
</match>

For more information see this page: https://wiki.archlinux.org/index.php/Font_Configuration#Replace_fonts

Hope that helps!
Comment 11 torben.hinrichsen 2011-12-29 06:44:33 PST
I couldn't find out why Clean is correct font. 
clR6x12-ISO8859-1.pcf.gz is a font in /usr/share/fonts/misc and is related to the package xorg-fonts-misc

I made the Hard replace now and this works.

Thanks for your help.