Skip to content
How to use CJK font to render text

How to use CJK font to render text

To load CJK font use NewCompositePdfFontFile function. It accepts both .ttf and .otf files.

cjkFont, err := model.NewCompositePdfFontFile("./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

Last updated on