Bug 21811 - REGRESSION: Windows Build Not Selecting Proper Font
Summary: REGRESSION: Windows Build Not Selecting Proper Font
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC OS X 10.5
: P1 Normal
Assignee: mitz
URL:
Keywords: HasReduction, PlatformOnly, Regression
Depends on:
Blocks:
 
Reported: 2008-10-22 15:32 PDT by Brent Fulgham
Modified: 2009-03-02 13:57 PST (History)
1 user (show)

See Also:


Attachments
Simple test showing the problem (1.48 KB, text/html)
2008-10-22 15:32 PDT, Brent Fulgham
no flags Details
Add back the code to verify the face name (1.66 KB, patch)
2009-03-02 13:43 PST, mitz
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2008-10-22 15:32:08 PDT
The attached HTML file illustrates a regression in WebKit (Windows) that affects both Cairo and CG builds.

There are two code sections in the HTML page that should render using Courier (or a suitable fixed-width alternate, such as "Courier New").  Instead, Arial is selected, resulting in an incorrect rendering.
Comment 1 Brent Fulgham 2008-10-22 15:32:54 PDT
Created attachment 24575 [details]
Simple test showing the problem
Comment 3 Dave Hyatt 2008-10-22 15:58:50 PDT
The old code I wrote had this:

346	 	    HFONT hfont = CreateFontIndirect(&winfont); 
347	 	    // Windows will always give us a valid pointer here, even if the face name is non-existent.  We have to double-check 
348	 	    // and see if the family name was really used. 
349	 	    HDC dc = GetDC(0); 
350	 	    SaveDC(dc); 
351	 	    SelectObject(dc, hfont); 
352	 	    WCHAR name[LF_FACESIZE]; 
353	 	    GetTextFace(dc, LF_FACESIZE, name); 
354	 	    RestoreDC(dc, -1); 
355	 	    ReleaseDC(0, dc); 
356	 	 

That's missing now I think.
Comment 4 mitz 2009-03-02 13:43:48 PST
Created attachment 28195 [details]
Add back the code to verify the face name
Comment 5 Adam Roben (:aroben) 2009-03-02 13:49:31 PST
Comment on attachment 28195 [details]
Add back the code to verify the face name

r=me
Comment 6 mitz 2009-03-02 13:57:43 PST
Fixed in <http://trac.webkit.org/projects/webkit/changeset/41366>.