M7: warn when a FIGCRAFT_WEB_FONTS family isn't embedded

A misspelt family name (or a CJK one without FIGCRAFT_EMBED_CJK) used to
embed nothing without a word, and the web build then drew that script
as missing-glyph boxes. With craft-fonts present, each named family that
no manifest entry embedded now gets a cargo warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Salah1StandClaude Opus 5.5 committed 2026-10-24 12:47:16 +07:00
1 parent 6b46a9c81a
commit a7bb249813
1 file changed
+6
+6
View File
@@ -29,6 +29,12 @@ fn main() {
if !ok {
println!("cargo::warning=building without craft-fonts (once it is there, `cargo clean -p figcraft-text` makes the next build use it)");
}
// A family named in FIGCRAFT_WEB_FONTS that nothing embedded is most likely misspelt.
for name in std::env::var("FIGCRAFT_WEB_FONTS").unwrap_or_default().split(',').map(str::trim).filter(|n| ok && !n.is_empty()) {
if !src.contains(&format!("family: {name:?},")) {
println!("cargo::warning=FIGCRAFT_WEB_FONTS: no craft-fonts manifest family {name:?} was embedded");
}
}
}
src.push_str("];\n");
let out = PathBuf::from(std::env::var_os("OUT_DIR").unwrap_or_default()).join("craft_fonts.rs");