Bug 18863

Summary: weight mappings with @font-face aren't consistent
Product: WebKit Reporter: John Daggett <jdaggett>
Component: CSSAssignee: mitz
Status: RESOLVED FIXED    
Severity: Normal CC: mitz, phiw2
Priority: P3 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase, comparison of weight matching with and without @font-face
none
screenshot of testcase on 10.4 none

Description John Daggett 2008-05-02 22:40:11 PDT
When using explicit values for font weights, faces defined via @font-face rules are interpreted differently from families defined via normal font-family usage.
Comment 1 John Daggett 2008-05-02 22:50:48 PDT
Created attachment 20942 [details]
testcase, comparison of weight matching with and without @font-face

When the attached testcase is viewed in Webkit, several of the weight mappings are incorrect:

1. Arial 800 should appear using Arial-Black

2. In the section labeled "Using font-family: Helvetica Neue",
Helvetica Neue 200 should appear as HelveticaNeue-UltraLight
(beware: 10.4 has correct weight definitions for this font but under 10.5 Cocoa assigns incorrect font weights to HelveticaNeue-UltraLight)

3. In the section labeled "Using @font-face definitions"
Helvetica Neue 600 should appear as HelveticaNeue-Bold
Helvetica Neue 800 should appear as HelveticaNeue-CondensedBlack

The relevant weight mapping rules are detailed here:
http://www.w3.org/TR/CSS21/fonts.html#font-boldness

"If there are fewer then 9 weights in the family, the default algorithm for filling the "holes" is as follows. If '500' is unassigned, it will be assigned the same font as '400'. If any of the values '600', '700', '800' or '900' remains unassigned, they are assigned to the same face as the next darker assigned keyword, if any, or the next lighter one otherwise. If any of '300', '200' or '100' remains unassigned, it is assigned to the next lighter assigned keyword, if any, or the next darker otherwise."
Comment 2 John Daggett 2008-05-02 23:09:00 PDT
Created attachment 20943 [details]
screenshot of testcase on 10.4
Comment 3 mitz 2008-05-02 23:26:55 PDT
<rdar://problem/5908890>
Comment 4 mitz 2008-06-25 09:37:47 PDT
Fixed in <http://trac.webkit.org/changeset/34794>.