0

I'm looking for a way to enumerate all fonts that have been installed via Configuration Profiles on iOS? I've heard that you can use SecItemCopyMatching for this but I'm unable to find the right combination of parameters that work. My app is running on iOS 8.1+. Any help is appreciated.

Here's my function. I have been trying all sorts of combinations of the first two values for "keys" - everything always either fails or returns no results. In this case, I was trying to find the font Configuration Profiles installed by the "AnyFont" app.

- (void)textFontQuery
    {
    const char *str = "AnyFont";
    CFStringRef strValue = CFStringCreateWithCString(NULL, str, kCFStringEncodingUTF8);
    const void *keys[] = { kSecClass, kSecAttrApplicationTag, kSecMatchLimit, kSecReturnAttributes };
    const void *values[] = { kSecClassKey, strValue, kSecMatchLimitAll, kCFBooleanTrue };
    CFDictionaryRef dict = CFDictionaryCreate(NULL, keys, values, 4, NULL, NULL);
    CFTypeRef certificateRef = NULL;
    OSStatus status = SecItemCopyMatching(dict, &certificateRef);
    CFRelease(strValue);
    CFRelease(dict);
    if (status != noErr)
        NSLog(@"Query Failed");

    return;
}
imLanky
  • 155
  • 1
  • 6

0 Answers0