Data model: - Gradient fills (LINEAR, RADIAL, ANGULAR, DIAMOND) with stops + transform - Image fills with hash reference, scale mode, transform - Blend modes on fills, nodes, effects - Stroke cap, join, dash pattern, independent border weights - Arc data for partial ellipses/donuts - Text: vertical align, auto-resize, case, decoration, max lines - Constraints: horizontal/vertical - New node types: ROUNDED_RECTANGLE, COMPONENT, COMPONENT_SET, INSTANCE, CONNECTOR, SHAPE_WITH_TEXT Import: - All paint types imported (not just SOLID) - Image hashes extracted from .fig ZIP images/ directory - Font weight mapping (Thin→100 through Black→900) - Arc data, stroke options, constraints, text properties Renderer: - Gradient shaders via CanvasKit (linear, radial, sweep) - Image fills with FILL/FIT scale modes and shader matrix - Drop shadow and inner shadow effects - Arc/donut rendering for ellipses with arcData - Stroke cap/join/dash pattern support - Image cache with cleanup on destroy Export: - Gradient/image fills round-trip through Kiwi - New node types mapped to Figma equivalents UI: - Fill section shows gradient/image type labels for non-SOLID fills |
||
|---|---|---|
| .vscode | ||
| desktop | ||
| public | ||
| src | ||
| tests | ||
| .gitignore | ||
| .oxfmtrc.json | ||
| bun.lock | ||
| components.d.ts | ||
| index.html | ||
| oxlint.json | ||
| package.json | ||
| PLAN.md | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
OpenPencil
Open-source, AI-native design editor. Figma alternative built from scratch with full .fig file compatibility.
Status: Active development. Not ready for production use.
Features
- Figma .fig file import — open native Figma files directly
- Figma clipboard — copy/paste between OpenPencil and Figma
- Vector networks — complex boolean shapes and open paths, like Figma
- Auto-layout — constraint-based layout matching Figma behavior
- Pen tool — bezier curves with tangent handles
- Inline text editing — multi-line text with Inter font
- Undo/redo — all operations are undoable
- Snap guides — edge and center snapping
- Color picker — HSV, hue/alpha sliders, hex input
Tech Stack
| Layer | Tech |
|---|---|
| UI | Vue 3, VueUse, Reka UI |
| Styling | Tailwind CSS 4 |
| Rendering | Skia (CanvasKit WASM) |
| Layout | Yoga WASM |
| File format | Kiwi binary (vendored) + Zstd + ZIP |
| Color | culori |
| Desktop | Tauri v2 |
| Testing | Playwright (visual regression), bun:test (unit) |
| Tooling | Vite 7, oxlint, oxfmt, typescript-go |
Getting Started
bun install
bun run dev
Scripts
| Command | Description |
|---|---|
bun run dev |
Dev server at http://localhost:1420 |
bun run build |
Production build |
bun run check |
Lint + typecheck |
bun run test |
E2E visual regression |
bun run test:update |
Regenerate screenshot baselines |
bun run test:unit |
Unit tests |
bun run tauri dev |
Desktop app (requires Rust) |
Desktop App
Requires Rust, the Tauri CLI, and platform-specific prerequisites (Tauri v2 guide).
cargo install tauri-cli --version "^2"
bun run tauri dev # Dev mode with hot reload
bun run tauri build # Production build
bun run tauri build --target universal-apple-darwin # macOS universal
Cross-compilation to other platforms requires their respective toolchains or CI (e.g. GitHub Actions).
Project Structure
src/
components/ Vue SFCs (canvas, panels, toolbar, color picker)
composables/ Canvas input, keyboard shortcuts, rendering
stores/ Editor state (Vue reactivity)
engine/ Scene graph, renderer, layout, clipboard, undo, vector, snap
kiwi/ Figma file format (Kiwi codec, .fig import)
kiwi-schema/ Vendored from evanw/kiwi
types.ts Shared types
constants.ts UI colors, defaults, thresholds
desktop/ Tauri v2 (Rust + config)
tests/
e2e/ Playwright visual regression
engine/ Unit tests
License
MIT