Bug 18863 - weight mappings with @font-face aren't consistent
Summary: weight mappings with @font-face aren't consistent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.4
: P3 Normal
Assignee: mitz
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-05-02 22:40 PDT by John Daggett
Modified: 2008-06-25 09:37 PDT (History)
2 users (show)

See Also:


Attachments
testcase, comparison of weight matching with and without @font-face (5.56 KB, text/html)
2008-05-02 22:50 PDT, John Daggett
no flags Details
screenshot of testcase on 10.4 (79.72 KB, image/png)
2008-05-02 23:09 PDT, John Daggett
no flags Details

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