jung-kurt / gofpdf

A PDF document generator with high level support for text, drawing and images
http://godoc.org/github.com/jung-kurt/gofpdf
MIT License
4.31k stars 777 forks source link

Add SetFontStyle method #248

Closed joewestcott closed 5 years ago

joewestcott commented 5 years ago

Currently, to change just the font style in user code, you have to do something like this:

pdf.SetFont("", "B", 0)

Now you can do:

pdf.SetFontStyle("B")

This implementation simply calls the exported SetFont() method internally. This differs slightly to SetFontSize(), which updates internal state and writes to the PDF in its own method. Let me know if you have any preference, or if I've missed anything.

Thanks.

jung-kurt commented 5 years ago

Thanks, @joewestcott. This will be helpful.