4
4

2 回答 2

2

I got the problem.

As correctly pointed out by @bobince also, the issue was with the font Arial which I was using.

To render a text of a particular language, the font should have glyphs for that language to correctly render the text.

e.g For rendering hindi text, fonts like Mangal, which have glyphs for hindi language, will render the text correctly.

The same hindi font will work for Marathi language also since the glyphs remains same for both languages but won't work for languages like Tamil, Telugu etc.

于 2014-01-22T17:44:28.370 回答
0

You can try using different font such as MONOSPACED or SansSerif

Font font = new Font(Font.MONOSPACED, Font.PLAIN, 11);
graphics.setFont(font);
graphics.drawString("ट्रेल्स. रीकदोसै. जोकालन्त", 1, 10);
graphics.dispose();

where the I have used java.awt.Font class. This worked and the characters were represented correctly.

于 2014-01-15T16:33:49.350 回答