Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
65
third-party/vendor/ttf-parser-0.15.2/tests/tables/maxp.rs
vendored
Normal file
65
third-party/vendor/ttf-parser-0.15.2/tests/tables/maxp.rs
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
use std::num::NonZeroU16;
|
||||
use ttf_parser::maxp::Table;
|
||||
use crate::{convert, Unit::*};
|
||||
|
||||
#[test]
|
||||
fn version_05() {
|
||||
let table = Table::parse(&convert(&[
|
||||
Fixed(0.3125), // version
|
||||
UInt16(1), // number of glyphs
|
||||
])).unwrap();
|
||||
assert_eq!(table.number_of_glyphs, NonZeroU16::new(1).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn version_1_full() {
|
||||
let table = Table::parse(&convert(&[
|
||||
Fixed(1.0), // version
|
||||
UInt16(1), // number of glyphs
|
||||
UInt16(0), // maximum points in a non-composite glyph
|
||||
UInt16(0), // maximum contours in a non-composite glyph
|
||||
UInt16(0), // maximum points in a composite glyph
|
||||
UInt16(0), // maximum contours in a composite glyph
|
||||
UInt16(0), // maximum zones
|
||||
UInt16(0), // maximum twilight points
|
||||
UInt16(0), // number of Storage Area locations
|
||||
UInt16(0), // number of FDEFs
|
||||
UInt16(0), // number of IDEFs
|
||||
UInt16(0), // maximum stack depth
|
||||
UInt16(0), // maximum byte count for glyph instructions
|
||||
UInt16(0), // maximum number of components
|
||||
UInt16(0), // maximum levels of recursion
|
||||
])).unwrap();
|
||||
assert_eq!(table.number_of_glyphs, NonZeroU16::new(1).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn version_1_trimmed() {
|
||||
// We don't really care about the data after the number of glyphs.
|
||||
let table = Table::parse(&convert(&[
|
||||
Fixed(1.0), // version
|
||||
UInt16(1), // number of glyphs
|
||||
])).unwrap();
|
||||
assert_eq!(table.number_of_glyphs, NonZeroU16::new(1).unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unknown_version() {
|
||||
let table = Table::parse(&convert(&[
|
||||
Fixed(0.0), // version
|
||||
UInt16(1), // number of glyphs
|
||||
]));
|
||||
assert!(table.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn zero_glyphs() {
|
||||
let table = Table::parse(&convert(&[
|
||||
Fixed(0.3125), // version
|
||||
UInt16(0), // number of glyphs
|
||||
]));
|
||||
assert!(table.is_none());
|
||||
}
|
||||
|
||||
// TODO: what to do when the number of glyphs is 0xFFFF?
|
||||
// we're actually checking this in loca
|
||||
Loading…
Add table
Add a link
Reference in a new issue