Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View 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