4个稳定版本
1.0.3 | 2023年1月4日 |
---|---|
1.0.1 | 2022年12月21日 |
#4 in #c2rust
每月30次下载
44KB
849 代码行(不包括注释)
spiro.rlib
v1.0.3 (⏫︎2023-01-04)
这是Raph Levien的Sprio C实现,以纯Rust编写,由C2Rust转换,并由Fredrick R. Brennan (@ctrlcctrlv)进行大量编辑。
功能
- 完全支持所有Sprio点类型。
- 自v1.0.0版本以来不再有非安全代码(感谢Seth)。
- 可选
glifparser
支持,通过它(在可从PenOperationsPath
转换的Outline
上的ToKurbo
)还可以获得Raph Levien的kurbo
。- 这提供了
.glif
输出。见§ «使用示例」。
- 这提供了
- 简单的PostScript输出上下文。
使用示例
use spiro::{BezCtxGpPenOpsData, BezierContext};
use glifparser::{Glif, outline::ToOutline as _};
let mut ctx = BezierContext::<BezCtxGpPenOpsData, ()>::new();
let path = test_data!();
ctx.run_spiro(&path);
let mut glif = Glif::<()>::new();
glif.outline = Some(ctx.data.ops_path.to_outline());
eprintln!("{}", glifparser::glif::write(&glif).unwrap());
许可证(C2Rust输出的此编辑)
Copyright (C) 2020–2022 Fredrick R. Brennan, Seth Erfurt and MFEK Authors
Copyright (C) 2007 Raph Levien
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this software or any of the provided source code files except in compliance
with the License. You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
许可证(原始C代码)
Copyright (C) 2007 Raph Levien
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
https://apache.ac.cn/licenses/LICENSE-2.0> or the MIT license
<LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
option. This file may not be copied, modified, or distributed
except according to those terms.
依赖关系
~6.5MB
~121K SLoC