Summary: | REGRESSION (r31620): Incorrect Hiragino Kaku Gothic, font-weight:500 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Philippe Wittenbergh <phiw2> | ||||||||
Component: | Text | Assignee: | 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
Philippe Wittenbergh
2008-04-03 22:59:56 PDT
Created attachment 20326 [details]
test case
Hiragino Kaku Gothic Pro, various font-weights
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'). 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); 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).
Created attachment 20416 [details]
Patch
Comment on attachment 20416 [details]
Patch
r=me
works fine, thanks |