docs.rs failed to build araea-wordcloud-0.1.11
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
araea-wordcloud-0.1.6
araea-wordcloud
A high-performance word cloud visualization library implemented in pure Rust. Supports mask shapes, SVG/PNG dual output, custom fonts, vertical writing, and accurate pixel-perfect collision detection.
Features
- ⚡ Pure Rust Implementation - Efficient collision detection using bitmasking and spiral search.
- 🖼️ Multiple Output Formats - Export as vector graphics (SVG) or bitmap (PNG).
- 🎭 Mask Support - Built-in shapes (Heart, Star, Cloud, etc.) and custom image masks.
- ✍️ Vertical Writing - Support for traditional vertical text layout (vertical-rl), perfect for Chinese/Japanese calligraphy styles.
- 🎨 Highly Customizable - Precise control over colors, rotation, spacing, and fonts.
- 📦 Ready to Use - Built-in Chinese font support (HarmonyOS Sans SC).
Installation
[]
= "0.1"
Quick Start
use generate;
use fs;
Advanced Usage
use ;
Vertical Writing (竖排正写)
To enable vertical writing (ideal for Chinese/Japanese), set vertical_writing(true) and include 90.0 or -90.0 in your angles. Characters will be stacked vertically but remain upright, rather than the whole word being rotated sideways.
let wordcloud = new
.size
// Allow words to be placed vertically (90 degrees)
.angles
// Enable vertical writing mode:
// Words placed at 90/-90 degrees will have characters stacked vertically
.vertical_writing
.build?;
Examples
Simple Word Cloud

Chinese Dense Word Cloud

Run the examples:
cargo run --example simple- Basic usagecargo run --example mask_shape- Heart-shaped word cloudcargo run --example chinese_dense- High-density Chinese word cloudcargo run --example advanced- Custom colors and layout
Configuration Reference
Color Schemes
| Scheme | Description | Background |
|---|---|---|
Default |
Classic dark green, red, and gold tones | White |
Contrasting1 |
Vibrant orange, cyan, and beige | Black |
Blue |
Deep ocean blues and orange accents | White |
Green |
Natural forest greens and earth tones | White |
Cold1 |
Dark slate, grey, and bronze | Black |
Black |
Pure black text | White |
White |
Pure white text | Black |
Preset Masks
| Shape | Description |
|---|---|
Circle |
Standard circular layout (default) |
Cloud |
Cloud shape |
Heart |
Heart shape |
Skull |
Skull shape |
Star |
Star shape |
Triangle |
Triangle shape |
Builder Options
| Method | Description | Default |
|---|---|---|
.size(w, h) |
Canvas dimensions | 800x600 |
.background(hex) |
Custom background color | #FFFFFF (or based on scheme) |
.colors(vec![...]) |
Custom list of hex colors | Default Scheme |
.color_scheme(enum) |
Use a preset color scheme | ColorScheme::Default |
.font(bytes) |
Custom font file data (TTF/OTF) | HarmonyOS Sans SC Bold |
.mask(bytes) |
Custom mask image (SVG/PNG) | None |
.padding(px) |
Collision padding between words | 5 |
.angles(vec![...]) |
Allowed rotation angles (degrees) | vec![0.0] (Horizontal) |
.vertical_writing(bool) |
Enable upright vertical text flow (for CJK) when angle is ±90° | false |
.seed(u64) |
Random seed for reproducible layout | Random |
Acknowledgments
Thanks to wordcloud.online for inspiration and reference. The word cloud rendering approach is inspired by this website, achieving efficient and visually appealing results using canvas-style pixel collision detection.