After downloading the font, if you want to use it offline (or do not
call the download API again),  you can try to save the font URL and
next time of launching, use "CTFontManagerRegisterFontsForURL" to
register the font.

This file is what you want:
https://github.com/fdstevex/FDSFontDownloader/blob/master/FDSFontDownloader.m

I try to use this on my app, everything works file on simulator, but
register failed on device on iOS 7.1 Beta. Not sure if it is an bug of
iOS 7.1.

The article worth to read:
http://blog.stevex.net/2013/09/downloadable-fonts-in-ios-7/

On Sun, Jan 19, 2014 at 1:26 PM, Gideon King <gid...@novamind.com> wrote:
> Hi, I am trying to use 
> CTFontDescriptorMatchFontDescriptorsWithProgressHandler to download a font. 
> It appears to download fine, and I can display it in my application. [UIFont 
> familyNames] includes that font.
>
> I restart my application, and [UIFont familyNames] does not include the 
> downloaded font, and I can’t create the font using fontWithName:size:.
>
> I have tested this on both my iPad and the simulator, and it always forgets 
> the downloaded font on restart of the application.
>
> On the simulator, if I go to Library/Assets/com_apple_MobileAsset_Font I can 
> see the folder with the downloaded font in it, and there is a 
> com_apple_MobileAsset_Font.plist file which includes all the information 
> about the downloaded font. So it knows about the font, and the font is really 
> there, but when I try to use it in my application it isn’t there until I 
> download it again during that session.
>
> Is there something I am doing wrong? Do I need to initialize something to get 
> it to include the downloaded fonts in the search?
>
>
> Regards
>
> Gideon
>
>
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/tualatrix%40gmail.com
>
> This email sent to tualat...@gmail.com



-- 
Tualatrix Chou
http://imtx.me
@tualatrix

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to