UNCONFIRMED 57951
WebKit should use the last font in family list for system fallback instead of the first
https://bugs.webkit.org/show_bug.cgi?id=57951
Summary WebKit should use the last font in family list for system fallback instead of...
Jiang Jiang
Reported 2011-04-06 08:04:50 PDT
For a list in CSS like the following: font-family: Times, sans-serif; And the user-agent sets 'Helvetica' as the default font for 'sans-serif'. When the glyph for a certain character cannot be found in 'Times', neither could it be found in 'Helvetica', then WebKit will always use 'Times' (the primaryFont) to look for the system fallback font (in FontCache::getFontDataForCharacters). Wouldn't it make more sense to use the last one (Helvetica in this case) for system fallback? They can result in different fonts. In the attached example, using Times will results the fallback font be STSong, while using 'Helvetica' will get 'STHeiti'. A (serious) side effect of this problem is that you can't combine a serif font (say, Times) and the system provided sans-serif font (though you don't know the exact name, in some system it maybe STHeiti, in others it may be Droid Sans Fallback) unless you know exactly what the sans-serif font is.
Attachments
test case (249 bytes, text/html)
2011-04-06 08:05 PDT, Jiang Jiang
no flags
Patch for Mac (2.87 KB, patch)
2011-04-06 08:06 PDT, Jiang Jiang
no flags
test case (262 bytes, text/html)
2011-04-06 08:55 PDT, Jiang Jiang
no flags
Jiang Jiang
Comment 1 2011-04-06 08:05:16 PDT
Created attachment 88421 [details] test case
Jiang Jiang
Comment 2 2011-04-06 08:06:25 PDT
Created attachment 88422 [details] Patch for Mac
Jiang Jiang
Comment 3 2011-04-06 08:54:06 PDT
Firefox follows the behavior I described, when a lang attribute is provided.
Jiang Jiang
Comment 4 2011-04-06 08:55:24 PDT
Created attachment 88435 [details] test case
Note You need to log in before you can comment on or make changes to this bug.