Expand description
Parser for fonts in Web Open Font Format.
§Example
use webtype::opentype::truetype::tables::FontHeader;
use webtype::File;
macro_rules! ok(($result:expr) => ($result.unwrap()));
let path = "NotoNaskhArabic-Regular.woff2";
let mut tape = ok!(std::fs::File::open(path));
let File { mut fonts, mut tape } = ok!(File::read(&mut tape));
let font_header = ok!(ok!(fonts[0].take::<_, FontHeader>(&mut tape)));
assert_eq!(font_header.units_per_em, 2048);
Re-exports§
pub extern crate opentype;
Modules§
- Types that can read and write.
- Types that can be read and written.
- The Web Open Font Format of version 1.0.
- The Web Open Font Format of version 2.0.
- Types that can be read and written given a parameter.
Structs§
- A file.
- A font.
- A four-byte unsigned integer with a variable-length encoding.
Functions§
- Check if a tag is recognized.
Type Aliases§
- An error.
- A result.