fixed Windows font name autocomplete - fixed #3686

This commit is contained in:
Eugene Pankov 2021-04-16 20:43:23 +02:00
parent ad78f38210
commit 2cafd97751

View file

@ -23,11 +23,7 @@ export class AppearanceSettingsTabComponent {
async ngOnInit () {
if (this.hostApp.platform === Platform.Windows || this.hostApp.platform === Platform.macOS) {
const fonts = await new Promise<any[]>((resolve) => fontManager.findFonts({ monospace: true }, resolve))
if (this.hostApp.platform === Platform.Windows) {
this.fonts = fonts.map(x => `${x.family} ${x.style}`.trim())
} else {
this.fonts = fonts.map(x => x.family.trim())
}
this.fonts = fonts.map(x => x.family.trim())
this.fonts.sort()
}
if (this.hostApp.platform === Platform.Linux) {