Changeset 30066 in webkit


Ignore:
Timestamp:
Feb 7, 2008 8:59:08 AM (16 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Darin Adler.

Test: platform/mac/fast/text/family-for-font-matched-by-name.html

  • platform/mac/WebFontCache.mm: (+[WebFontCache internalFontWithFamily:traits:size:]): Changed to use the family of the font whose name matches the desired family if there is no exact family match.

LayoutTests:

Reviewed by Darin Adler.

  • platform/mac/fast/text/family-for-font-matched-by-name-expected.checksum: Added.
  • platform/mac/fast/text/family-for-font-matched-by-name-expected.png: Added.
  • platform/mac/fast/text/family-for-font-matched-by-name-expected.txt: Added.
  • platform/mac/fast/text/family-for-font-matched-by-name.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r30065 r30066  
     12008-02-07  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=17194
     6          Changing text to bold changes font family
     7
     8        * platform/mac/fast/text/family-for-font-matched-by-name-expected.checksum: Added.
     9        * platform/mac/fast/text/family-for-font-matched-by-name-expected.png: Added.
     10        * platform/mac/fast/text/family-for-font-matched-by-name-expected.txt: Added.
     11        * platform/mac/fast/text/family-for-font-matched-by-name.html: Added.
     12
    1132008-02-07  Beth Dakin  <bdakin@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r30065 r30066  
     12008-02-07  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=17194
     6          Changing text to bold changes font family
     7
     8        Test: platform/mac/fast/text/family-for-font-matched-by-name.html
     9
     10        * platform/mac/WebFontCache.mm:
     11        (+[WebFontCache internalFontWithFamily:traits:size:]): Changed to use
     12        the family of the font whose name matches the desired family if there
     13        is no exact family match.
     14
    1152008-02-07  Beth Dakin  <bdakin@apple.com>
    216
  • trunk/WebCore/platform/mac/WebFontCache.mm

    r29663 r30066  
    118118    NSEnumerator *availableFonts = [[fontManager availableFonts] objectEnumerator];
    119119    NSString *availableFont;
     120    NSFont *nameMatchedFont = nil;
    120121    while ((availableFont = [availableFonts nextObject])) {
    121122        if ([desiredFamily caseInsensitiveCompare:availableFont] == NSOrderedSame) {
    122             NSFont *nameMatchedFont = [NSFont fontWithName:availableFont size:size];
     123            nameMatchedFont = [NSFont fontWithName:availableFont size:size];
    123124
    124125            // Special case Osaka-Mono.  According to <rdar://problem/3999467>, we need to
     
    144145    }
    145146
     147    if (!availableFamily)
     148        availableFamily = [nameMatchedFont familyName];
     149
    146150    // Found a family, now figure out what weight and traits to use.
    147151    BOOL choseFont = false;
Note: See TracChangeset for help on using the changeset viewer.