mirror of
https://github.com/tiennm99/monkeyd-crawler.git
synced 2026-08-03 21:22:06 +00:00
PDF rendering failed on Linux with "stat usr/share/fonts/...: no such file or directory": fpdf joins the font path onto its own font directory, which it defaults to ".", so path.Join turns an absolute path into a working-directory-relative one. It only resolved when the process happened to run from the filesystem root, which is why Windows was unaffected. Font data is now read by pdfout and handed over as bytes. LoadFont also falls back to a bundled DejaVu Sans, so a host with no fonts installed still renders. An explicitly requested font remains a hard error when unreadable rather than being silently substituted. Tests verify the bundled font parses and covers Vietnamese, which is the reason it exists.
13 lines
226 B
AMPL
13 lines
226 B
AMPL
module github.com/tiennm99/monkeyd-crawler
|
|
|
|
go 1.26.4
|
|
|
|
require (
|
|
github.com/go-pdf/fpdf v0.9.0
|
|
golang.org/x/image v0.44.0
|
|
golang.org/x/net v0.57.0
|
|
golang.org/x/sync v0.22.0
|
|
)
|
|
|
|
require golang.org/x/text v0.40.0 // indirect
|