Free Support Forum - aspose.com

Slide thumbnail - Text rendering issue in OpenJDK 8u232

The rendering of fonts is broken with OpenJDK 8 u232. It looks like the glyphs are rendered at the wrong x-position and subsequently overlap with each other.

It looks fine with small font sizes,

  • fine with Courier New and font size 12, but not with font size 14.
  • fine with Arial and font size 10, but not with font size 12, see attachments.

Last known working JDK version: OpenJDK 8 u222.

Could be observed with

  • OS: Windows 10, CentOS 7
  • Aspose Slides Java versions: 15.11, 19.7, 19.10
  • fonts: Arial, Liberation Sans, Calibri, Times New Roman, Consolas, Courier New

Minimal working example

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

import com.aspose.slides.FontData;
import com.aspose.slides.IAutoShape;
import com.aspose.slides.IParagraph;
import com.aspose.slides.IPortion;
import com.aspose.slides.ISlide;
import com.aspose.slides.Presentation;
import com.aspose.slides.ShapeType;

public class Main {

	public static void main(String[] args) {
		final Presentation presentation = new Presentation();
		final ISlide slide = presentation.getSlides().get_Item(0);
		final IAutoShape shape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 160, 160, 400, 200);

		shape.getTextFrame().setText("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.");
		for (final IParagraph paragraph : shape.getTextFrame().getParagraphs()) {
			for (final IPortion portion : paragraph.getPortions()) {
				portion.getPortionFormat().setLatinFont(new FontData("Arial"));
				portion.getPortionFormat().setFontHeight(12);
			}
		}

		final File file = new File("Hello.png");
		try (final FileOutputStream outputStream = new FileOutputStream(file)) {
			System.out.println("Writing file " + file.getAbsolutePath());
			ImageIO.write(slide.getThumbnail(1, 1), "png", outputStream);
		} catch (final IOException e) {
			e.printStackTrace();
		}
	}
}

Hello_Arial_10.png (24.7 KB)
Hello_Arial_12.png (26.2 KB)

1 Like

@pstoehrer,

I have worked with the sample code shared and have observed the image files shared. An issue with ID SLIDESJAVA-37832 has been created in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notifeid once the issue will be resolved.

2 Likes

Hello all,

Is there any plans to fix this? Any dates or time frames?

Thanks and Best Regards,
Kirill

@9llirik9,

I have verified from our issue tracking system and regret to share that at present the issue is still unresolved. We request for your patience till the time the issue gets resolved and feedback is shared.

Hello, it seems that this openjdk commit causes the issue:
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/2c10a7ea0c40

The issues you have found earlier (filed as SLIDESJAVA-37832) have been fixed in this update.

1 Like

I can confirm that the problem is solved in Aspose Slides 2019.12.
Thank you very much.

@pstoehrer,

Thank you for your feedback.