commonMain.io.github.alexzhirkevich.compottie.NetworkFontManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compottie-network-desktop Show documentation
Show all versions of compottie-network-desktop Show documentation
Compose Multiplatform lottie animation
The newest version!
package io.github.alexzhirkevich.compottie
import androidx.compose.runtime.Stable
import io.github.alexzhirkevich.compottie.assets.LottieFontManager
import io.github.alexzhirkevich.compottie.assets.LottieFontSpec
/**
* Font manager that loads fonts from the web.
*
* Guaranteed to work only with [LottieFontSpec.FontOrigin.FontUrl] .ttf fonts
* (support may be higher on non-Android platforms).
*
* Note: [LottieCacheStrategy.path] should return valid file system paths to make [NetworkFontManager] work.
* Default [DiskCacheStrategy] supports it.
*
* @param cacheStrategy caching strategy. Caching to system temp dir by default
* */
@OptIn(InternalCompottieApi::class)
@Stable
public fun NetworkFontManager(
cacheStrategy: LottieCacheStrategy = DiskCacheStrategy.Instance,
) : LottieFontManager = NetworkFontManager(
request = DefaultHttpRequest,
cacheStrategy = cacheStrategy
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy