Repository navigation
font finding in OSX produces 200+ lines of warnings #28249
Copy link
Copy link
Closed
Milestone
Description
@anntzer, on my macos 10.15.7 Catalina
system_profiler -xml SPFontsDataType 2>&1 # <- def _get_macos_fonts() in mpl 3.9.0
💥
2024-05-17 11:56:24.964 system_profiler[1061:15889] CoreText note: Client requested name ".AlBayanPUA", 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:].
2024-05-17 11:56:24.964 system_profiler[1061:15889] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2024-05-17 11:56:24.968 system_profiler[1061:15889] CoreText note: Client requested name ".AlBayanPUA-Bold", 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:].
2024-05-17 11:56:24.972 system_profiler[1061:15889] CoreText note: Client requested name ".AlNilePUA", 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:].
2024-05-17 11:56:24.975 system_profiler[1061:15889] CoreText note: Client requested name ".AlNilePUA-Bold", 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:].
2024-05-17 11:56:24.978 system_profiler[1061:15889] CoreText note: Client requested name ".AlTarikhPUA", 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:].
2024-05-17 11:56:24.982 system_profiler[1061:15889] CoreText note: Client requested name ".AppleColorEmojiUI", 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:].
2024-05-17 11:56:24.985 system_profiler[1061:15889] CoreText note: Client requested name ".AppleSDGothicNeoI-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:].
2024-05-17 11:56:24.988 system_profiler[1061:15889] CoreText note: Client requested name ".AppleSDGothicNeoI-Medium", 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:].
2024-05-17 11:56:24.991 system_profiler[1061:15889] CoreText note: Client requested name ".AppleSDGothicNeoI-Light", 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:].
...
200-odd such lines.
So I reinstalled matplotlib==3.8.4.
Please advise: are there functions in font_manager.py I can call to help debug this
or caches / .jsons I can delete ? Thanks
Originally posted by @denis-bz in #27230 (comment)
Reactions are currently unavailable
Activity
denis-bz commentedon May 17, 2024
Should the title be "font finding in OSX 10.15 ..." ?
MacOS_version_history says it's an "old version", not even "Older version, still maintained".
(Is there info on macos-versions-tested someplace ?
Oughta be in METADATA.
Added: https://endoflife.date/macos https://endoflife.date/python ... give a little more info;
ahhh, planned obsolescence ...
tacaswell commentedon May 17, 2024
Do we know it is osx version specific?
jklymak commentedon May 17, 2024
This does not happen for 14.x (Sonoma). Catalina is quite old - not sure when the difference would have come in.
denis-bz commentedon May 18, 2024
edit Sunday 19 May:
Folks,
until this is reproduced on other Macos versions, I'd drop it to low low priority --
better things to do than try to decipher these murky error messages (I got nowhere).
A workaround that works for me is to just ignore stderr in
font_manager.py _get_macos_fonts, instead of check_output --
anntzer commentedon May 20, 2024
Unfortunately I can't repro this on any of the macos versions present on GHA (which start at macos11). I suspect that the practical solution is indeed to silently ignore errors from system_profiler, at least when stdout is valid xml (i.e. we can assume that we'll still get a useful list of fonts from it).
1 remaining item
denis-bz commentedon Jun 12, 2026
@tacaswell, folks,
pip install matplotlibto 3.11.0 seems to have hidden SPFontsDataTypeso that
system_profiler -xml SPFontsDataTypespits out 200 lines of warnings like the above(which I don't understand).
Worse, back to
pip install matplotlib==3.10.9doesn't help;rm -r ~/Library/Cachesdoesn't help. Can a macos-font expert help me ?_get_macos_fontsin the twofont_manager.pylook the same.(This is on the same old mac 10.15, which I realize is endoflife ...)
Thanks, cheers
iccir commentedon Jun 27, 2026
@denis-bz - To be clear, if you run
system_profilein Terminal on the 10.15 machine, you are getting the 200 lines of warnings? If so, the problem is internal to thesystem_profileutility and is something that Apple fixed in macOS 11 and later.This message originates from
TDescriptorSource::CopyFontDescriptorPerPostScriptNamein the CoreText framework. IfTDescriptorSource::ShouldSubstituteInvisibleFontNamereturns true,CTFontLogSystemFontNameRequest()is called and the logs print. There's a flag that suppresses this behavior, which is likely what Apple started using on macOS 11 to prevent the output.For 10.15, I don't think there's anything that can be done other than filter out lines with "CoreText note" from stderr.
iccir commentedon Jun 27, 2026
After installing macOS 10.15 Catalina and reversing the
CoreText,SPFontReporter, andUIFoundationbinaries, I don't think that there's any way to avoid this error. The only way is to filter out the lines that contain "CoreText note".In 10.15,
-[SPFontReporter infoForDescriptor:]always calls+[NSFont fontWithName:size:], which will always print this log message by design.In 11.0, Apple added a check to see if the font is private (starts with a
.). If true, they no longer call into+[NSFont fontWithName:size:].Binary Ninja output from 11.0's SPFontReporter binary
denis-bz commentedon Jul 2, 2026
@iccir, thanks for going through these twisty passages; IOU a beverage of your choice 🍺