Skip to main content

check_font

Function check_font 

Source
pub fn check_font(bytes: &[u8], face_index: u32) -> Result<(), TextRasterError>
Expand description

Checks that bytes hold an OpenType face at face_index, as adding the font to a rasterizer checks it, without keeping anything: a host can refuse a file at import that the rasterizer would refuse later.

§Errors

Returns TextRasterError::InvalidFont with the parser’s reason (a WOFF or WOFF2 container’s unknown magic, say).