Using Google Noto fonts with goPdf

713 Views Asked by At

I am trying to use this Google Noto font, but all I'm seeing are squares when I print to pdf. Does anyone know how to add this font to goPdf?

2

There are 2 best solutions below

0
Chad Maine On

It looks like gopdf supports embedding fonts:

https://godoc.org/github.com/signintech/gopdf#GoPdf.AddTTFFont

1
oneplus anantapan On

GoPdf support only embedding .ttf font.

Example:

gp := gopdf.GoPdf{}
...
gp.AddTTFFont("fontname","./fonts/fontfile.ttf") //add font
...
gp.SetFont("fontname","",14)  //use font