Bug 1672842 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

System fonts are rendered with Helvetica instead of San Francisco when building with modern SDKs. Moreover, during startup, these messages are printed:

```
2020-10-22 17:03:34.455 firefox[83998:4623540] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-10-22 17:03:34.455 firefox[83998:4623540] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
```

This does not happen when building with the 10.11 SDK, probably thanks to a compatibility hack. I don't know which SDK this starts happening on. I have tested the following configurations:

| When building with SDK | and running on OS | Do system fonts look correct? |
|---|---|---|
| 10.11 | macOS 10.15 | yes |
| 10.11 | macOS 11.0 | yes |
| 10.15 | macOS 11.0 | no |
| 11.0 | macOS 11.0 | no |

We hit `CTFontLogSystemFontNameRequest` at the following stack:

```
* thread #1, name = 'MainThread', queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
  * frame #0: 0x00007fff21a9ba8b CoreText`CTFontLogSystemFontNameRequest
    frame #1: 0x00007fff21a99ecd CoreText`TDescriptorSource::CopyFontDescriptorPerPostScriptName(__CFString const*, unsigned long, unsigned long, __CFString const*, __CFNumber const*, CTFontLegibilityWeight, __CFBoolean const*) const + 93
    frame #2: 0x00007fff219ca204 CoreText`TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*, unsigned long) const + 2422
    frame #3: 0x00007fff219c946d CoreText`TDescriptor::CreateMatchingDescriptor(__CFSet const*, double, unsigned long) const + 191
    frame #4: 0x00007fff219c9384 CoreText`CTFontDescriptorCreateMatchingFontDescriptor + 41
    frame #5: 0x00007fff239d6ec5 UIFoundation`+[__NSFontTypefaceInfo typefaceInfoForPostscriptName:options:] + 318
    frame #6: 0x00007fff239d9b1e UIFoundation`__NSFontFactoryWithName + 136
    frame #7: 0x00007fff239d9a2d UIFoundation`+[NSFont fontWithName:size:] + 30
    frame #8: 0x0000000105b125ab XUL`gfxMacPlatformFontList::InitSystemFontNames() [inlined] GetRealFamilyName(aFont=<unavailable>) at gfxMacPlatformFontList.mm:1133:15 [opt]
    frame #9: 0x0000000105b12574 XUL`gfxMacPlatformFontList::InitSystemFontNames(this=0x0000000124c9d000) at gfxMacPlatformFontList.mm:1153 [opt]
    frame #10: 0x0000000105b12f6a XUL`gfxMacPlatformFontList::InitSharedFontListForPlatform(this=0x0000000124c9d000) at gfxMacPlatformFontList.mm:973:3 [opt]
    frame #11: 0x0000000105ae6b0b XUL`gfxPlatformFontList::InitFontList(this=0x0000000124c9d000) at gfxPlatformFontList.cpp:497:5 [opt]
    frame #12: 0x0000000105a9ff43 XUL`gfxPlatformMac::CreatePlatformFontList(this=<unavailable>) at gfxPlatformMac.cpp:108:7 [opt]
    frame #13: 0x0000000105a98248 XUL`gfxPlatform::Init() [inlined] gfxPlatformFontList::Init() at gfxPlatformFontList.h:175:33 [opt]
    frame #14: 0x0000000105a98224 XUL`gfxPlatform::Init() at gfxPlatform.cpp:991 [opt]
    frame #15: 0x0000000105a97490 XUL`gfxPlatform::GetPlatform() at gfxPlatform.cpp:510:5 [opt]
    frame #16: 0x000000010763f003 XUL`mozilla::widget::GfxInfoBase::GetContentBackend(this=<unavailable>, aContentBackend=u"") at GfxInfoBase.cpp:1780:25 [opt]
