Merge branch 'merge-app/fonts' into merge-app/main

This commit is contained in:
Dylan M. Taylor
2026-11-29 13:55:28 +00:00
+16 -1
View File
@@ -886,6 +886,14 @@ impl FontDb {
for face in loaded.iter() {
self.add_catalog_face(&face.info, &face.data);
}
if loaded.is_empty() {
// A Windows family name: only the files of its faces, not their whole family.
for info in self.legacy_faces(family) {
if let Ok(data) = self.catalog.load(&info) {
self.add_catalog_face(&info, &data);
}
}
}
self.is_loaded(family)
}
@@ -989,7 +997,14 @@ impl FontDb {
if self.is_loaded(family) {
return true;
}
self.catalog.family(family).is_some()
self.catalog.family(family).is_some() || !self.legacy_faces(family).is_empty()
}
/// The cataloged faces whose Windows family is `family` ("Segoe UI Semibold"): the catalogue
/// lists them under their typographic family only.
fn legacy_faces(&self, family: &str) -> Vec<craft::font_catalog::FaceInfo> {
let key = norm(family);
self.catalog.faces().iter().filter(|f| f.legacy_family.as_deref().is_some_and(|lf| norm(lf) == key)).cloned().collect()
}
pub(crate) fn is_loaded(&self, family: &str) -> bool {