< 返回版块

BlackStone 发表于 2025-10-20 18:05

一个基于 Rust 和 Skia Safe 的海报生成库,支持 RTL (从右到左) 文本渲染,适用于阿拉伯语、希伯来语、波斯语和维吾尔语等语言。

特性 Features

✅ 创建可配置宽高的海报 / Customizable canvas size

✅ 背景元素(颜色或图片),支持圆角 / Background with colors, images, and rounded corners

✅ 图片元素:

位置设置(x, y 坐标)/ Positioning (x, y coordinates)

尺寸设置(宽度,高度)/ Sizing (width, height)

圆角 / Rounded corners

图片适应模式(cover, contain, stretch)/ Object fit modes

z-index 层级 / Z-index layering

✅ 文本元素:

位置和尺寸设置 / Positioning and sizing

字体样式(大小,颜色,加粗)/ Font styling (size, color, bold)

文本对齐方式(左对齐,居中,右对齐)/ Text alignment (left, center, right)

多行文本自动换行和行高控制 / Multi-line text with automatic wrapping

最大行数限制,超出自动添加省略号 / Max lines with ellipsis

文本背景色,内边距和圆角 / Text background with padding and border radius z-index 层级 / Z-index layering 支持从右往左(RTL)的文本渲染 / RTL text rendering support

✅ 输出为 PNG 文件或 base64 编码字符串 / Export as PNG file or base64 string crates 链接: https://crates.io/crates/poster_generator

评论区

写评论
作者 BlackStone 2025-10-21 16:52

项目中有海报的json配置 crate_intro_poster

rtl_output

👇
Owen: 放一个效果图啊,看看效果

Owen 2025-10-21 09:59

放一个效果图啊,看看效果

1 共 2 条评论, 1 页