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.
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.
-
-
Oh, we do have CTFontManagerCreateFontDescriptorsFromURL(). Do you have to start with a data provider?
-
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.)
- 4 more replies
New conversation -
-
-
My workaround right now is to mmap the .ttc file with MAP_PRIVATE, copy the desired individual font header to the beginning of the mmap’d area, and then pass the mmap’d address to CGDataProviderCreateWithData().
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.