ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  OpenJDK font differences
Posted by yjlee on Oct-26-2018 17:31

I'm trying to change oracle jdk to OpenJDK10.0.2
and hoped it won't have big differences between those.

but i found font differences when i export chart as pdf format
even though i set the same parameters(font name, font size..) to your API.

please check the picture i attached.

is there any issue about using chart director with openjdk?

  Re: OpenJDK font differences
Posted by Peter Kwan on Oct-27-2018 02:30
Hi yjlee,

It looks the two charts are using different fonts.

Would you mind to inform me which operating system you are using and the exact font name you are using? Are the two charts produced by the same computer, or by different computers? Is the two charts displayed by the same PDF viewer on the same computer?

In Java, when you specify a font, if the font does not actually exist or not known to Java, the Java VM can substitute with another font. The substitute font can differ depending on the Java VM and the operating system.

When producing the PDF, a subset of the the font file needs to be embedded in the PDF. On Windows and MacOS, the font files are in standard operating system directories. On other OS (eg. Linux), there is no standard directory for the font files, so ChartDirector may not be able to find the font files. If the font files cannot be find, the font cannot be embedded. In this case, the PDF viewer will try to automatically find a suitable font. It depends on the PDF viewer and on the operating system.

If you can provide me the exact font name used in your code and the operating system, I will try to reproduce the problem to confirm if different fonts are used in the two charts.

Or you can try the following test:

XYChart c = new XYChart(300, 100);
c.addTitle("ABC ... add some Koorean characters ... 1234", "your_font_name", 15);

The above will produce 3 versions of the chart (in PNG, SVG and PDF) for comparison. You can try the above using the Oracle and OpenJDK and attached the 6 files that are produced. These files may contain information to determine the cause of the problem.

Peter Kwan