[...]
```

Fixing this is somewhat time-sensitive because building for Apple Silicon requires the Big Sur SDK.
System fonts are rendered with Helvetica instead of San Francisco when building with modern SDKs. Moreover, during startup, these messages are printed:

```
2020-10-22 17:03:34.455 firefox[83998:4623540] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-10-22 17:03:34.455 firefox[83998:4623540] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
```

This does not happen when building with the 10.11 SDK, probably thanks to a compatibility hack. I don't know which SDK this starts happening on. (edit: Alexei tested, it starts with the 10.13 SDK.)

| When building with SDK | and running on OS | Do system fonts look correct? |
|---|---|---|
| 10.11 | macOS 10.15 | yes |
| 10.11 or 10.12 | macOS 11.0 | yes |
| 10.13 - 11.0 | macOS 11.0 | no |

We hit `CTFontLogSystemFontNameRequest` at the following stack:

```
* thread #1, name = 'MainThread', queue = 'com.apple.main-thread', stop reason = breakpoint 2.1
  * frame #0: 0x00007fff21a9ba8b CoreText`CTFontLogSystemFontNameRequest
    frame #1: 0x00007fff21a99ecd CoreText`TDescriptorSource::CopyFontDescriptorPerPostScriptName(__CFString const*, unsigned long, unsigned long, __CFString const*, __CFNumber const*, CTFontLegibilityWeight, __CFBoolean const*) const + 93
    frame #2: 0x00007fff219ca204 CoreText`TDescriptor::CreateMatchingDescriptorInternal(__CFSet const*, unsigned long) const + 2422
    frame #3: 0x00007fff219c946d CoreText`TDescriptor::CreateMatchingDescriptor(__CFSet const*, double, unsigned long) const + 191
    frame #4: 0x00007fff219c9384 CoreText`CTFontDescriptorCreateMatchingFontDescriptor + 41
    frame #5: 0x00007fff239d6ec5 UIFoundation`+[__NSFontTypefaceInfo typefaceInfoForPostscriptName:options:] + 318
    frame #6: 0x00007fff239d9b1e UIFoundation`__NSFontFactoryWithName + 136
    frame #7: 0x00007fff239d9a2d UIFoundation`+[NSFont fontWithName:size:] + 30
    frame #8: 0x0000000105b125ab XUL`gfxMacPlatformFontList::InitSystemFontNames() [inlined] GetRealFamilyName(aFont=<unavailable>) at gfxMacPlatformFontList.mm:1133:15 [opt]
    frame #9: 0x0000000105b12574 XUL`gfxMacPlatformFontList::InitSystemFontNames(this=0x0000000124c9d000) at gfxMacPlatformFontList.mm:1153 [opt]
    frame #10: 0x0000000105b12f6a XUL`gfxMacPlatformFontList::InitSharedFontListForPlatform(this=0x0000000124c9d000) at gfxMacPlatformFontList.mm:973:3 [opt]
    frame #11: 0x0000000105ae6b0b XUL`gfxPlatformFontList::InitFontList(this=0x0000000124c9d000) at gfxPlatformFontList.cpp:497:5 [opt]
    frame #12: 0x0000000105a9ff43 XUL`gfxPlatformMac::CreatePlatformFontList(this=<unavailable>) at gfxPlatformMac.cpp:108:7 [opt]
    frame #13: 0x0000000105a98248 XUL`gfxPlatform::Init() [inlined] gfxPlatformFontList::Init() at gfxPlatformFontList.h:175:33 [opt]
    frame #14: 0x0000000105a98224 XUL`gfxPlatform::Init() at gfxPlatform.cpp:991 [opt]
    frame #15: 0x0000000105a97490 XUL`gfxPlatform::GetPlatform() at gfxPlatform.cpp:510:5 [opt]
    frame #16: 0x000000010763f003 XUL`mozilla::widget::GfxInfoBase::GetContentBackend(this=<unavailable>, aContentBackend=u"") at GfxInfoBase.cpp:1780:25 [opt]
[...]
```

Fixing this is somewhat time-sensitive because building for Apple Silicon requires the Big Sur SDK.

Back to Bug 1672842 Comment 0