T1: bundle IBM Plex Mono as the code font, italic comments (D28)

Daniel chose IBM Plex Mono from Amy's comparison of four free fonts. It
ships from @fontsource (Latin and Latin Extended, 400/700 with italics)
and leads font-mono for the editor and the terminal; the UI keeps the
system font. OFL-1.1 is allowed for this one package only
(PACKAGE_EXCEPTIONS in xtask/src/licences.rs, comment in deny.toml).
NOTICE, ASSETS.md and docs/themes.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-06 19:16:10 +01:00
parent d81c943905
commit f2a1ef12cd
13 changed files with 70 additions and 17 deletions

View file

@ -21,6 +21,12 @@ pub const ALLOWED: &[&str] = &[
"Unicode-3.0",
];
/// Package-scoped exceptions: a package and the one extra licence it may
/// carry, each approved by the owner. They do not widen [`ALLOWED`] for any
/// other package. `@fontsource/ibm-plex-mono` is Lutra's bundled code font
/// under the SIL Open Font License 1.1 (owner decision D28, 2026-11-06).
pub const PACKAGE_EXCEPTIONS: &[(&str, &str)] = &[("@fontsource/ibm-plex-mono", "OFL-1.1")];
/// Runs the check on the production dependencies of `ui/`.
///
/// # Errors
@ -61,6 +67,9 @@ pub fn check_pnpm_report(json: &str) -> TaskResult<Vec<String>> {
}
for package in packages.as_array().into_iter().flatten() {
let name = package.get("name").and_then(Value::as_str).unwrap_or("?");
if PACKAGE_EXCEPTIONS.contains(&(name, licence.as_str())) {
continue;
}
problems.push(format!("{name}: {licence}"));
}
}
@ -102,4 +111,19 @@ mod tests {
vec!["bad: GPL-3.0".to_string()]
);
}
#[test]
fn the_font_exception_covers_only_its_package_and_licence() {
let json = r#"{"OFL-1.1":[{"name":"@fontsource/ibm-plex-mono"},{"name":"@fontsource/other"}],"GPL-3.0":[{"name":"@fontsource/ibm-plex-mono"}]}"#;
let mut problems = check_pnpm_report(json).unwrap();
problems.sort();
assert_eq!(
problems,
vec![
"@fontsource/ibm-plex-mono: GPL-3.0".to_string(),
"@fontsource/other: OFL-1.1".to_string()
]
);
assert!(!is_allowed("OFL-1.1"));
}
}