feat(渲染能力): 统一字体回退逻辑,修复阅读与PDF导出字体不一致的问题
build.yaml / build (push) Successful in 45s

This commit is contained in:
xiaoqidun committed 2026-09-09 20:46:17 +08:00
1 parent e5e07f92cd
commit 853ffc6327
9 files changed
+70 -183

No files matched your search

+7 -6
View File
@@ -43,7 +43,7 @@ func RunWASM() {
registerCallback("ofdgoExportFormats", exportFormats)
registerCallback("ofdgoExportPage", exportPage)
registerCallback("ofdgoExportPDF", exportPDF)
registerCallback("ofdgoFontSystemNames", fontSystemNames)
registerCallback("ofdgoFontFileMatches", fontFileMatches)
select {}
}
@@ -224,12 +224,13 @@ func bytesToJS(data []byte) js.Value {
return value
}
// fontSystemNames 获取系统字体名称
// fontFileMatches 匹配浏览器字体文件名称
// 入参: args 浏览器参数
// 返回: any 系统字体名称, error 错误信息
func fontSystemNames(args []js.Value) (any, error) {
names := stringsFromJS(jsArg(args, 0))
return ofdgo.FontSystemNames(names...), nil
// 返回: any 匹配的字体文件名称, error 错误信息
func fontFileMatches(args []js.Value) (any, error) {
files := stringsFromJS(jsArg(args, 0))
names := stringsFromJS(jsArg(args, 1))
return ofdgo.FontFileMatches(files, false, false, names...), nil
}
// bytesFromJS 从浏览器值读取二进制数据