Bug 18307

Summary: REGRESSION (r31620): Incorrect Hiragino Kaku Gothic, font-weight:500
Product: WebKit Reporter: Philippe Wittenbergh <phiw2>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: VERIFIED FIXED    
Severity: Normal CC: mitz, nickshanks
Priority: P2 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
test case
none
testcase, hiragino with different weights
none
Patch darin: review+

Philippe Wittenbergh
Reported 2008-04-03 22:59:56 PDT
Hiragino Kaku Gothic, with font-weight 500 is displayed as bold; I expect it to display is as 'normal', same as font-weight: 400 - that is: use W3 instead of W6. Testing with r31623 (after bug 6484 landed). (Gecko 1.9 had the same problem not so long ago, but that has been fixed, at least as of gecko 1.9beta5).
Attachments
test case (1.44 KB, text/html)
2008-04-03 23:01 PDT, Philippe Wittenbergh
no flags
testcase, hiragino with different weights (4.62 KB, text/html)
2008-04-04 01:58 PDT, John Daggett
no flags
Patch (2.76 KB, patch)
2008-04-08 17:12 PDT, mitz
darin: review+
Philippe Wittenbergh
Comment 1 2008-04-03 23:01:20 PDT
Created attachment 20326 [details] test case Hiragino Kaku Gothic Pro, various font-weights
mitz
Comment 2 2008-04-03 23:30:03 PDT
mitz
Comment 3 2008-04-04 00:03:53 PDT
Indeed, CSS2.1 suggests using the '400' weight for '500' if a '500' weight is unmapped. (Hiragino Kaku Gothic Pro has two weights: W3, which AppKit maps to 4, which is between '300' and '400'; and W6, which AppKit maps to 8, which is between '600' and '700'. Since the desired weight of '500' corrresponds to 6, the two candidates are equidistant from the desired weight, and the current heuristic is to go for the stronger effect, i.e. further away from '400').
mitz
Comment 4 2008-04-04 00:11:45 PDT
As a first approximation, moving the "midpoint" from 5 to 6 here will better match the spec: if (chosenWeightDeltaMagnitude == candidateWeightDeltaMagnitude) return abs(candidateWeight - 5) > abs(chosenWeight - 5);
John Daggett
Comment 5 2008-04-04 01:58:35 PDT
Created attachment 20329 [details] testcase, hiragino with different weights This might be useful. You can edit the Javascript to add/delete fonts. The Hiragino fonts have some funky name table entries so you may run into problems when the name is only in Japanese (e.g. ƒqƒ‰ƒMƒmŠÛƒS Pro).
mitz
Comment 6 2008-04-08 17:12:08 PDT
Darin Adler
Comment 7 2008-04-12 23:22:11 PDT
Comment on attachment 20416 [details] Patch r=me
mitz
Comment 8 2008-04-13 08:59:29 PDT
Philippe Wittenbergh
Comment 9 2008-04-14 19:58:30 PDT
works fine, thanks
Note You need to log in before you can comment on or make changes to this bug.