Custom Font from external server
fbarraganef opened this issue · 4 comments
Is possible load a custom font (ttf file) in my project using only the url for the file of the font?
You should be able to do it by loading a remote ‘.bundle’ file.`
thank you for you response, Is there an example of that?
I looking for something similar to this:
FontBlaster.blast(bundle: "https://www.testhost.com/feghwekcjb32784091/myfontfile.ttf") { (fonts) in
print(fonts) // fonts is an array of Strings containing font names
}
But I seeing that in iOS 13 changes the font management, but the documentation is not very clear. But you have more experience working with fonts and core text.
To be honest, I haven't tested that functionality in ages. You're loading a font, not a bundle. You have to package your fonts in a bundle file and load it that way. Maybe zip up a.bundle
file on the server, unzip it locally so that you have a .bundle
file,, then pass it to that method you called out in your example.
I don't actively maintain this library that much anymore, so feel free to fork it and add the functionality you'd like!
Closing the ticket, but feel free to follow up with a working (or non-working example) and we can chat some more at that point in time.