1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
//! Parser for fonts.
//!
//! # Example
//!
//! ```
//! use font::glyph::Segment;
//! use font::File;
//!
//! macro_rules! ok(($result:expr) => ($result.unwrap()));
//!
//! let path = "SourceSerifPro-Regular.otf";
//! # let path = "tests/fixtures/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(..) => { /* … */ },
//! }
//! }
//! }
//! ```
pub extern crate opentype;
pub extern crate webtype;
#[macro_use(dereference, error, raise)]
extern crate typeface;
pub mod glyph;
mod file;
mod font;
mod formats;
mod metrics;
mod offset;
pub use self::font::Font;
pub use file::File;
pub use formats::opentype::axes::{self, Axes};
pub use formats::opentype::characters::Characters;
pub use formats::opentype::features::{self, Features};
pub use formats::opentype::names::Names;
pub use formats::opentype::tables::Tables;
pub use glyph::Glyph;
pub use metrics::Metrics;
pub use offset::Offset;
/// A number.
pub type Number = f32;