PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
M14: Fix(nixos): discover installed UI fallback fonts on NixOS (#1553)
tomasmark79ac69c29823e7
diff --git a/Cargo.lock b/Cargo.lockindex 49e949bff..5dcaf7b1b 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -2088,6 +2088,15 @@ dependencies = ["serde",]+[[package]]+name = "fontconfig-parser"+version = "0.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbc773e24e02d4ddd8395fd30dc147524273a83e54e0f312d986ea30de5f5646"+dependencies = [+ "roxmltree",+]+[[package]]name = "foreign-types"version = "0.5.0"@@ -4347,6 +4356,7 @@ dependencies = ["egui","egui_extras","egui_kittest",+ "fontconfig-parser","getrandom 0.4.3","image","js-sys",diff --git a/ROADMAP.md b/ROADMAP.mdindex c2cd0f881..efa6dc770 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -164,6 +164,8 @@ Ranked; detail and the full milestone table in [docs/roadmap.md](docs/roadmap.md- **2026-10-15 (M14, gap 24):** `misc.localization` and `misc.installers` move from planned to partial. Localization: 22 catalogs ship, but Chinese shows tofu in releases, Telugu has no release font and Arabic is not mirrored. Installers: macOS and Windows releases are signed, Linux packages are not. The Acrobat menu diff itself remains open. Estimates unchanged.- **2026-10-13 (G14, Vietnamese localization):** Added Vietnamese (`vi`, Tiếng Việt) as an interface and date language with a 2,591-entry catalog (`plural_none`) covering 100% of the current localizable key union (plus `theme`/`Appearance`). Locale tags `vi` / `vi-VN` / `vi_VN.UTF-8` resolve; calendar months use numeric `Tháng 1`…`12` / `tháng 1`…`12`. Native-speaker community review recorded. The twelve-language localization mean moves from ≈59% to ≈68%; weighted readiness ≈49% → ≈50%. Status stays `partial`: engine/OS details, document contents, filenames, CLI/MCP and external help stay outside the catalog by design.+- **2026-10-13 (community, M14, #1553 review):** Relative Fontconfig includes resolve beside each including config, including nested configuration selected through `FONTCONFIG_PATH`. Directory includes accept only digit-prefixed `*.conf` in lexical order. Isolated regressions reproduce both review findings; configuration size/count/depth limits, cycles, symlinked config and valid reset ordering are covered. Estimates unchanged.+- **2026-10-12 (community, M14, NixOS UI fonts):** Linux/Unix interface fallback fonts are also discovered in Fontconfig's configured directories, including Nix store and user font paths. Existing candidate names, glyph checks, size limits and the screenshot opt-out are retained. Synthetic regressions cover included configuration, symlinks, cycles, depth limits and candidate ordering. Estimates unchanged.- **2026-10-12 (M7, local text-box candidate):** Add Text opens source text for editing and both text tools retype added items on one click. Draft boxes grow toward the page edge and downwards, with the grown width saved. Single visual rows grow across style boundaries, while multi-row paragraph widths stay fixed. Added-text previews remove only the selected item on a clone, with UI and read-only tool regressions. Arabic shaping, ordering and alignment are outside this candidate. Estimates unchanged.- **2026-10-12 (M14, #1395):** XDG desktops use the configuration base for app.ron, safely copying existing preferences without overwriting a destination. Original preferences, logs, recovery and digital IDs are retained; failed migration falls back to the original location. Portable and non-XDG locations remain unchanged; estimates unchanged.diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.tomlindex ddab6a223..aa9fe54f6 100644--- a/crates/ui-egui/Cargo.toml+++ b/crates/ui-egui/Cargo.toml@@ -45,6 +45,10 @@ arboard = { version = "3.6", default-features = false, features = ["image-data"]# Waits for native file pickers off the UI thread (already in the tree through wgpu).pollster = "1.0"+[target.'cfg(all(unix, not(target_os = "macos"), not(target_arch = "wasm32")))'.dependencies]+# Discover configured font directories without linking libfontconfig or running a subprocess.+fontconfig-parser = "0.5.8"+[target.'cfg(target_os = "macos")'.dependencies]# Where the pointer is while files are dragged over the window (winit doesn't say): safe AppKit# calls only. All three are already in the tree through arboard and rfd.diff --git a/crates/ui-egui/src/system_fonts.rs b/crates/ui-egui/src/system_fonts.rsindex e64533ee1..606fa923d 100644--- a/crates/ui-egui/src/system_fonts.rs+++ b/crates/ui-egui/src/system_fonts.rs@@ -13,6 +13,9 @@ use std::sync::{Arc, OnceLock};use egui::FontData;+#[cfg(all(unix, not(target_os = "macos"), not(target_arch = "wasm32")))]+mod fontconfig;+/// Larger files are not read: a font path is still untrusted input.const MAX_BYTES: u64 = 32 << 20;/// Chinese system faces are big collections (PingFang, STHeiti), so they get a higher cap.@@ -291,7 +294,37 @@ fn windows_fonts() -> PathBuf {}fn unix_fonts(files: &'static [&'static str]) -> Vec<PathBuf> {- ["/usr/share/fonts", "/usr/local/share/fonts"].iter().flat_map(|dir| files.iter().map(move |f| Path::new(dir).join(f))).collect()+ #[cfg(all(unix, not(target_os = "macos"), not(target_arch = "wasm32")))]+ static INSTALLED: OnceLock<Vec<PathBuf>> = OnceLock::new();+ #[cfg(all(unix, not(target_os = "macos"), not(target_arch = "wasm32")))]+ // Read once per process, and not at all when installed fonts are turned off.+ let installed = INSTALLED+ .get_or_init(|| {+ if std::env::var_os("PDFCRAFT_SYSTEM_FONTS").is_some_and(|v| v == "0") {+ return Vec::new();+ }+ fontconfig::font_files(&fontconfig::config_path())+ })+ .as_slice();+ #[cfg(not(all(unix, not(target_os = "macos"), not(target_arch = "wasm32"))))]+ let installed: &[PathBuf] = &[];+ unix_candidates(files, installed)+}++fn unix_candidates(files: &[&str], installed: &[PathBuf]) -> Vec<PathBuf> {+ let mut paths: Vec<_> =+ ["/usr/share/fonts", "/usr/local/share/fonts"].iter().flat_map(|dir| files.iter().map(move |f| Path::new(dir).join(f))).collect();+ // Fontconfig may point into /nix/store or a user's font directory. Keep the existing+ // candidate names and their preference order; this does not select arbitrary fonts.+ for file in files {+ let name = Path::new(file).file_name();+ for path in installed.iter().filter(|p| p.file_name() == name) {+ if !paths.contains(path) {+ paths.push(path.clone());+ }+ }+ }+ paths}fn read(path: &Path, probe: char, max: u64) -> Option<Arc<FontData>> {@@ -318,6 +351,17 @@ fn face_with(bytes: &[u8], c: char) -> Option<u32> {mod tests {use super::*;+ #[test]+ fn configured_candidates_preserve_names_order_and_existing_paths() {+ let names = ["noto/NotoSansArabic-Regular.ttf", "truetype/dejavu/DejaVuSans.ttf"];+ let noto = PathBuf::from("/custom/fonts/NotoSansArabic-Regular.ttf");+ let dejavu = PathBuf::from("/nix/store/font/share/fonts/truetype/DejaVuSans.ttf");+ let installed = [dejavu.clone(), PathBuf::from("/custom/fonts/SourceHanSans.ttf"), noto.clone(), dejavu.clone()];+ let mut expected = unix_candidates(&names, &[]);+ expected.extend([noto, dejavu]);+ assert_eq!(unix_candidates(&names, &installed), expected);+ }+#[test]fn broken_and_missing_files_are_skipped() {assert_eq!(face_with(b"", PROBE), None);diff --git a/crates/ui-egui/src/system_fonts/fontconfig.rs b/crates/ui-egui/src/system_fonts/fontconfig.rsnew file mode 100644index 000000000..dbec74eae--- /dev/null+++ b/crates/ui-egui/src/system_fonts/fontconfig.rs@@ -0,0 +1,329 @@+//! Discover font files in configured directories, including Nix store paths.+//!+//! Only the existing fallback filenames are selected by the caller. Font bytes are still+//! checked for size and glyph coverage there; no font is copied or embedded.++use std::collections::HashSet;+use std::io::Read as _;+use std::path::{Path, PathBuf};++// A configured directory may contain unrelated files or symlink cycles. Bound the walk.+const MAX_ENTRIES: usize = 32_768;+const MAX_DEPTH: usize = 16;+const MAX_CONFIGS: usize = 256;+const MAX_CONFIG_BYTES: u64 = 1024 * 1024;++#[derive(Default)]+struct Directories {+ dirs: Vec<PathBuf>,+ seen: HashSet<PathBuf>,+ entries: usize,+}++impl Directories {+ fn include(&mut self, path: &Path, depth: usize) {+ if depth > MAX_DEPTH || self.seen.len() >= MAX_CONFIGS {+ return;+ }+ let Ok(canonical) = path.canonicalize() else { return };+ if self.seen.contains(&canonical) {+ return;+ }+ if canonical.is_dir() {+ self.seen.insert(canonical);+ let Ok(entries) = std::fs::read_dir(path) else { return };+ let mut configs = Vec::new();+ for entry in entries {+ if self.entries >= MAX_ENTRIES {+ break;+ }+ self.entries += 1;+ let Ok(entry) = entry else { continue };+ // Fontconfig directory includes accept digit-prefixed *.conf only.+ let name = entry.file_name();+ let Some(name) = name.to_str() else { continue };+ if name.as_bytes().first().is_some_and(u8::is_ascii_digit) && name.ends_with(".conf") && entry.path().is_file() {+ configs.push(entry.path());+ }+ }+ configs.sort();+ for config in configs {+ self.include(&config, depth + 1);+ }+ return;+ }+ if !canonical.is_file() {+ return;+ }+ self.seen.insert(canonical);+ let Ok(file) = std::fs::File::open(path) else { return };+ let mut bytes = Vec::new();+ if file.take(MAX_CONFIG_BYTES + 1).read_to_end(&mut bytes).is_err() || bytes.len() as u64 > MAX_CONFIG_BYTES {+ return;+ }+ let Ok(xml) = String::from_utf8(bytes) else { return };+ let parts = match fontconfig_parser::parse_config_parts(&xml) {+ Ok(parts) => parts,+ Err(error) => {+ log::debug!("interface font directories: {}: {error}", path.display());+ return;+ }+ };+ for part in parts {+ use fontconfig_parser::{ConfigPart, DirPrefix};+ match part {+ ConfigPart::Dir(dir) if self.dirs.len() < MAX_ENTRIES => self.dirs.push(dir.calculate_path(path)),+ ConfigPart::ResetDirs => self.dirs.clear(),+ ConfigPart::Include(mut include) => {+ // The dependency's default include prefix hardcodes /etc/fonts.+ // Resolve relative to this file, including nested and FONTCONFIG_PATH configs.+ if include.prefix == DirPrefix::Default {+ include.prefix = DirPrefix::Relative;+ }+ self.include(&include.calculate_path(path), depth + 1);+ }+ _ => {}+ }+ }+ }+}++pub(super) fn config_path() -> PathBuf {+ let file = std::env::var_os("FONTCONFIG_FILE").map_or_else(|| PathBuf::from("fonts.conf"), PathBuf::from);+ if file.is_absolute() {+ return file;+ }+ let dir =+ std::env::var_os("FONTCONFIG_PATH").and_then(|paths| std::env::split_paths(&paths).next()).unwrap_or_else(|| PathBuf::from("/etc/fonts"));+ dir.join(file)+}++pub(super) fn font_files(config_path: &Path) -> Vec<PathBuf> {+ // Use the dependency's XML parser, but own include resolution and directory filtering.+ // Missing or malformed configuration must not prevent the ordinary fallback paths.+ let mut config = Directories::default();+ config.include(config_path, 0);+ let mut pending: Vec<_> = config.dirs.into_iter().map(|dir| (dir, 0)).collect();+ let mut seen = HashSet::new();+ let mut files = Vec::new();+ let mut remaining = MAX_ENTRIES;+ while let Some((dir, depth)) = pending.pop() {+ let Ok(canonical) = dir.canonicalize() else { continue };+ if !seen.insert(canonical) {+ continue;+ }+ let Ok(entries) = std::fs::read_dir(&dir) else { continue };+ for entry in entries {+ if remaining == 0 {+ files.sort();+ return files;+ }+ remaining -= 1;+ let Ok(entry) = entry else { continue };+ let path = entry.path();+ // Follow links to fonts and directories, but visit each directory only once.+ if path.is_dir() {+ if depth < MAX_DEPTH {+ pending.push((path, depth + 1));+ }+ } else if path.extension().is_some_and(|ext| ext == "ttf" || ext == "ttc") && path.is_file() {+ files.push(path);+ }+ }+ }+ files.sort();+ files+}++#[cfg(test)]+mod tests {+ use super::*;++ // Fixtures contain only configuration and dummy files, never copied system fonts.+ struct Fixture(PathBuf);++ impl Fixture {+ fn new() -> Self {+ static NEXT: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);+ let n = NEXT.fetch_add(1, std::sync::atomic::Ordering::Relaxed);+ let dir = std::env::temp_dir().join(format!("pdfcraft-fontconfig-{}-{n}", std::process::id()));+ std::fs::create_dir(&dir).unwrap();+ Self(dir)+ }++ fn config(&self, name: &str, body: &str) -> PathBuf {+ let path = self.0.join(name);+ std::fs::write(&path, format!("<fontconfig>{body}</fontconfig>")).unwrap();+ path+ }++ fn isolated(&self, test: &str) {+ // Environment selection is process-global: never mutate it in a parallel harness.+ let output = std::process::Command::new(std::env::current_exe().unwrap())+ .args(["--exact", &format!("system_fonts::fontconfig::tests::{test}"), "--nocapture"])+ .env("FONTCONFIG_PATH", &self.0)+ .env("FONTCONFIG_FILE", "fonts.conf")+ .env("PDFCRAFT_FONTCONFIG_TEST_ROOT", &self.0)+ .output()+ .unwrap();+ assert!(output.status.success(), "{}\n{}", String::from_utf8_lossy(&output.stdout), String::from_utf8_lossy(&output.stderr));+ assert!(String::from_utf8_lossy(&output.stdout).contains("1 passed"));+ }++ fn font(&self) -> PathBuf {+ let dir = self.0.join("fonts");+ std::fs::create_dir(&dir).unwrap();+ let font = dir.join("DejaVuSans.ttf");+ std::fs::write(&font, b"dummy font for directory discovery").unwrap();+ font+ }+ }++ impl Drop for Fixture {+ fn drop(&mut self) {+ let _ = std::fs::remove_dir_all(&self.0);+ }+ }++ #[test]+ fn relative_includes_follow_each_including_config_under_fontconfig_path() {+ if let Some(root) = std::env::var_os("PDFCRAFT_FONTCONFIG_TEST_ROOT") {+ let root = PathBuf::from(root);+ assert_eq!(config_path(), root.join("fonts.conf"));+ assert_eq!(font_files(&config_path()), vec![root.join("fonts/DejaVuSans.ttf")]);+ return;+ }+ let fixture = Fixture::new();+ fixture.font();+ std::fs::create_dir(fixture.0.join("conf.d")).unwrap();+ std::fs::create_dir(fixture.0.join("nested")).unwrap();+ fixture.config("fonts.conf", "<include>conf.d</include>");+ fixture.config("conf.d/10-fonts.conf", "<include>../nested/next.conf</include>");+ fixture.config("nested/next.conf", &format!("<dir>{}</dir>", fixture.0.join("fonts").display()));+ fixture.isolated("relative_includes_follow_each_including_config_under_fontconfig_path");+ }++ #[test]+ fn included_directories_ignore_disabled_backup_and_non_numbered_files() {+ if let Some(root) = std::env::var_os("PDFCRAFT_FONTCONFIG_TEST_ROOT") {+ let root = PathBuf::from(root);+ assert_eq!(font_files(&config_path()), vec![root.join("fonts/DejaVuSans.ttf")]);+ return;+ }+ for name in ["99-reset.conf.disabled", "99-reset.conf.bak", "reset.conf"] {+ let fixture = Fixture::new();+ fixture.font();+ std::fs::create_dir(fixture.0.join("conf.d")).unwrap();+ fixture.config("fonts.conf", &format!("<include>{}</include>", fixture.0.join("conf.d").display()));+ fixture.config("conf.d/10-fonts.conf", &format!("<dir>{}</dir>", fixture.0.join("fonts").display()));+ fixture.config(&format!("conf.d/{name}"), "<reset-dirs/>");+ fixture.isolated("included_directories_ignore_disabled_backup_and_non_numbered_files");+ }+ }++ #[test]+ fn numbered_configs_keep_lexical_reset_order_and_include_cycles_terminate() {+ let fixture = Fixture::new();+ let font = fixture.font();+ std::fs::create_dir(fixture.0.join("conf.d")).unwrap();+ let config = fixture.config("fonts.conf", "<include>conf.d</include>");+ fixture.config("conf.d/10-reset.conf", "<reset-dirs/>");+ let external = fixture.config("external.conf", &format!("<dir>{}</dir><include>../fonts.conf</include>", fixture.0.join("fonts").display()));+ std::os::unix::fs::symlink(external, fixture.0.join("conf.d/20-fonts.conf")).unwrap();+ assert_eq!(font_files(&config), vec![font]);+ fixture.config("conf.d/30-reset.conf", "<reset-dirs/>");+ assert!(font_files(&config).is_empty());+ }++ #[test]+ fn oversized_configs_are_skipped_without_losing_other_includes() {+ let fixture = Fixture::new();+ let font = fixture.font();+ std::fs::create_dir(fixture.0.join("conf.d")).unwrap();+ let config = fixture.config("fonts.conf", "<include>conf.d</include>");+ std::fs::write(fixture.0.join("conf.d/10-large.conf"), vec![b' '; (MAX_CONFIG_BYTES + 1) as usize]).unwrap();+ fixture.config("conf.d/20-fonts.conf", &format!("<dir>{}</dir>", fixture.0.join("fonts").display()));+ assert_eq!(font_files(&config), vec![font]);+ }++ #[test]+ fn deep_include_chains_are_bounded() {+ let fixture = Fixture::new();+ fixture.font();+ for depth in 0..=MAX_DEPTH + 1 {+ let body = if depth > MAX_DEPTH {+ format!("<dir>{}</dir>", fixture.0.join("fonts").display())+ } else {+ format!("<include>depth-{}.conf</include>", depth + 1)+ };+ fixture.config(&format!("depth-{depth}.conf"), &body);+ }+ assert!(font_files(&fixture.0.join("depth-0.conf")).is_empty());+ }++ #[test]+ fn wide_include_directories_are_bounded() {+ let fixture = Fixture::new();+ fixture.font();+ std::fs::create_dir(fixture.0.join("conf.d")).unwrap();+ let config = fixture.config("fonts.conf", "<include>conf.d</include>");+ for n in 0..MAX_CONFIGS {+ fixture.config(&format!("conf.d/{n:04}-empty.conf"), "");+ }+ fixture.config("conf.d/9999-fonts.conf", &format!("<dir>{}</dir>", fixture.0.join("fonts").display()));+ assert!(font_files(&config).is_empty());+ }++ #[test]+ fn included_configuration_finds_fonts_outside_standard_directories() {+ let fixture = Fixture::new();+ let fonts = fixture.0.join("nix-store-font/share/fonts/truetype");+ std::fs::create_dir_all(&fonts).unwrap();+ let font = fonts.join("DejaVuSans.ttf");+ std::fs::write(&font, b"not parsed during discovery").unwrap();+ std::fs::write(fonts.join("README.txt"), b"not a font").unwrap();+ let included = fixture.config("nixos.conf", &format!("<dir>{}</dir>", fixture.0.join("nix-store-font").display()));+ let config = fixture.config("fonts.conf", &format!("<include>{}</include>", included.display()));+ assert_eq!(font_files(&config), vec![font]);+ }++ #[test]+ fn missing_and_malformed_configuration_are_skipped() {+ let fixture = Fixture::new();+ assert!(font_files(&fixture.0.join("missing.conf")).is_empty());+ let path = fixture.0.join("broken.conf");+ std::fs::write(&path, "<fontconfig><dir>").unwrap();+ assert!(font_files(&path).is_empty());+ }++ #[test]+ fn symlinked_fonts_are_found_and_directory_cycles_terminate() {+ let fixture = Fixture::new();+ let fonts = fixture.0.join("fonts");+ std::fs::create_dir(&fonts).unwrap();+ let original = fixture.0.join("original.ttf");+ std::fs::write(&original, b"dummy").unwrap();+ let linked = fonts.join("DejaVuSans.ttf");+ std::os::unix::fs::symlink(&original, &linked).unwrap();+ std::os::unix::fs::symlink(&fonts, fonts.join("loop")).unwrap();+ std::os::unix::fs::symlink(fixture.0.join("missing.ttf"), fonts.join("broken.ttf")).unwrap();+ let config = fixture.config("fonts.conf", &format!("<dir>{}</dir><dir>{}</dir>", fonts.display(), fonts.display()));+ assert_eq!(font_files(&config), vec![linked]);+ }++ #[test]+ fn deeply_nested_directories_are_bounded() {+ let fixture = Fixture::new();+ let mut dir = fixture.0.join("fonts");+ std::fs::create_dir(&dir).unwrap();+ let shallow = dir.join("DejaVuSans.ttf");+ std::fs::write(&shallow, b"dummy").unwrap();+ for _ in 0..MAX_DEPTH + 1 {+ dir.push("nested");+ std::fs::create_dir(&dir).unwrap();+ }+ std::fs::write(dir.join("DejaVuSans.ttf"), b"dummy").unwrap();+ let config = fixture.config("fonts.conf", &format!("<dir>{}</dir>", fixture.0.join("fonts").display()));+ assert_eq!(font_files(&config), vec![shallow]);+ }+}diff --git a/docs/development.md b/docs/development.mdindex 1d5bb8095..e599effc7 100644--- a/docs/development.md+++ b/docs/development.md@@ -133,3 +133,17 @@ copies retain their current preferences locations.| `PDFCRAFT_BUILD_LABEL` | Build time: a label for a local or patched build (letters, digits, inner dots), shown after the version in `--version`, About and the log (`0.7.1 (titlebar)`). `packaging/linux/package.sh` also puts it in the file names and the .rpm/.deb release (`1.titlebar`), which upgrades over the release of the same version || `CRAFT_FONTS_DIR` | Build time: a [craft-fonts](https://github.com/storytold/craft-fonts) checkout to embed (Japanese fonts) || `PDFCRAFT_SYSTEM_FONTS` | `0` stops the desktop app from using an installed font for characters its embedded fonts lack (`cargo xtask screenshots` sets it) |+| `FONTCONFIG_FILE` | On Linux/Unix, the Fontconfig configuration file used to discover installed UI fallback fonts (default: `/etc/fonts/fonts.conf`); relative filenames are resolved under `FONTCONFIG_PATH` |+| `FONTCONFIG_PATH` | Directory for a relative `FONTCONFIG_FILE` (default: `/etc/fonts`; the first entry of a search path is used) |++On Linux/Unix, the UI's existing fallback filenames are also searched in Fontconfig's configured+directories and their subdirectories. This finds fonts in Nix store paths and user font directories+without invoking `fc-match` or linking libfontconfig. The scan is cached and bounded; missing or+malformed configuration leaves the ordinary `/usr/share/fonts` and `/usr/local/share/fonts`+candidates available. Font size and glyph-coverage checks still apply. This only reads installed+fonts for the interface; it does not embed them into PDFs or packages.++Relative includes resolve beside the config that contains them. Included directories load only+digit-prefixed `*.conf` files, in lexical order; backups and disabled files are ignored. The scan+limits each config to 1 MiB, visits at most 256 config files/directories, and bounds include depth+to 16 and directory entries to 32,768. Cyclic includes are skipped.diff --git a/docs/roadmap.md b/docs/roadmap.mdindex e6a5ce039..e570c1ae1 100644--- a/docs/roadmap.md+++ b/docs/roadmap.md@@ -132,6 +132,7 @@ total matches the parity estimate.| M13 | Automation (MCP, Action Wizard, CLI) + AI providers | 60–120 | 45% | 25–45 | Done: MCP resources (document info, text, page images); headless tool table (123 tools incl. signing, optimizing, initial view, links, stamps, data exchange, comment review, forms authoring and scripts, redaction, sanitize, print, add content), opt-in MCP server over stdio, CLI `run`/`tools` (closed stdout pipes exit cleanly), UI control channel with drag. Missing: Action Wizard, AI providers<br>Done since: CLI run and MCP reject missing, empty, repeated and option-valued --root arguments before any tool/script execution or MCP initialization. A single-hyphen directory name remains valid; synthetic CLI regressions preserve a would-be overwritten file. `text_find` also caps the per-page match ranges it materializes at the remaining result limit plus one continuation match. CLI robustness scans visit each directory once through overlapping roots and symlink aliases. || M12 | Accessibility, compare, measure, search, XFA | 200–380 | 30% | 90–160 | Done: new `a11y` crate with the Accessibility Checker (all 32 rules, report, Fix/Skip/Explain, options dialog and results panel, agent tools). Locatable figure, annotation and form findings highlight their page bounds.<br>Done since: 2D distance, perimeter and area measurements with persistent viewport calibration, snapping, live information and CSV export; a bounded text-only auto-tag proposal tool; text-only Apply writes marked content, paragraph tags and a parent tree, then opens the Tags panel for review. Missing: mixed-content and field autotag, heading/list/table/figure classification, Order/Content panels, Reading Order tool, compare, geospatial/3D measurement, search index, XFA || M13 | Automation (MCP, Action Wizard, CLI) + AI providers | 60–120 | 45% | 25–45 | Done: MCP resources (document info, text, page images); headless tool table (123 tools incl. signing, optimizing, initial view, links, stamps, data exchange, comment review, forms authoring and scripts, redaction, sanitize, print, add content), opt-in MCP server over stdio, CLI `run`/`tools` (closed stdout pipes exit cleanly), UI control channel with drag. Missing: Action Wizard, AI providers<br>Done since: CLI run and MCP reject missing, empty, repeated and option-valued --root arguments before any tool/script execution or MCP initialization. A single-hyphen directory name remains valid; synthetic CLI regressions preserve a would-be overwritten file. `text_find` also caps the per-page match ranges it materializes at the remaining result limit plus one continuation match. |+| M14 | 1.0 polish: performance, localization, installers | 120–250 | 15% | 80–150 | Done: PhotoCraft's translation system (`i18n/`: TSV catalogs, `tl!`, command-id and plural entries, system-language detection, strict catalog tests); every dialog, panel and notice goes through `tl!`. Catalogs of ≈ 2,000–2,140 entries for Japanese, Simplified and Traditional Chinese, Russian, Bulgarian, German, Spanish, French, Telugu, Hungarian, Ukrainian, Brazilian Portuguese and Arabic (logical-order catalog put into display order; layout not yet mirrored); Czech covers the menus. Italian has 2,528 entries: every key of the other catalogs that the code looks up. Signed and notarized macOS builds, signed Windows installers (x64, x86, ARM64), AppImage, deb, rpm, Flatpak and FreeBSD packages. #307 (bounded large-PDF memory): shared resource indexes and parser metadata, lazy inspection, bounded caches; a 9,156-page file inspects in ≈ 1.8 s at ≈ 500 MiB instead of exceeding 10 GiB. Edits let go of the previous working file before writing the next (a 1 GiB file peaks at two copies while editing, not three; gap 13). Shortcut display uses localized modifier/key names across menus, toolbar, palette, Help and tooltips (#496). Lithuanian adds a 2,578-entry catalog and date names, reviewed by a native-speaking contributor. Validated candidate (macOS raster probe; Windows runtime unverified): the Windows policy changes only embedded JetBrains Mono; horizontal alpha-edge energy per ink improves 2.78%, 3.87% and 1.59% at 100%, 125% and 150%, and is down 0.79% at 200%. Inter is pixel-identical; layout hashes, glyph coverage and the 8 MiB atlas are unchanged. Timing and RSS ranges overlap, with no improvement claimed. Estimates unchanged. Missing: a right-to-left layout, a Chinese UI face in releases, Hindi/Indonesian/Korean/Vietnamese, file-backed input and global memory budgets, performance budgets, keyboard-only operation Linux/Unix UI fallback fonts also use Fontconfig directories, including Nix store paths, with bounded discovery and the existing candidate allowlist; relative includes and digit-prefixed config filtering have isolated regressions. || M14 | 1.0 polish: performance, localization, installers | 120–250 | 15% | 80–150 | Done: PhotoCraft's translation system (`i18n/`: TSV catalogs, `tl!`, command-id and plural entries, system-language detection, strict catalog tests); every dialog, panel and notice goes through `tl!`. Catalogs of ≈ 2,000–2,140 entries for Japanese, Simplified and Traditional Chinese, Russian, Bulgarian, German, Spanish, French, Telugu, Hungarian, Ukrainian, Brazilian Portuguese and Arabic (logical-order catalog put into display order; layout not yet mirrored); Czech covers the menus. Italian has 2,528 entries: every key of the other catalogs that the code looks up. Signed and notarized macOS builds, signed Windows installers (x64, x86, ARM64), AppImage, deb, rpm, Flatpak and FreeBSD packages. #307 (bounded large-PDF memory): shared resource indexes and parser metadata, lazy inspection, bounded caches; a 9,156-page file inspects in ≈ 1.8 s at ≈ 500 MiB instead of exceeding 10 GiB. Edits let go of the previous working file before writing the next (a 1 GiB file peaks at two copies while editing, not three; gap 13). Shortcut display uses localized modifier/key names across menus, toolbar, palette, Help and tooltips (#496). Lithuanian adds a 2,578-entry catalog and date names, reviewed by a native-speaking contributor. Validated candidate (macOS raster probe; Windows runtime unverified): the Windows policy changes only embedded JetBrains Mono; horizontal alpha-edge energy per ink improves 2.78%, 3.87% and 1.59% at 100%, 125% and 150%, and is down 0.79% at 200%. Inter is pixel-identical; layout hashes, glyph coverage and the 8 MiB atlas are unchanged. Timing and RSS ranges overlap, with no improvement claimed. Estimates unchanged. Missing: a right-to-left layout, a Chinese UI face in releases, Hindi/Indonesian/Korean/Vietnamese, file-backed input and global memory budgets, performance budgets, keyboard-only operation XDG desktops use the configuration base for preferences with non-overwriting migration and original-data preservation (#1395). || M13 | Automation (MCP, Action Wizard, CLI) + AI providers | 60–120 | 45% | 25–45 | Done: MCP resources (document info, text, page images); headless tool table (123 tools incl. signing, optimizing, initial view, links, stamps, data exchange, comment review, forms authoring and scripts, redaction, sanitize, print, add content), opt-in MCP server over stdio, CLI `run`/`tools` (closed stdout pipes exit cleanly), UI control channel with drag. Missing: Action Wizard, AI providers || M14 | 1.0 polish: performance, localization, installers | 120–250 | 15% | 80–150 | Done: PhotoCraft's translation system (`i18n/`: TSV catalogs, `tl!`, command-id and plural entries, system-language detection, strict catalog tests); every dialog, panel and notice goes through `tl!`. Catalogs of ≈ 2,000–2,140 entries for Japanese, Simplified and Traditional Chinese, Russian, Bulgarian, German, Spanish, French, Telugu, Hungarian, Ukrainian, Brazilian Portuguese and Arabic (logical-order catalog put into display order; layout not yet mirrored); Czech covers the menus. Italian has 2,528 entries: every key of the other catalogs that the code looks up. Signed and notarized macOS builds, signed Windows installers (x64, x86, ARM64), AppImage, deb, rpm, Flatpak and FreeBSD packages. #307 (bounded large-PDF memory): shared resource indexes and parser metadata, lazy inspection, bounded caches; a 9,156-page file inspects in ≈ 1.8 s at ≈ 500 MiB instead of exceeding 10 GiB. Edits let go of the previous working file before writing the next (a 1 GiB file peaks at two copies while editing, not three; gap 13). Shortcut display uses localized modifier/key names across menus, toolbar, palette, Help and tooltips (#496). Traditional Chinese accessibility statuses, rule semantics and Taiwan form/table terms have catalog regressions. Missing: a right-to-left layout, a Chinese UI face in releases, Hindi/Indonesian/Korean/Vietnamese, file-backed input and global memory budgets, performance budgets, keyboard-only operation |