Resource Embedding
By default, images from @image-url() or fonts that your Slint files reference are loaded from disk at run-time. This minimizes build times, but requires that the directory structure with the files remains stable. If you want to build a program that runs anywhere, then you can configure the Slint compiler to embed such sources into the binary.
Set the SLINT_EMBED_RESOURCES target property on your CMake target to one of the following values:
embed-files: The raw files are embedded in the application binary.embed-for-software-renderer: The files will be loaded by the Slint compiler, optimized for use with the software renderer and embedded in the application binary.embed-for-software-renderer-with-sdf: Same asembed-for-software-renderer, but use Signed Distance Fields (SDF) ↗ to render fonts. This produces smaller binaries, but may result in slightly inferior visual output and slower rendering. (Requires theSLINT_FEATURE_SDF_FONTSfeature to be enabled.)as-absolute-path: The paths of files are made absolute and will be used at run-time to load the resources from the file system. This is the default.
This target property is initialized from the global DEFAULT_SLINT_EMBED_RESOURCES cache variable. Set it to configure the default for all CMake targets.
# Example: when building my_application, specify that the compiler should embed the resources in the binaryset_property(TARGET my_application PROPERTY SLINT_EMBED_RESOURCES embed-files)cmake
© 2026 SixtyFPS GmbH