Changeset 31850 in webkit


Ignore:
Timestamp:
Apr 13, 2008, 8:56:35 AM (17 years ago)
Author:
mitz@apple.com
Message:

Reviewed by Darin Adler.

Test: fast/css/font-weight-1.html

  • platform/graphics/mac/FontCacheMac.mm: (WebCore::toAppKitFontWeight): Adjusted the mapping to cover the AppKit weight range from 2 to 12, because AppKit weight 1 never occurs. The new mapping matches font-weight: n00 to ISO weight Wn.
  • platform/mac/WebFontCache.mm: (betterChoice): Changed the midpoint used when deciding between two candidates that deviate from the desired weight by the same amount.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31849 r31850  
     12008-04-13  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=18307
     6          <rdar://problem/5842546> REGRESSION (r31620): Incorrect Hiragino Kaku Gothic, font-weight:500
     7
     8        Test: fast/css/font-weight-1.html
     9
     10        * platform/graphics/mac/FontCacheMac.mm:
     11        (WebCore::toAppKitFontWeight): Adjusted the mapping to cover the AppKit
     12        weight range from 2 to 12, because AppKit weight 1 never occurs. The
     13        new mapping matches font-weight: n00 to ISO weight Wn.
     14        * platform/mac/WebFontCache.mm:
     15        (betterChoice): Changed the midpoint used when deciding between two
     16        candidates that deviate from the desired weight by the same amount.
     17
    1182008-04-12  David Hyatt  <hyatt@apple.com>
    219
  • trunk/WebCore/platform/graphics/mac/FontCacheMac.mm

    r31620 r31850  
    126126{
    127127    static int appKitFontWeights[] = {
    128         1,  // FontWeight100
    129         2,  // FontWeight200
    130         3,  // FontWeight300
     128        2,  // FontWeight100
     129        3,  // FontWeight200
     130        4,  // FontWeight300
    131131        5,  // FontWeight400
    132132        6,  // FontWeight500
    133         7,  // FontWeight600
     133        8,  // FontWeight600
    134134        9,  // FontWeight700
    135135        10, // FontWeight800
  • trunk/WebCore/platform/mac/WebFontCache.mm

    r31689 r31850  
    9191    int candidateWeightDeltaMagnitude = abs(candidateWeight - desiredWeight);
    9292
    93     // If both are the same distance from the desired weight, prefer the candidate if it is further from regular.
     93    // If both are the same distance from the desired weight, prefer the candidate if it is further from medium.
    9494    if (chosenWeightDeltaMagnitude == candidateWeightDeltaMagnitude)
    95         return abs(candidateWeight - 5) > abs(chosenWeight - 5);
     95        return abs(candidateWeight - 6) > abs(chosenWeight - 6);
    9696
    9797    // Otherwise, prefer the one closer to the desired weight.
Note: See TracChangeset for help on using the changeset viewer.