Subsetting
Subsetting takes the text rather than glyph ids, so it shapes first and keeps what shaping produced.
let subset = font.subset_text("Type is the voice of the page.", &[])?;
std::fs::write("subset.ttf", &subset.ttf)?;
// 879,708 bytes to 19,988The result carries a real cmap, so it loads straight into @font-face.Font::subset takes glyph ids instead when you already know them, andsubset.gid_map tells you where each one landed.