mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 Improve export PDF footer font
This commit is contained in:
parent
3eaa043889
commit
345857ae79
4 changed files with 47 additions and 27 deletions
|
|
@ -40,7 +40,6 @@ import (
|
|||
"github.com/88250/lute/parse"
|
||||
"github.com/88250/lute/render"
|
||||
"github.com/88250/pdfcpu/pkg/api"
|
||||
"github.com/88250/pdfcpu/pkg/font"
|
||||
"github.com/88250/pdfcpu/pkg/pdfcpu"
|
||||
"github.com/Masterminds/sprig/v3"
|
||||
"github.com/emirpasic/gods/sets/hashset"
|
||||
|
|
@ -995,20 +994,7 @@ func processPDFFooter(pdfCtx *pdfcpu.Context) {
|
|||
}
|
||||
footer := buf.String()
|
||||
|
||||
fontName := "Helvetica"
|
||||
names := font.UserFontNames()
|
||||
if 1 > len(names) {
|
||||
preferredFont := util.GetPreferredFontFilePath(Conf.Lang)
|
||||
if err = api.InstallFonts([]string{preferredFont.Path}); nil != err {
|
||||
logging.LogErrorf("install font failed: %s", err)
|
||||
} else {
|
||||
names = font.UserFontNames()
|
||||
logging.LogInfof("install pdf font: %s", names)
|
||||
}
|
||||
}
|
||||
if 0 < len(names) {
|
||||
fontName = names[0]
|
||||
}
|
||||
fontName := util.InstallPDFFonts()
|
||||
|
||||
pos := "bc"
|
||||
desc := fmt.Sprintf("font:%s, points:8, sc:1 abs, pos:%s, off:10 10, fillc: 0.5 0.5 0.5, rot:0", fontName, pos)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue