Skip to content

Commit

Permalink
Issue #9: fix local output mode.
Browse files Browse the repository at this point in the history
After adding multiple profile support, I neglected to ensure the correct
profile is used for subsequent jobs in local mode after the first one.
  • Loading branch information
racingmars committed Mar 23, 2022
1 parent 5d73b92 commit 5b0731b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.4.1
10 changes: 7 additions & 3 deletions agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions agent/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type pdfOutputHandler struct {
outputDir string
font []byte
inputName string
profile string
}

func newPDFOutputHandler(outputDir, profile string, fontOverride []byte,
Expand All @@ -43,6 +44,7 @@ func newPDFOutputHandler(outputDir, profile string, fontOverride []byte,
outputDir: outputDir,
font: fontOverride,
inputName: inputName,
profile: profile,
}
var err error

Expand All @@ -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)
Expand Down

0 comments on commit 5b0731b

Please sign in to comment.