20 个版本 (重大更改)
0.15.0 | 2024 年 5 月 21 日 |
---|---|
0.13.1 | 2024 年 2 月 16 日 |
0.7.0 | 2023 年 8 月 19 日 |
0.4.0 | 2023 年 7 月 21 日 |
0.2.1 | 2023 年 3 月 27 日 |
在 数据格式 中排名 33
每月下载 134 次
用于 3 个 crate(通过 font)
100KB
313 代码行
包含 (WOFF 字体,93KB) NotoNaskhArabic-Regular.woff2
WebType

该包提供了 Web 开放字体格式的字体解析器。查看名为 font
的高级抽象可能有所帮助,该抽象内部依赖于此包。
示例
use webtype::opentype::truetype::tables::FontHeader;
use webtype::File;
macro_rules! ok(($result:expr) => ($result.unwrap()));
let path = "NotoNaskhArabic-Regular.woff2";
let mut tape = ok!(std::fs::File::open(path));
let File { mut fonts, mut tape } = ok!(File::read(&mut tape));
let font_header = ok!(ok!(fonts[0].take::<_, FontHeader>(&mut tape)));
assert_eq!(font_header.units_per_em, 2048);
贡献
非常感谢您的贡献。不要犹豫,可以打开一个 issue 或 pull request。请注意,任何提交给项目包含的贡献都将根据在 LICENSE.md 中给出的条款进行许可。
依赖项
~2.5MB
~41K SLoC