Skip to content

Assets and Fonts

Joseph Chacko edited this page Jul 22, 2026 · 2 revisions

Assets & Fonts

Relevant source files

The following files were used as context for generating this wiki page:

This page documents the static assets bundled with the Aurora Music Player. These assets include high-quality typography for both UI text and iconography, fallback imagery for album art, and specific assets used by the daemon for external integrations like MPRIS2.

Aurora utilizes a "compiled-in" approach for core assets using the Rust include_bytes! macro, ensuring the application is portable and does not rely on external file paths for its fundamental visual identity app/src/interface.rs:328-329.

1. Typography & Iconography

Aurora relies on two primary font files to render its interface. These are loaded into the Slint runtime during initialization.

Asset Name File Path Purpose
JetBrainsMono NFP app/assets/JetbrainsMono.ttf A Nerd Font patched version of JetBrains Mono. Used exclusively for icons (via glyph codepoints) and monospaced UI elements README.md:51-51.
Noto Sans app/assets/NotoSans.ttf The primary typeface for all body text, song titles, and metadata display.

Implementation Detail

The fonts are specified as requirements for the build environment README.md:48-53. In the Slint UI files, these fonts are referenced via the global Theme singleton or specific element properties to maintain a consistent look across the LibraryView, PlayerView, and QueueView.

2. Image Assets & Fallbacks

Aurora manages album art dynamically; however, it bundles static PNG assets to handle cases where metadata is missing or the daemon needs a representative icon.

placeholder.png

Located at app/assets/placeholder.png. This is the fallback image used in the aurora-player frontend app/assets/placeholder.png:1-3. When a song lacks embedded cover art, the interface.rs logic defaults to this image in the Slint Image properties.

noart.png

Located at daemon/assets/noart.png. This asset is used by the aurora-daemon daemon/assets/noart.png:1-3. It is primarily utilized for the MPRIS2 D-Bus interface, providing a valid image URI or byte stream to external media controllers (like GNOME/KDE shell widgets) when the currently playing track has no art.

3. Asset Embedding & Loading Pipeline

The frontend handles assets by embedding them directly into the binary. This prevents "missing asset" errors at runtime.

Data Flow: Asset to UI

The following diagram illustrates how the placeholder.png is embedded and eventually rendered in the Slint pipeline.

Asset Loading Architecture

graph TD
    subgraph "Build Time"
        A["placeholder.png"] -- "include_bytes!" --> B["Static Byte Slice"]
    end

    subgraph "Runtime: aurora-player"
        B --> C["interface.rs"]
        C --> D["Slint Image Pipeline"]
        D --> E["AuroraPlayer UI Component"]
    end

    subgraph "Runtime: aurora-daemon"
        F["noart.png"] --> G["MPRIS Thread"]
        G -- "D-Bus" --> H["System Media Widget"]
    end
Loading

Sources: app/src/interface.rs:328-329, README.md:12-18.

4. Technical Implementation

Slint Image Handling

In the interface.rs module, album art is processed and sent to the UI. If the daemon returns a None or empty vector for art, the frontend logic ensures the bundled placeholder is displayed.

Entity Mapping: Asset Code Symbols

graph LR
    subgraph "Code Entities"
        I["include_bytes!"] 
        S["slint::Image::load_from_rgba8"]
        P["placeholder.png"]
        N["noart.png"]
    end

    subgraph "System Roles"
        I -- "Embeds" --> P
        I -- "Embeds" --> N
        S -- "Processes" --> P
    end

    subgraph "Files"
        F1["app/src/interface.rs"]
        F2["daemon/src/main.rs"]
    end

    F1 -- "Uses" --> S
    F1 -- "References" --> P
    F2 -- "References" --> N
Loading

Sources: app/src/interface.rs:328-340, README.md:51-53.

Summary Table of Embedded Assets

Constant/File Crate Usage Method
placeholder.png aurora-player UI Album Art Fallback include_bytes!
noart.png aurora-daemon MPRIS2 Metadata include_bytes!
JetbrainsMono.ttf aurora-player Icons & Mono Text Slint Font Loading
NotoSans.ttf aurora-player General Typography Slint Font Loading

Sources: app/assets/placeholder.png:1-9, app/assets/NotoSans.ttf:1-10, app/assets/JetbrainsMono.ttf:1-10, daemon/assets/noart.png:1-10.

Clone this wiki locally