diff --git a/crates/fonts/src/tests_sysfonts.rs b/crates/fonts/src/tests_sysfonts.rs index 573ac2ef8..ee6148b04 100644 --- a/crates/fonts/src/tests_sysfonts.rs +++ b/crates/fonts/src/tests_sysfonts.rs @@ -222,3 +222,25 @@ fn the_scan_lists_a_variable_fonts_named_instances_as_loading_it_does() { assert!(loaded.iter().any(|(family, _, legacy)| family != legacy), "{loaded:?}"); } } + +#[test] +fn fallback_cache_is_dropped_when_a_face_loads_by_its_legacy_family_name() { + // #121 with #219: a lookup by a legacy family name ("Sysfont Sans3 Semibold") loads faces, + // so fallbacks remembered before it are searched again. + let dir = font_dir("fallback-legacy"); + std::fs::write(dir.join("Sysfont-Semibold.ttf"), renamed("SourceSans3-Semibold.ttf")).unwrap(); + let db = FontDb::with_font_dirs(vec![dir]); + db.set_system_fallback(false); + let latin = db.face(FALLBACK_FAMILY, "Regular"); + let thai = 'ก'; + assert!(db.fallback_for(thai, latin.id()).is_none()); + let before = db.read_faces().len(); + let semibold = format!("{FAMILY} Semibold"); + let f = db.face(&semibold, "Regular"); + assert_eq!((f.style.as_str(), f.legacy_family.as_str()), ("Semibold", semibold.as_str())); + assert!(db.read_faces().len() > before, "the installed family loaded"); + assert!(db.fallback_for('A', f.id()).is_some_and(|g| g.id() != f.id())); + let cache = db.fallbacks.read().unwrap(); + assert_eq!(cache.faces, db.read_faces().len()); + assert!(!cache.map.contains_key(&(thai, latin.id())), "answers from before the load are dropped"); +} diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 1a40646af..26327b7b9 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1011,3 +1011,13 @@ Dark Oscuro Use system setting Usar la configuración del sistema A file dialog is already open. Ya hay un cuadro de diálogo de archivo abierto. + Alt text Texto alternativo + Alt: Alt.: + W: An.: + H: Al.: + Reset Restablecer + Reset Crop Restablecer recorte + Insert a new equation (Alt+=) Insertar una ecuación nueva (Alt+=) + Leave the equation (Esc) Salir de la ecuación (Esc) + Preview Vista previa + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index f59246b7f..73a00c8c9 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -994,3 +994,13 @@ Dark ダーク Use system setting システム設定を使用 A file dialog is already open. ファイル ダイアログが既に開いています。 + Alt text 代替テキスト + Alt: 代替テキスト: + W: 幅: + H: 高さ: + Reset リセット + Reset Crop トリミングのリセット + Insert a new equation (Alt+=) 新しい数式を挿入 (Alt+=) + Leave the equation (Esc) 数式を終了 (Esc) + Preview プレビュー + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 240de90b7..4db082c14 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -1006,3 +1006,13 @@ Dark Escuro Use system setting Usar a configuração do sistema A file dialog is already open. Já há uma caixa de diálogo de arquivo aberta. + Alt text Texto alternativo + Alt: Alt.: + W: L: + H: A: + Reset Redefinir + Reset Crop Redefinir corte + Insert a new equation (Alt+=) Inserir uma nova equação (Alt+=) + Leave the equation (Esc) Sair da equação (Esc) + Preview Visualizar + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/sr-latn.tsv b/crates/ui-egui/src/i18n/sr-latn.tsv index 5434ef453..f817466db 100644 --- a/crates/ui-egui/src/i18n/sr-latn.tsv +++ b/crates/ui-egui/src/i18n/sr-latn.tsv @@ -1005,3 +1005,13 @@ Type the recipients, or load them from a file. Unesite primaoce ili ih učitajte iz fajla. Use an Existing List… Koristi postojeću listu… A file dialog is already open. Dijalog za fajlove je već otvoren. + Alt text Alternativni tekst + Alt: Alt. tekst: + W: Š: + H: V: + Reset Vrati + Reset Crop Poništi isecanje + Insert a new equation (Alt+=) Umetni novu jednačinu (Alt+=) + Leave the equation (Esc) Napusti jednačinu (Esc) + Preview Pregled + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/sr.tsv b/crates/ui-egui/src/i18n/sr.tsv index 511569f7f..d493b1453 100644 --- a/crates/ui-egui/src/i18n/sr.tsv +++ b/crates/ui-egui/src/i18n/sr.tsv @@ -1010,3 +1010,13 @@ Type the recipients, or load them from a file. Унесите примаоце или их учитајте из фајла. Use an Existing List… Користи постојећу листу… A file dialog is already open. Дијалог за фајлове је већ отворен. + Alt text Алтернативни текст + Alt: Алт. текст: + W: Ш: + H: В: + Reset Врати + Reset Crop Поништи исецање + Insert a new equation (Alt+=) Уметни нову једначину (Alt+=) + Leave the equation (Esc) Напусти једначину (Esc) + Preview Преглед + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 9f9c8b328..3f48f086f 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1006,3 +1006,13 @@ Dark Темна Use system setting Як у системі A file dialog is already open. Діалогове вікно файлу вже відкрито. + Alt text Альтернативний текст + Alt: Альт.: + W: Ш: + H: В: + Reset Скинути + Reset Crop Скинути обітнення + Insert a new equation (Alt+=) Вставити нове рівняння (Alt+=) + Leave the equation (Esc) Вийти з рівняння (Esc) + Preview Попередній перегляд + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 426a36a7e..45c921684 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1005,3 +1005,13 @@ Dark 深色 Use system setting 使用系统设置 A file dialog is already open. 已有一个文件对话框处于打开状态。 + Alt text 替代文字 + Alt: 替代文字: + W: 宽: + H: 高: + Reset 重设 + Reset Crop 重设裁剪 + Insert a new equation (Alt+=) 插入新公式 (Alt+=) + Leave the equation (Esc) 退出公式 (Esc) + Preview 预览 + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 19cfd9dd3..9e482ca22 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -995,3 +995,13 @@ Dark 深色 Use system setting 使用系統設定 A file dialog is already open. 已有一個檔案對話方塊開啟中。 + Alt text 替代文字 + Alt: 替代文字: + W: 寬: + H: 高: + Reset 重設 + Reset Crop 重設裁剪 + Insert a new equation (Alt+=) 插入新方程式 (Alt+=) + Leave the equation (Esc) 離開方程式 (Esc) + Preview 預覽 + getartcraft.com/apps/wordcraft getartcraft.com/apps/wordcraft