Fonts, images and filesystem access for one renderer. Set this record as
Emerge.Config.assets.
%Emerge.Config{
assets: %Emerge.Config.Assets{
otp_app: :my_app,
fonts: [%Emerge.Config.Font{family: "Inter", source: "fonts/Inter-Regular.ttf"}]
}
}Fields
otp_app— OTP application whosepriv/directory contains logical asset paths. Defaults tonil: a viewport infers its application where possible, but standaloneEmergeSkia.start/1callers must supply it.fonts— list ofEmerge.Config.Fontregistrations; defaults to[]. Register each family/weight/italic variant your UI uses.decode_at_size—falseby default. Withtrue, raster images are decoded near their drawn size rather than always retaining the source dimensions. Useful for thumbnails of large images; larger targets can request a larger decode.runtime_paths—Emerge.Config.RuntimePaths. Its default disables images loaded from absolute filesystem paths.cache—Emerge.Config.AssetCache, limiting retained image pixels and parsed SVGs. These limits are separate from renderer paint caching.
All fields require a new viewport to change. Lists such as fonts replace the
previous list rather than append to it. See Use assets for
paths, font usage and memory-tuning examples.
Summary
Types
Canonical form after nested keyword records have been expanded.
Typed keyword shorthand accepted in this record's parent field.
Types
@type normalized_t() :: %Emerge.Config.Assets{ cache: Emerge.Config.AssetCache.normalized_t(), decode_at_size: boolean(), fonts: [Emerge.Config.Font.normalized_t()], otp_app: atom() | nil, runtime_paths: Emerge.Config.RuntimePaths.normalized_t() }
Canonical form after nested keyword records have been expanded.
@type options() :: [ otp_app: atom() | nil, fonts: [Emerge.Config.Font.t() | Emerge.Config.Font.options()], decode_at_size: boolean(), runtime_paths: Emerge.Config.RuntimePaths.t() | Emerge.Config.RuntimePaths.options(), cache: Emerge.Config.AssetCache.t() | Emerge.Config.AssetCache.options() ]
Typed keyword shorthand accepted in this record's parent field.
@type t() :: %Emerge.Config.Assets{ cache: Emerge.Config.AssetCache.t() | Emerge.Config.AssetCache.options(), decode_at_size: boolean(), fonts: [Emerge.Config.Font.t() | Emerge.Config.Font.options()], otp_app: atom() | nil, runtime_paths: Emerge.Config.RuntimePaths.t() | Emerge.Config.RuntimePaths.options() }