Skip to content
How to use CJK font to render text

How to use CJK font to render text

To load CJK font use NewCompositePdfFontFromTTFFile function.

cjkFont, err := model.NewCompositePdfFontFromTTFFile("./rounded-mplus-1p-regular.ttf")

And then you can use the returned result to render text.

For a complete working example check this code https://github.com/unidoc/unipdf-examples/blob/master/text/pdf_using_cjk_font.go