Bug 16348 - @font-face does not affect the default style
Summary: @font-face does not affect the default style
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-07 16:16 PST by mitz
Modified: 2009-03-12 15:07 PDT (History)
1 user (show)

See Also:


Attachments
Test case (287 bytes, text/html)
2007-12-07 16:19 PST, mitz
no flags Details
Use the current font selector for the document style (24.85 KB, patch)
2007-12-07 17:45 PST, mitz
sam: review+
Details | Formatted Diff | Diff
Times -> times new roman (970 bytes, patch)
2009-01-16 04:20 PST, Dean McNamee
no flags Details | Formatted Diff | Diff
Times and times new roman (1014 bytes, patch)
2009-01-16 04:25 PST, Dean McNamee
no flags Details | Formatted Diff | Diff
Capitalize and quote "Times New Roman" (1.18 KB, patch)
2009-03-10 17:13 PDT, Aaron Boodman
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2007-12-07 16:16:51 PST
"Unstyled" text is unaffected by @font-face rules. See the attached test case.
Comment 1 mitz 2007-12-07 16:19:36 PST
Created attachment 17784 [details]
Test case
Comment 2 mitz 2007-12-07 17:45:00 PST
Created attachment 17786 [details]
Use the current font selector for the document style
Comment 3 mitz 2007-12-07 17:49:50 PST
Fixed in <http://trac.webkit.org/projects/webkit/changeset/28555>.
Comment 4 Dean McNamee 2009-01-16 03:46:01 PST
I just tried Windows Safari with WebKit r39939, and it looks to me the font is displayed in Times.

I am trying to figure out if there is a regression in Chromium (specifically Linux), but I'm not sure what behavior to expect or if there are other factors.  The mac expected pixel image is clearly in Arial.  I know we don't really support font-face on Chromium Linux right now, but I'm just trying to figure out what behavior we should be matching.

Additionally, in Chromium Windows, where we do support font-face and dynamic fonts, it is also still rendered as Times.

Thanks
Comment 5 Dean McNamee 2009-01-16 03:53:34 PST
On further inspection, it seems the difference is font-family: Times; vs font-family; times new roman;  If I change the CSS to use a font-family: times new roman;, then both Windows Safari nightly webkit, Chromium Windows, and Chromium Linux render the text in Arial.

Should I update the test?
Comment 6 Dean McNamee 2009-01-16 04:20:45 PST
Created attachment 26788 [details]
Times -> times new roman

I'm not sure if this is right on the Mac, and I don't have one to test.  If there really is the difference between 'Times' and 'times new roman' being the default fonts between Mac and Windows, then I guess the best solution would be to have two @font-face in the CSS, for both 'Times' and 'times new roman'.

Sorry if I should have created a new bug for this, just seemed like a bunch of overhead.
Comment 7 Dean McNamee 2009-01-16 04:25:02 PST
Created attachment 26789 [details]
Times and times new roman

Just for convenience, I've uploaded the patched for the second approach of having font-face for both possibilities.  If one of the two approaches sounds alright, feel free to commit it for me.  Thanks.
Comment 8 mitz 2009-01-16 07:27:42 PST
(In reply to comment #5)
> On further inspection, it seems the difference is font-family: Times; vs
> font-family; times new roman;  If I change the CSS to use a font-family: times
> new roman;, then both Windows Safari nightly webkit, Chromium Windows, and
> Chromium Linux render the text in Arial.
> 
> Should I update the test?

The tests run in an environment where the standard font is Times both on Mac and on Windows.
Comment 9 Dean McNamee 2009-01-16 10:23:07 PST

(In reply to comment #8)
> (In reply to comment #5)
> > On further inspection, it seems the difference is font-family: Times; vs
> > font-family; times new roman;  If I change the CSS to use a font-family: times
> > new roman;, then both Windows Safari nightly webkit, Chromium Windows, and
> > Chromium Linux render the text in Arial.
> > 
> > Should I update the test?
> 
> The tests run in an environment where the standard font is Times both on Mac
> and on Windows.
> 

But they don't pass when you run them standalone in the browser.  Is there any disadvantage to changing that?  In our test environment, our default font is 'times new roman', which matches our final product.  I don't see any harm in making the patch work in both cases.
Comment 10 Darin Adler 2009-01-24 13:26:47 PST
Comment on attachment 26788 [details]
Times -> times new roman

Why all lowercase like this? Why no quote marks around the multi-word family name?
Comment 11 Aaron Boodman 2009-03-10 17:13:35 PDT
Created attachment 28455 [details]
Capitalize and quote "Times New Roman"
Comment 12 Dave Hyatt 2009-03-11 11:56:39 PDT
Comment on attachment 28455 [details]
Capitalize and quote "Times New Roman"

r=me
Comment 13 David Levin 2009-03-12 14:26:49 PDT
Assigned to levin for landing.
Comment 14 David Levin 2009-03-12 15:07:35 PDT
Committed r41653.