fixed #4686, fixed #6506 - font lookup on Windows

This commit is contained in:
Eugene Pankov 2022-06-27 10:41:30 +02:00
parent 918f06b86a
commit c75294e03a
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -138,7 +138,7 @@ export class ElectronPlatformService extends PlatformService {
async listFonts (): Promise<string[]> {
if (this.hostApp.platform === Platform.Windows || this.hostApp.platform === Platform.macOS) {
let fonts = await new Promise<any[]>((resolve) => fontManager.findFonts({}, resolve))
let fonts = await new Promise<any[]>(resolve => fontManager.getAvailableFonts(resolve))
fonts = fonts.map(x => x.family.trim())
return fonts
}