opentype 0.2.0

The package provides a parser for OpenType fonts.
docs.rs failed to build opentype-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: opentype-0.35.2

OpenType Version Status

The package provides a parser for OpenType fonts.

Documentation

Example

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

assert_eq!(font.font_header.unitsPerEm, 1000);
assert_eq!(font.horizontal_header.Ascender, 918);

let strings = match font.naming_table {
    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.