From 5b0731b793f32a6d8233478661e181f5ff97c5ea Mon Sep 17 00:00:00 2001 From: "Matthew R. Wilson" Date: Wed, 23 Mar 2022 00:07:44 -0700 Subject: [PATCH] Issue #9: fix local output mode. After adding multiple profile support, I neglected to ensure the correct profile is used for subsequent jobs in local mode after the first one. --- VERSION | 2 +- agent/main.go | 10 +++++++--- agent/output.go | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 1d0ba9e..267577d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +0.4.1 diff --git a/agent/main.go b/agent/main.go index 9bac465..99fe17c 100644 --- a/agent/main.go +++ b/agent/main.go @@ -83,9 +83,13 @@ func main() { } // Verify we have a font we can use. If the user doesn't provide a - // font, we will use our embedded copy of IBM Plex Mono. If the user - // does provide a font, we will make sure we can read the file, use - // it in a PDF, and that it is a fixed-width font. + // font, we will use our embedded copy of IBM Plex Mono. If the + // user does provide a font, we will make sure we can read the + // file, use it in a PDF, and that it is a fixed-width font. + // + // Note that the user's custom font is only used for the + // "default-" profiles; the retro- and modern- profiles will use + // one of our embedded fonts. var font []byte if conf.FontFile == "" { // easy... just use default font by setting font to null diff --git a/agent/output.go b/agent/output.go index 516480e..9e20f8d 100644 --- a/agent/output.go +++ b/agent/output.go @@ -34,6 +34,7 @@ type pdfOutputHandler struct { outputDir string font []byte inputName string + profile string } func newPDFOutputHandler(outputDir, profile string, fontOverride []byte, @@ -43,6 +44,7 @@ func newPDFOutputHandler(outputDir, profile string, fontOverride []byte, outputDir: outputDir, font: fontOverride, inputName: inputName, + profile: profile, } var err error @@ -66,8 +68,7 @@ func (o *pdfOutputHandler) EndOfJob(jobinfo string) { // new job. defer func() { var err error - o.job, err = vprinter.New1403(o.font, 11.4, 5, true, true, - vprinter.DarkGreen, vprinter.LightGreen) + o.job, err = vprinter.NewProfile(o.profile, o.font, 11.4) if err != nil { log.Printf("ERROR: [%s] couldn't re-initialize virtual 1403: %v", o.inputName, err)