mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-16 15:22:43 +00:00
Fonts: substitute test checks whether the original family is installed
microsoft_families_resolve_to_metric_compatible_substitutes took resolve's own answer as the sign that Calibri or Cambria is installed, so it passed when an installed original lost to its substitute. It now looks for the family among the registered faces and, when it is there, requires resolve to pick it and report it as not missing.
This commit is contained in:
1 parent
f334bcf3ef
commit
131e4b3252
1 file changed
+3
-1
@@ -459,7 +459,9 @@ fn microsoft_families_resolve_to_metric_compatible_substitutes() {
|
||||
|
||||
let resolved = resolve(requested, style);
|
||||
let family = &face(resolved.face).info.family;
|
||||
if family.eq_ignore_ascii_case(requested) {
|
||||
let installed = all_faces().iter().any(|f| f.info.family.eq_ignore_ascii_case(requested));
|
||||
if installed {
|
||||
assert!(family.eq_ignore_ascii_case(requested), "an installed {requested} wins over {family}");
|
||||
assert!(!resolved.missing, "an installed original family is available");
|
||||
} else {
|
||||
assert_eq!(family, substitute);
|
||||
|
||||
Reference in new issue
Block a user