Bug 18323 - Improve font-weight: lighter and bolder
: Improve font-weight: lighter and bolder
Status: NEW
Product: WebKit
Classification: Unclassified
Component: Text
: 528+ (Nightly build)
: Macintosh Mac OS X 10.5
: P2 Normal
Assigned To: Nobody
: InRadar
Depends on:
  Show dependency treegraph
Reported: 2008-04-05 11:00 PDT by mitz@webkit.org
Modified: 2013-06-26 22:06 PDT (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description mitz@webkit.org 2008-04-05 11:00:58 PDT
Make font-weight: lighter (bolder) always select the next lighter (heavier) member of the selected family, if available, rather than just increment the font-weight value. Per CSS2.1:
"The computed value of "font-weight" is either:
- one of the legal number values, or
- one of the legal number values combined with one or more of the relative values (bolder or lighter). This type of computed values is necessary to use when the font in question does not have all weight variations that are needed."
Comment 1 Nicholas Shanks 2008-08-27 09:31:15 PDT
for an example, see attachment #12838 [details] & attachment #12839 [details] (Helvetica Neue "lighter x 2" should be same weight as FontWeight100)
Comment 2 mitz@webkit.org 2009-05-21 01:04:55 PDT
*** Bug 25914 has been marked as a duplicate of this bug. ***
Comment 3 mitz@webkit.org 2009-05-21 01:17:59 PDT
Comment 4 mitz@webkit.org 2010-01-13 10:12:40 PST
*** Bug 33559 has been marked as a duplicate of this bug. ***
Comment 5 Joe Lencioni 2013-05-18 10:32:26 PDT
According to the spec, `bolder` and `lighter` snap to the weights of 100, 400, 700, and 900. The rules for this behavior is indicated by the chart at http://www.w3.org/TR/css3-fonts/#bolderlighter
Comment 6 Joe Lencioni 2013-06-26 22:06:15 PDT
This was recently addressed in the Chromium project. Perhaps a similar solution exists in WebKit land? https://chromiumcodereview.appspot.com/15994009