diff --git a/Inter-Bold.ttf b/Inter-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..8e82c70d1081e2857ada1b73395d4f42c2e8adc9 Binary files /dev/null and b/Inter-Bold.ttf differ diff --git a/invoice.pdf b/invoice.pdf deleted file mode 100644 index 7535364c97f31691516dadb315c4d148eabb0c39..0000000000000000000000000000000000000000 Binary files a/invoice.pdf and /dev/null differ diff --git a/main.go b/main.go index 0f2d8ecf8d5d491a1d9dc386197a7fda366d4409..05465fe6503e7a888ee6af932fefa0518c45f2b6 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,9 @@ import ( //go:embed Inter.ttf var interFont []byte +//go:embed Inter-Bold.ttf +var interBoldFont []byte + var ( id string title string @@ -83,6 +86,11 @@ var generateCmd = &cobra.Command{ return err } + err = pdf.AddTTFFontData("Inter-Bold", interBoldFont) + if err != nil { + return err + } + writeLogo(&pdf, logo, from) writeTitle(&pdf, title, id) writeBillTo(&pdf, to) diff --git a/pdf.go b/pdf.go index 4ffb9c0a2ee0b839281619d851323eef9d65dff3..f95c9afc72ef0fead10b6bf279b0ba2d87115ce7 100644 --- a/pdf.go +++ b/pdf.go @@ -32,7 +32,7 @@ func writeLogo(pdf *gopdf.GoPdf, logo string, from string) { } func writeTitle(pdf *gopdf.GoPdf, title, id string) { - _ = pdf.SetFont("Inter", "", 24) + _ = pdf.SetFont("Inter-Bold", "", 24) pdf.SetTextColor(0, 0, 0) _ = pdf.Cell(nil, title) pdf.Br(36) @@ -129,6 +129,9 @@ func writeTotal(pdf *gopdf.GoPdf, label string, total float64) { pdf.SetTextColor(0, 0, 0) _ = pdf.SetFontSize(12) pdf.SetX(amountColumnOffset - 15) + if label == totalLabel { + _ = pdf.SetFont("Inter-Bold", "", 11.5) + } _ = pdf.Cell(nil, currencySymbols[currency]+strconv.FormatFloat(total, 'f', 2, 64)) pdf.Br(24) }