UniDoc Knowledge Base
  • UniDoc FAQ
  • UniPDF
  • UniOffice

How do I use the 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

Last updated on April 11, 2021

Categories

  • Getting Started
  • Video Guides
  • License Key
  • Digital Signatures
  • Creating Reports
  • Creating Invoices
  • Filling and Flattening Forms
  • Extracting Text and Data
  • FAQ
  • Image Handling
No results found

© UniDoc 2025. Powered by Help Scout