font

Crates.iofont
lib.rsfont
version0.39.1
sourcesrc
created_at2015-08-13 12:42:20.290401
updated_at2024-10-20 08:53:18.090624
descriptionThe package provides a builder and parser of fonts.
homepagehttps://github.com/bodoni/font
repositoryhttps://github.com/bodoni/font
max_upload_size
id2829
size220,608
Owners (github:buoyantio:owners)

documentation

https://docs.rs/font

README

Font Package Documentation Build

The package provides a builder and parser for fonts.

Example

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.

Commit count: 500

cargo fmt