1

I'm successfully exporting from mxGraph (Java) using the approach presented in the mxGraph exportPdf example.

However I'd like to specify a font that can support more asian-languag utf-8 encoded text, as the default font does not seem to be able to do so.

I came across this other SO question. An answer states the following "Note that you need to setup iText to map every font you need in the PDF" Can anyone provide any information as to the process involved to set up iText fonts for use by mxGraph java?

Community
  • 1
  • 1
anarnold
  • 103
  • 13

1 Answers1

1

I've never tried it, but my understanding is that you need to pull in iTextAsian.jar and follow the CJK example, the key part of which is:

BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
Font FontChinese = new Font(bfChinese, 12, Font.NORMAL);
Paragraph p = new Paragraph(chinese, FontChinese);
document.add(p);
Frodo Baggins
  • 8,290
  • 6
  • 45
  • 55