From 92785cea4f164efd4eee14f5b6337873dbf4a730 Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Sun, 18 Oct 2026 03:20:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=8E=9F=E7=94=9F=E6=A1=8C=E9=9D=A2):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=9F=E7=94=9F=E6=96=87=E5=AD=97=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=B8=8E=E5=AD=97=E4=BD=93=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/webui/ofdgo_host.js | 2 +- internal/webview/webview.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/webui/ofdgo_host.js b/assets/webui/ofdgo_host.js index cb30bfa..e0bd0aa 100644 --- a/assets/webui/ofdgo_host.js +++ b/assets/webui/ofdgo_host.js @@ -213,7 +213,7 @@ class NativeHost { } async fonts() { - return (await this.call("fonts", {})).map(font => ({...font, nativeFile:new NativeFile(font.file)})); + return (await this.call("fonts", {})).map(({file, ...font}) => ({...font, nativeFile:new NativeFile(file)})); } async start(onFiles, onError) { diff --git a/internal/webview/webview.go b/internal/webview/webview.go index 82cfbdd..fc45a58 100644 --- a/internal/webview/webview.go +++ b/internal/webview/webview.go @@ -705,8 +705,8 @@ func (h *Host) readFonts() { continue } for _, face := range faces { - h.fonts = append(h.fonts, map[string]any{"index": face.Index, "postscriptName": face.PostScriptName, "fullName": face.FullName, "family": face.Family, "style": face.Style, "file": file}) - for _, alias := range []string{face.FullName, face.Family, face.PostScriptName, strings.TrimSpace(face.Family + " " + face.Style)} { + h.fonts = append(h.fonts, map[string]any{"index": face.Index, "postscriptName": face.PostScriptName, "fullName": face.FullName, "family": face.Family, "style": face.Style, "names": face.Names, "file": file}) + for _, alias := range append([]string{face.FullName, face.Family, face.PostScriptName, strings.TrimSpace(face.Family + " " + face.Style)}, face.Names...) { if alias != "" { h.fontFiles[alias+".ttf"] = name + "\x00" + strconv.Itoa(face.Index) }