OpenType Version Status

The package provides a parser for OpenType fonts.

Documentation

Example

```rust use opentype::Font; use opentype::table::NamingTable; use std::fs::File;

let path = "SourceSerifPro-Regular.otf"; let mut file = File::open(path).unwrap(); let font = Font::read(&mut file).unwrap();

match font.fontheader { Some(ref table) => asserteq!(table.unitsPerEm, 1000), _ => unreachable!(), } match font.horizontalheader { Some(ref table) => asserteq!(table.Ascender, 918), _ => unreachable!(), } match font.namingtable { Some(NamingTable::Format0(ref table)) => { let strings = table.strings().unwrap(); asserteq!(&strings[1], "Source Serif Pro"); assert_eq!(&strings[9], "Frank Grießhammer"); }, _ => unreachable!(), } ```

Contributing

  1. Fork the project.
  2. Implement your idea.
  3. Open a pull request.