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:
parent
86456ce379
commit
f3ad754396
1 changed files with 7 additions and 3 deletions
|
@ -64,13 +64,17 @@ impl PlatformTextSystem for CosmicTextSystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn all_font_names(&self) -> Vec<String> {
|
fn all_font_names(&self) -> Vec<String> {
|
||||||
self.0
|
let mut result = self
|
||||||
|
.0
|
||||||
.read()
|
.read()
|
||||||
.font_system
|
.font_system
|
||||||
.db()
|
.db()
|
||||||
.faces()
|
.faces()
|
||||||
.map(|face| face.post_script_name.clone())
|
.filter_map(|face| face.families.first().map(|family| family.0.clone()))
|
||||||
.collect()
|
.collect_vec();
|
||||||
|
result.sort();
|
||||||
|
result.dedup();
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
fn all_font_families(&self) -> Vec<String> {
|
fn all_font_families(&self) -> Vec<String> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue