diff --git a/assets/webui/ofdgo_font.js b/assets/webui/ofdgo_font.js index 9280990..f3cc1ff 100644 --- a/assets/webui/ofdgo_font.js +++ b/assets/webui/ofdgo_font.js @@ -400,7 +400,7 @@ export class FontManager { for (const font of fonts) { if (disabled.has(this.localName(font))) continue; const names = [this.localName(font), font.postscriptName && `${font.postscriptName}.ttf`, - font.family && `${[font.family, font.style].filter(Boolean).join(" ")}.ttf`]; + font.family && `${[font.family, font.style].filter(Boolean).join(" ")}.ttf`, ...(font.names || []).map(name => `${name}.ttf`)]; for (const name of names) { if (name && !entries.has(name)) entries.set(name, font); } diff --git a/internal/webview/webview.go b/internal/webview/webview.go index fc45a58..4a4e61e 100644 --- a/internal/webview/webview.go +++ b/internal/webview/webview.go @@ -707,7 +707,7 @@ func (h *Host) readFonts() { 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, "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 != "" { + if alias != "" && h.fontFiles[alias+".ttf"] == "" { h.fontFiles[alias+".ttf"] = name + "\x00" + strconv.Itoa(face.Index) } }