Crate font

source ·
Expand description

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].draw('a')));
for contour in glyph.iter() {
    for segment in contour.iter() {
        match segment {
            &Segment::Linear(..) => { /* … */ },
            &Segment::Quadratic(..) => { /* … */ },
            &Segment::Cubic(..) => { /* … */ },
        }
    }
}

Re-exports§

Modules§

Structs§

Type Aliases§