Bug 3818 - Fallback font doesn't have requested weight in ATSUI-rendered text
Summary: Fallback font doesn't have requested weight in ATSUI-rendered text
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-02 14:03 PDT by mitz
Modified: 2005-11-04 00:32 PST (History)
0 users

See Also:


Attachments
Testcase (1.44 KB, text/html)
2005-07-02 14:03 PDT, mitz
no flags Details
Proposed fix (1.79 KB, patch)
2005-07-04 11:01 PDT, mitz
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.