Search code examples
iosobjective-ccore-foundation

iOS 13 Installed Fonts Retrieval


Is there a way to retrieve a list of Installed Fonts in iPadOS 13.1?

Neither

CTFontManagerCopyAvailablePostScriptNames

nor

[UIFont familyNames]

would get any of the fonts shown in iPad Settings > General > Fonts. Is there something I'm missing?


Solution

  • At first I thought you could use CTFontManagerCopyRegisteredFontDescriptors with the kCTFontManagerScopePersistent scope but that always return a CFArrayRef with 0 items. I'm guessing if your own don't install it, you can't see it.

    So I found out that enumeration of User Custom Fonts in iPadOS 13 is prohibited. Enumeration will only return system font because of privacy concerns. See Font Management and Text Scaling WWDC Video at timestamp 18:05.

    The only way to reach those font is to use the provided UIFontPickerViewController class for your font selector with limited customisation.