RESOLVED FIXED187936
[Cocoa] Stop crashing in lastResortFallbackFont()
https://bugs.webkit.org/show_bug.cgi?id=187936
Summary [Cocoa] Stop crashing in lastResortFallbackFont()
Myles C. Maxfield
Reported 2018-07-23 17:32:45 PDT
[Cocoa] Stop crashing in lastResortFallbackFont()
Attachments
Patch (4.36 KB, patch)
2018-07-23 17:39 PDT, Myles C. Maxfield
no flags
Patch (4.48 KB, patch)
2018-07-23 17:47 PDT, Myles C. Maxfield
no flags
Patch (4.49 KB, patch)
2018-07-23 17:47 PDT, Myles C. Maxfield
no flags
Patch (4.49 KB, patch)
2018-07-23 17:48 PDT, Myles C. Maxfield
jonlee: review+
Myles C. Maxfield
Comment 1 2018-07-23 17:39:17 PDT
Myles C. Maxfield
Comment 2 2018-07-23 17:47:04 PDT
Myles C. Maxfield
Comment 3 2018-07-23 17:47:59 PDT
Myles C. Maxfield
Comment 4 2018-07-23 17:48:33 PDT
Jon Lee
Comment 5 2018-07-23 18:54:10 PDT
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?
Myles C. Maxfield
Comment 6 2018-07-24 11:18:15 PDT
Myles C. Maxfield
Comment 7 2018-07-24 11:34:31 PDT
Darin Adler
Comment 8 2018-07-28 22:35:26 PDT
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"?
Myles C. Maxfield
Comment 9 2018-07-31 11:47:32 PDT
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.
Darin Adler
Comment 10 2018-08-01 09:54:22 PDT
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!
Note You need to log in before you can comment on or make changes to this bug.