Commit da175bc2 authored by thatcher's avatar thatcher
Browse files

Rolling out the following change because this crash:

        <rdar://problem/4806705> REGRESSION: Crash occurs at WebCore::Font::lineSpacing() when loading site (http://www.photoplusexpo.com/ppe/index.jsp) 

        And this regression:
        <rdar://problem/4728514> REGRESSION: Safari applies the wrong font to BODY element at http://www.apple.com/downloads/dashboard/

    2006-09-06  David Harrison  <harrison@apple.com>

        Reviewed and tweaked by Tim H. 

        <rdar://problem/4564955> WebKit doesn't trigger Auto Font Activation 

        If we don't find the font in the available fonts list, call [NSFont fontWithName:size:] 
        to trigger a search that will include auto activation. No PLT or iBench perf impact. 
        No layout tests affected. Not testable in an automated way that will work on all systems. 

        * platform/mac/WebFontCache.mm: 
        (+[WebFontCache fontWithFamily:traits:size:]): 



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bd9a0c35
2006-10-30 Timothy Hatcher <timothy@apple.com>
Rolling out the following change because this crash:
<rdar://problem/4806705> REGRESSION: Crash occurs at WebCore::Font::lineSpacing() when loading site (http://www.photoplusexpo.com/ppe/index.jsp)
And this regression:
<rdar://problem/4728514> REGRESSION: Safari applies the wrong font to BODY element at http://www.apple.com/downloads/dashboard/
2006-09-06 David Harrison <harrison@apple.com>
Reviewed and tweaked by Tim H.
<rdar://problem/4564955> WebKit doesn't trigger Auto Font Activation
If we don't find the font in the available fonts list, call [NSFont fontWithName:size:]
to trigger a search that will include auto activation. No PLT or iBench perf impact.
No layout tests affected. Not testable in an automated way that will work on all systems.
* platform/mac/WebFontCache.mm:
(+[WebFontCache fontWithFamily:traits:size:]):
2006-10-30 Justin Garcia <justin.garcia@apple.com>
 
Reviewed by harrison
......@@ -113,32 +113,30 @@ static BOOL betterChoice(NSFontTraitMask desiredTraits, int desiredWeight,
+ (NSFont *)fontWithFamily:(NSString *)desiredFamily traits:(NSFontTraitMask)desiredTraits size:(float)size
{
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSFont *font= nil;
// Look for an exact match first.
NSEnumerator *availableFonts = [[fontManager availableFonts] objectEnumerator];
NSFont *font = nil;
NSString *availableFont;
while ((availableFont = [availableFonts nextObject])) {
if ([desiredFamily caseInsensitiveCompare:availableFont] == NSOrderedSame) {
font = [NSFont fontWithName:availableFont size:size];
NSFont *nameMatchedFont = [NSFont fontWithName:availableFont size:size];
// Special case Osaka-Mono. According to <rdar://problem/3999467>, we need to
// treat Osaka-Mono as fixed pitch.
if ([desiredFamily caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame && desiredTraits == 0)
return nameMatchedFont;
NSFontTraitMask traits = [fontManager traitsOfFont:nameMatchedFont];
if ((traits & desiredTraits) == desiredTraits){
font = [fontManager convertFont:nameMatchedFont toHaveTrait:desiredTraits];
return font;
}
break;
}
}
// font was not immediately available, try auto activated fonts <rdar://problem/4564955>
if (!font)
font = [NSFont fontWithName:desiredFamily size:size];
if (font) {
// Special case Osaka-Mono. According to <rdar://problem/3999467>, we need to
// treat Osaka-Mono as fixed pitch.
if ([desiredFamily caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame && desiredTraits == 0)
return font;
NSFontTraitMask traits = [fontManager traitsOfFont:font];
if ((traits & desiredTraits) == desiredTraits)
return [fontManager convertFont:font toHaveTrait:desiredTraits];
}
// Do a simple case insensitive search for a matching font family.
// NSFontManager requires exact name matches.
// This addresses the problem of matching arial to Arial, etc., but perhaps not all the issues.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment