| Crates.io | sina |
| lib.rs | sina |
| version | 0.1.2 |
| created_at | 2025-12-19 13:43:15.806212+00 |
| updated_at | 2025-12-19 19:32:17.258129+00 |
| description | A modern 2D graphics rendering engine written in pure Rust, inspired by Skia |
| homepage | https://github.com/GrandpaEJ/sina |
| repository | https://github.com/GrandpaEJ/sina |
| max_upload_size | |
| id | 1994790 |
| size | 107,710 |
A modern 2D graphics rendering engine written in pure Rust, inspired by Skia.
Add Sina to your Cargo.toml:
[dependencies]
sina = "0.1.0"
use sina::{Color, Paint, Point, Rect, Surface, CpuSurface};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut surface = CpuSurface::new(800, 600);
surface.canvas().clear(Color::WHITE);
// Draw shapes
let paint = Paint::with_color(Color::RED);
surface.canvas().draw_rect(Rect::new(100.0, 100.0, 200.0, 150.0), &paint);
surface.save_png("output.png")?;
Ok(())
}
use sina::{Color, Paint, Point, Surface, CpuSurface, Font};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut surface = CpuSurface::new(800, 400);
let font = Font::from_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf")?;
let paint = Paint::with_color(Color::rgb(40, 40, 40));
surface.canvas().draw_text(
"Hello, Sina! مرحبا שלום",
Point::new(50.0, 150.0),
&font,
48.0,
&paint,
);
surface.save_png("text.png")?;
Ok(())
}
cargo run --example basic_shapes
cargo run --example text_rendering # requires font file
| Crate | Purpose |
|---|---|
| lyon | Vector path tessellation |
| raqote | CPU 2D rasterization |
| wgpu | GPU acceleration |
| ttf-parser | Font metadata |
| fontdue | Glyph rasterization |
| rustybuzz | Text shaping |
| glam | Mathematics |
| image | PNG encoding |
# Build
cargo build --release
# Test
cargo test --workspace
Licensed under either of:
at your option.
Contributions welcome! Please submit a Pull Request.
Sina - سینا - A treasure trove of 2D graphics capabilities! 🎨