Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bodoni/font
Builder and parser for fonts
https://github.com/bodoni/font
font opentype parsing typeface typography
Last synced: 3 months ago
JSON representation
Builder and parser for fonts
- Host: GitHub
- URL: https://github.com/bodoni/font
- Owner: bodoni
- License: other
- Created: 2015-08-13T12:41:53.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T09:06:04.000Z (6 months ago)
- Last Synced: 2024-05-23T09:31:11.467Z (6 months ago)
- Topics: font, opentype, parsing, typeface, typography
- Language: Rust
- Homepage:
- Size: 8.56 MB
- Stars: 28
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-typography - Font toolbox
README
# Font [![Package][package-img]][package-url] [![Documentation][documentation-img]][documentation-url] [![Build][build-img]][build-url]
The package provides a builder and parser for fonts.
## [Example]
```rust
use font::glyph::Segment;
use font::File;macro_rules! ok(($result:expr) => ($result.unwrap()));
let path = "SourceSerifPro-Regular.otf";
let File { mut fonts } = ok!(File::open(path));
let glyph = ok!(ok!(fonts[0].glyph('a')));
for contour in glyph.iter() {
for segment in contour.iter() {
match segment {
&Segment::Linear(..) => { /* … */ },
&Segment::Quadratic(..) => { /* … */ },
&Segment::Cubic(..) => { /* … */ },
}
}
}
```## Contribution
Your contribution is highly appreciated. Do not hesitate to open an issue or a
pull request. Note that any contribution submitted for inclusion in the project
will be licensed according to the terms given in [LICENSE.md](LICENSE.md).[build-img]: https://github.com/bodoni/font/workflows/build/badge.svg
[build-url]: https://github.com/bodoni/font/actions/workflows/build.yml
[documentation-img]: https://docs.rs/font/badge.svg
[documentation-url]: https://docs.rs/font
[package-img]: https://img.shields.io/crates/v/font.svg
[package-url]: https://crates.io/crates/font[example]: https://github.com/bodoni/founder/blob/main/src/drawing.rs