Posts

Post not yet marked as solved
2 Replies
1.2k Views
My Function: We have a Wordart Template, when app launched, we will download the template and draw the wordart with the Default Font File in the template resouce. But the Default Font File just contain the Default Word. When user input some word, we will request the service to get a new font ttf file, which Just contain the words that the user input (For Less Network Traffic And Quick Rsponse).Then i will draw the wordart with the new font and the new words that the user just input. The same template will have the same font, so the new ttf file we got, will have the same PostScriptName.My Question: When the app launched, i regitster the Default Font File with the API CTFontManagerRegisterFontsForURL and draw the default words.It work perfectly. After the user input the other words, i request for a new font file that just contain the words that user just input. This two font file have the same font and the same post script name but contain different words (just several useful words). I noticed that the Apple Document said " Any attempt to register a font that is either already registered or contains the same Postscript of an already registered font will fail ". So, firstly, i call the API CTFontManagerUnregisterFontsForURL to unregister the old font that i have registed (i have record the old font file url). After that, i call the API CTFontManagerRegisterFontsForURL to regist the new font file i just download. Then i attempt to draw some words with the font, but the font not work. I have try CTFontManagerRegisterGraphicsFont and main thread too, but also not work. So, what should i do to make it work?
Posted
by PanyZ.
Last updated
.