linux: Fix wrong names reported by all_font_names (#14865)

The names suggested by `buffer_font_family` are reported by
`all_font_names`. Therefore, `all_font_names` should report family names
rather than postscript names.

close #14854 

Release Notes:

- N/A
This commit is contained in:
张小白 2024-07-26 02:53:22 +08:00 committed by GitHub
parent 86456ce379
commit f3ad754396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,13 +64,17 @@ impl PlatformTextSystem for CosmicTextSystem {
}
fn all_font_names(&self) -> Vec<String> {
self.0
let mut result = self
.0
.read()
.font_system
.db()
.faces()
.map(|face| face.post_script_name.clone())
.collect()
.filter_map(|face| face.families.first().map(|family| family.0.clone()))
.collect_vec();
result.sort();
result.dedup();
result
}
fn all_font_families(&self) -> Vec<String> {