multiavatar 1.0.6

Deterministic multicultural avatar generator — pure Rust port of multiavatar.js with SVG/PNG/JPEG/GIF/favicon/ICO/data-URI outputs; part library embedded in the binary, no runtime files
Documentation
1
2
3
4
5
6
7
8
9
10
//! 头像渲染策略接口:把 SVG 文本渲染为指定输出。

/// 头像渲染策略:把 SVG 文本渲染为指定输出。
pub trait AvatarRenderer {
    /// 渲染。
    ///
    /// - `svg`:完整 SVG 文本(非空)
    /// - `size`:目标边长(像素,SVG 渲染器可忽略)
    fn render(&self, svg: &str, size: u32) -> Vec<u8>;
}