| Index: Source/platform/fonts/mac/FontCacheMac.mm
|
| diff --git a/Source/platform/fonts/mac/FontCacheMac.mm b/Source/platform/fonts/mac/FontCacheMac.mm
|
| index 0b54574eb1041d324b4bb2c221a4fb37e30a6be1..31da55793c4b54620e504d280bf63fa90126677f 100644
|
| --- a/Source/platform/fonts/mac/FontCacheMac.mm
|
| +++ b/Source/platform/fonts/mac/FontCacheMac.mm
|
| @@ -119,7 +119,7 @@ PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
|
| }
|
|
|
| const FontPlatformData& platformData = fontDataToSubstitute->platformData();
|
| - NSFont *nsFont = platformData.font();
|
| + NSFont* nsFont = toNSFont(platformData.ctFont());
|
|
|
| NSString *string = [[NSString alloc] initWithCharactersNoCopy:codeUnits length:codeUnitsLength freeWhenDone:NO];
|
| NSFont *substituteFont = [NSFont findFontLike:nsFont forString:string withRange:NSMakeRange(0, codeUnitsLength) inLanguage:nil];
|
| @@ -220,11 +220,14 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
|
| bool syntheticBold = (isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight)) || fontDescription.isSyntheticBold();
|
| bool syntheticItalic = ((traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait)) || fontDescription.isSyntheticItalic();
|
|
|
| - // FontPlatformData::font() can be null for the case of Chromium out-of-process font loading.
|
| - // In that case, we don't want to use the platformData.
|
| + // FontPlatformData::typeface() is null in the case of Chromium out-of-process font loading failing.
|
| + // Out-of-process loading occurs for registered fonts stored in non-system locations.
|
| + // When loading fails, we do not want to use the returned FontPlatformData since it will not have
|
| + // a valid SkTypeface.
|
| OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, syntheticBold, syntheticItalic, fontDescription.orientation()));
|
| - if (!platformData->font())
|
| - return 0;
|
| + if (!platformData->typeface()) {
|
| + return nullptr;
|
| + }
|
| return platformData.leakPtr();
|
| }
|
|
|
|
|