I have a requirement to draw using the method .drawString
from Graphics2D (java.awt
) a text in arabic.
But when I use the method using the following code it will just show a bunch of empty squares
BufferedImage bufferedImage = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = bufferedImage.createGraphics();
graphics.drawString("مرحبا هذا نص عربي",
xStartText, endY + smallRectHeight);
Can somebody help? I've search for code snippets to solve this problem but I could not find anything out there?