Current status: Using mmap magic to rearrange font collection files to work around the fact that the Core Text API to load a single font from a collection is Apple-private.
-
Show this thread
-
Replying to @pcwalton
I'm not sure I understand. Do you mind rephrasing this into a code snippet?
1 reply 0 retweets 0 likes -
Replying to @jjgod
CGFontCreateWithDataProvider() works for opening single fonts, but for OpenType collections (.ttc/.otc) it only opens the first font in the collection IIRC. I don’t see an API to open the other fonts in the collection.
2 replies 0 retweets 0 likes -
Replying to @pcwalton
Oh, we do have CTFontManagerCreateFontDescriptorsFromURL(). Do you have to start with a data provider?
1 reply 0 retweets 0 likes -
Replying to @jjgod
Oh nice, thanks for the tip. I’ll use that when available. (It still doesn’t solve the in-memory use case, though, which is useful for the browser.)
1 reply 0 retweets 0 likes -
Replying to @pcwalton
That seems like a reasonable request. I filed a radar on your behalf, but if you want to get notification when that gets fixed you can file one too.
1 reply 0 retweets 0 likes -
-
Replying to @pcwalton
CTFontManagerCreateFontDescriptorsFromData() is public API in macOS 10.15/iOS 13 SDK now.
1 reply 0 retweets 1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.