mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-09 03:48:56 +00:00
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:
co-authored by
Claude Opus 5.5
parent
6b46a9c81a
commit
a7bb249813
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user