Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: Source/core/platform/graphics/mac/SimpleFontDataMac.mm

Issue 15091005: Remove support for Mac OS X Leopard (10.5) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove support for Mac OS X Laopard (10.5) Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/mac/SimpleFontDataMac.mm
diff --git a/Source/core/platform/graphics/mac/SimpleFontDataMac.mm b/Source/core/platform/graphics/mac/SimpleFontDataMac.mm
index aea9c2bcba8818b2fdec811dd236771549ba8f2f..cf920c4d743536d16483da1b7f29e623f1570241 100644
--- a/Source/core/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/Source/core/platform/graphics/mac/SimpleFontDataMac.mm
@@ -107,34 +107,6 @@ static NSString *webFallbackFontFamily(void)
return webFallbackFontFamily.get();
}
-#if !ERROR_DISABLED
-#if defined(__LP64__) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 || (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060)
-static NSString* pathFromFont(NSFont*)
-{
- // FMGetATSFontRefFromFont is not available. As pathFromFont is only used for debugging purposes,
- // returning nil is acceptable.
- return nil;
-}
-#else
-static NSString* pathFromFont(NSFont *font)
-{
- ATSFontRef atsFont = FMGetATSFontRefFromFont(CTFontGetPlatformFont(toCTFontRef(font), 0));
- FSRef fileRef;
-
- OSStatus status = ATSFontGetFileReference(atsFont, &fileRef);
- if (status != noErr)
- return nil;
-
- UInt8 filePathBuffer[PATH_MAX];
- status = FSRefMakePath(&fileRef, filePathBuffer, PATH_MAX);
- if (status == noErr)
- return [NSString stringWithUTF8String:(const char*)filePathBuffer];
-
- return nil;
-}
-#endif // __LP64__
-#endif // !ERROR_DISABLED
-
const SimpleFontData* SimpleFontData::getCompositeFontReferenceFontData(NSFont *key) const
{
if (key && !CFEqual(RetainPtr<CFStringRef>(AdoptCF, CTFontCopyPostScriptName(CTFontRef(key))).get(), CFSTR("LastResort"))) {
@@ -194,11 +166,7 @@ void SimpleFontData::platformInit()
m_platformData.setFont([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toFamily:fallbackFontFamily]);
else
m_platformData.setFont([NSFont fontWithName:fallbackFontFamily size:m_platformData.size()]);
-#if !ERROR_DISABLED
- NSString *filePath = pathFromFont(initialFont.get());
- if (!filePath)
- filePath = @"not known";
-#endif
+
if (!initFontData(this)) {
if ([fallbackFontFamily isEqual:@"Times New Roman"]) {
// OK, couldn't setup Times New Roman as an alternate to Times, fallback
@@ -206,19 +174,19 @@ void SimpleFontData::platformInit()
m_platformData.setFont([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toFamily:webFallbackFontFamily()]);
if (!initFontData(this)) {
// We tried, Times, Times New Roman, and the system font. No joy. We have to give up.
- LOG_ERROR("unable to initialize with font %@ at %@", initialFont.get(), filePath);
+ LOG_ERROR("unable to initialize with font %@", initialFont.get());
failedSetup = true;
}
} else {
// We tried the requested font and the system font. No joy. We have to give up.
- LOG_ERROR("unable to initialize with font %@ at %@", initialFont.get(), filePath);
+ LOG_ERROR("unable to initialize with font %@", initialFont.get());
failedSetup = true;
}
}
// Report the problem.
- LOG_ERROR("Corrupt font detected, using %@ in place of %@ located at \"%@\".",
- [m_platformData.font() familyName], [initialFont.get() familyName], filePath);
+ LOG_ERROR("Corrupt font detected, using %@ in place of %@.",
+ [m_platformData.font() familyName], [initialFont.get() familyName]);
}
// If all else fails, try to set up using the system font.
« no previous file with comments | « Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm ('k') | Source/core/platform/mac/EmptyProtocolDefinitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698