Text clarity on jpeg image
Posted: Wed May 07, 2008 7:21 pm
I have an issue with getting text to look good when exporting to a JPeg. The text always looks like the 8 bit pixel square letters.
This is a section of code.
chart.getAxes().getBottom().getTitle().getFont().setItalic(true);
chart.getAxes().getBottom().getTitle().getFont().setSize(intFontSize);
chart.getAxes().getBottom().getTitle().getFont().setName("Lucida Sans");
chart.getAxes().getBottom().getTitle().setText("Contract Years");
Three of the four lines work as expected. The line that doesn’t seem to work is the 3rd line with setName. When it comes time to export to a JPEG, the font is not used or it is such bad quality that it looks like it is not being used. I have tried a number of different fonts and code combinations with no luck. The look does not change. Below is the line that is being used to make the JPEG.
chart.getExport().getImage().getJPEG().save(strPath);
Setting the compression quality helped sharpen the letter only. The thing that has worked best in getting the text to being better and more readable is to make it larger
This is a section of code.
chart.getAxes().getBottom().getTitle().getFont().setItalic(true);
chart.getAxes().getBottom().getTitle().getFont().setSize(intFontSize);
chart.getAxes().getBottom().getTitle().getFont().setName("Lucida Sans");
chart.getAxes().getBottom().getTitle().setText("Contract Years");
Three of the four lines work as expected. The line that doesn’t seem to work is the 3rd line with setName. When it comes time to export to a JPEG, the font is not used or it is such bad quality that it looks like it is not being used. I have tried a number of different fonts and code combinations with no luck. The look does not change. Below is the line that is being used to make the JPEG.
chart.getExport().getImage().getJPEG().save(strPath);
Setting the compression quality helped sharpen the letter only. The thing that has worked best in getting the text to being better and more readable is to make it larger