Skip to main content

From Remote URL

PhotoEditor SDK supports loading fonts from a remote URL, this can be a resource hosted by a hosting provider or by your servers. Although the editor supports adding assets with remote URLs, we highly recommend that you manage the download of remote resources yourself, since this gives you more control over the whole process.

Download the font#

In order to download a custom font, we are using expo-file-system and save the remote resource to the temporary directory.

Adding custom font#

Using the downloaded resources, we are loading the custom font into the configuration. Each custom font takes an identifier, a name, a fontName as well as a fontURI that points to a local font file which can either be a TTF or an OTF font.

Handle user interaction#

For this example, we are using Recoil and Recoil Nexus state management to disable user interaction while the download task is executing. In production, you might want to indicate download progress here. When the download has finished, we can reenable user interaction and dismiss the progress indicator.