File size: 2,939 Bytes
9eadb8b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | # Spectral Terminal Emulator
A next-generation terminal emulator written in Rust, designed to be **faster than Ghostty** while solving its biggest user frustration: **font rendering that looks too thin**.
## What Makes Spectral Different
### 1. Cross-Platform Font Thickening (Finally!)
Ghostty's #1 user complaint is that fonts look thinner than other terminals β and on Linux there's no fix. Spectral solves this with a **shader-based thickening system** that works identically on **macOS, Linux, and Windows**.
```ini
# Spectral config (works on ALL platforms)
font-thicken = true
font-thicken-strength = 0.5 # 0.0 = thin, 1.0 = bold
```
The MSDF (Multi-Channel Signed Distance Field) renderer allows per-pixel threshold adjustment in the GPU fragment shader. No platform-specific hacks β just one clean cross-platform solution.
### 2. True Cross-Platform Native GPU Backend
| Platform | Graphics API | Why |
|----------|-------------|-----|
| macOS | **Metal** (via wgpu) | Unified memory, triple buffering |
| Linux | **Vulkan** (via wgpu) | Low overhead, explicit control |
| Windows | **DirectX 12** (via wgpu) | Native Windows compositor |
One wgpu codebase renders everywhere. No separate Metal/OpenGL backends like Ghostty.
### 3. SIMD-Optimized ANSI Parser
The VT100/ANSI parser uses `memchr` for bulk ESC byte scanning β a SIMD-accelerated search that skips large text runs without per-byte dispatch.
### 4. GPU-First Architecture
| Component | Traditional Terminal | Spectral |
|-----------|---------------------|----------|
| Font rasterization | CPU (FreeType) | CPU initial cache, GPU rendering |
| Text rendering | Per-glyph draw calls | Single instanced draw (6 vertices Γ N cells) |
| Background | CPU compositing | GPU instanced colored quads |
| Frame pacing | VSync blocked | `PresentMode::AutoNoVsync`, 1-frame latency |
### 5. Zero System Dependencies for Font Discovery
Unlike Ghostty/Alacritty which require `fontconfig`/`pkg-config` on Linux, Spectral uses `fontdue` (pure Rust) + manual font file scanning. No `apt install fontconfig-dev` needed.
## Architecture
```
spectral/
βββ spectral-core/ # Terminal grid, ANSI parser, damage tracking
βββ spectral-font/ # Font loading, MSDF atlas, metrics
βββ spectral-render/ # wgpu GPU renderer
βββ spectral-pty/ # PTY abstraction
βββ src/main.rs # winit window + event loop
```
## Build
```bash
# Requires: Rust 1.75+, a Vulkan/Metal/DX12 capable GPU
cargo build --release
```
## Performance Targets
| Benchmark | Kitty | Ghostty | Alacritty | **Spectral Target** |
|-----------|-------|---------|-----------|-------------------|
| `cat /dev/urandom` | 121 MB/s | ~90 MB/s | 43 MB/s | **>150 MB/s** |
| Key-to-screen latency | ~8ms | ~8ms | ~10ms | **<8ms** |
| Startup time | ~200ms | ~150ms | ~120ms | **<100ms** |
## License
MIT/Apache-2.0 dual license.
|