1.3 KiB · text History aca7335
fn main() -> eframe::Result<()> {
    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
            .with_inner_size([1360.0, 860.0])
            .with_min_inner_size([900.0, 600.0])
            .with_title("Icon Studio"),
        renderer: eframe::Renderer::Glow,
        ..Default::default()
    };
    eframe::run_native(
        "icon-studio",
        options,
        Box::new(|cc| {
            // The icon picker renders Material Symbols as text, so egui needs
            // the same font the rasteriser uses. Registered here rather than
            // through egui_material_icons, whose 0.9 ships a newer font with
            // codepoints that no longer match assets/*.codepoints; added as
            // its 0.4 did, as the last fallback for proportional text.
            let mut font = egui::FontData::from_static(icon_studio::render::FILLED);
            font.tweak.y_offset_factor = 0.05;
            cc.egui_ctx.add_font(egui::epaint::text::FontInsert::new(
                "material-icons",
                font,
                vec![egui::epaint::text::InsertFontFamily {
                    family: egui::FontFamily::Proportional,
                    priority: egui::epaint::text::FontPriority::Lowest,
                }],
            ));
            Ok(Box::new(icon_studio::app::Studio::new()))
        }),
    )
}