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.33k stars 782 forks source link

How can I use arial serif? #306

Closed sredxny closed 4 years ago

sredxny commented 5 years ago

I understand that the package by default uses arial sans serif, even if I load an external TTF how can I start to use arial serif?

jung-kurt commented 5 years ago

Use SetFont(). For example,

pdf.SetFont("Arial", "B", 16)

for 16 pt Arial bold (this is sans serif), or

pdf.SetFont("Times", "", 14)

for 14 pt Times New Roman (standard serif font).

sredxny commented 5 years ago

@jung-kurt hello, thanks for answer. My mistake, I mean, how to use arial serif, not arial san serif? As am needing to use serif, but I see that its only available for Times

jung-kurt commented 5 years ago

I am not aware of any arial serif font and it definitely is not part of the default base fonts included with PDF readers. If you can find such a font, you will need to add it with AddUTF8Font().