opentype 0.6.0

The package provides a parser for OpenType fonts.
Documentation

OpenType Version Status

The package provides a parser for OpenType fonts.

Documentation

Example

extern crate opentype;

use opentype::File;
use opentype::truetype::NamingTable;

let path = "SourceSerifPro-Regular.otf";
let font = Font::open(path).unwrap();

assert_eq!(file.font_header.as_ref().unwrap().unitsPerEm, 1000);
assert_eq!(file.horizontal_header.as_ref().unwrap().ascender, 918);
let strings = match file.naming_table {
    Some(NamingTable::Format0(ref table)) => table.strings().unwrap(),
    _ => unreachable!(),
};
assert_eq!(&strings[1], "Source Serif Pro");
assert_eq!(&strings[9], "Frank Grießhammer");

Contributing

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