Bug 3818

Summary: Fallback font doesn't have requested weight in ATSUI-rendered text
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: CLOSED FIXED    
Severity: Normal    
Priority: P2    
Version: 412   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Testcase
none
Proposed fix mjs: review+

Description mitz 2005-07-02 14:03:10 PDT
When the specified font (or the fallback font, in case the former is not available) does not include 
glyphs needed for rendering the text, ATSUI uses a fallback font, which does include the required 
glyphs, instead, but the fallback font chosen is not boldface even if the original font is.

To reproduce:
Open the testcase.

Expected:
The Hebrew letters in the end of each line to be in boldface.

Actual:
On the second and fourth line, the Hebrew letters in the end of the line are not boldface (are the same 
weight as the Hebrew letters in the middle of the same line).

Analysis:
ATSUI's default fallback font search method, which is what WebTextRenderer uses, does not take font 
weight into account.
It seems that using ATSUFontFallbacks would not help either. Perhaps ATSUMatchFontsToText should 
be called and then WKGetFontInLanguageForRange should be used to find the best font for the rest of 
the run.
Comment 1 mitz 2005-07-02 14:03:58 PDT
Created attachment 2758 [details]
Testcase
Comment 2 Joost de Valk (AlthA) 2005-07-03 08:25:42 PDT
wight is probably not what you meant, weight probably is :) if so, this one is confirmed, otherwise please 
mail me ;).
Comment 3 mitz 2005-07-04 11:01:40 PDT
Created attachment 2793 [details]
Proposed fix
Comment 4 Maciej Stachowiak 2005-07-04 20:45:21 PDT
Comment on attachment 2793 [details]
Proposed fix

r=me assuming it passes the existing tests and does the right thing on the new
test.