Use own fonts for pdfs in Go (Golang) with Maroto
Maroto is a great and easy tool to generate pdfs with Go. It is very easy to achieve quickly outstanding results: %[https://github.com/johnfercher/maroto] Of course, you can add your fonts, which is particularly important if you want to use UTF8-compliant fonts: m.SetFontLocation("/PathToMyFonts/") m.AddUTF8Font(“CustomArial”, consts.Normal, “far.ttf”) m.AddUTF8Font(“CustomArial”, consts.Italic, “fai.ttf”) m.AddUTF8Font(“CustomArial”, consts.Bold, “fab.ttf”) m.AddUTF8Font(“CustomArial”, consts.BoldItalic, “fabi.ttf”) m.SetDefaultFontFamily(“CustomArial”) Now there is one challenge though! For some strange reasons, it seems that the name of the font files has to me short (8 characters?) and should not contain any special characters. ...