[Cocoa] Stop crashing in lastResortFallbackFont()
Created attachment 345629 [details] Patch
Created attachment 345631 [details] Patch
Created attachment 345632 [details] Patch
Created attachment 345633 [details] Patch
Comment on attachment 345633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345633&action=review > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:-1491 > - return *fontForFamily(fontDescription, AtomicString("Lucida Grande", AtomicString::ConstructFromLiteral), nullptr, nullptr, { }, false); The comment above seems no longer to be true. Remove or update?
<rdar://problem/42249550>
Committed r234158: <https://trac.webkit.org/changeset/234158>
Comment on attachment 345633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345633&action=review > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:1490 > // The Times fallback will almost always work, but in the highly unusual case where > // the user doesn't have it, we fall back on Lucida Grande because that's > // guaranteed to be there, according to Nathan Taylor. This is good enough > // to avoid a crash at least. I think it’s crazy that we are still using "Lucida Grande" as part of our "last resort". I believe I originally wrote this comment, and it was correct long ago when Lucida Grande was the system font on Mac. It was never true on iOS. Nowadays, not only is using it insufficient, it’s not even a good idea to try it after "Times". We should get rid of this. Just Times and then the last resort. > Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:1498 > + auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedPixelSize(), nullptr)); Is this really helpful? When do we have "Helvetica" but not "Times"?
Comment on attachment 345633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345633&action=review >> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:1498 >> + auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedPixelSize(), nullptr)); > > Is this really helpful? When do we have "Helvetica" but not "Times"? This was a recommendation from the CoreText team.
Comment on attachment 345633 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345633&action=review >>> Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:1498 >>> + auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedPixelSize(), nullptr)); >> >> Is this really helpful? When do we have "Helvetica" but not "Times"? > > This was a recommendation from the CoreText team. So now I know who recommended it, but not why!