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();

asserteq!(font.fontheader.unitsPerEm, 1000); asserteq!(font.horizontalheader.Ascender, 918);

let strings = match font.naming_table { NamingTable::Format0(ref table) => table.strings().unwrap(), _ => unreachable!(), };

asserteq!(&strings[1], "Source Serif Pro"); asserteq!(&strings[9], "Frank Grießhammer"); ```

Contributing

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