Java version - 1.7.0_13-b20
While using our reporting tool that under OS X, the fonts were all looking the same - default size, plain, default font. A simple test showed that this is not complicated to reproduce:
import java.awt.Font;
import java.awt.Graphics;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterJob;
import javax.print.attribute.HashPrintRequestAttributeSet;
public class FontIssue {
public static void main(String[] args) throws Exception {
PrinterJob printerJob = PrinterJob.getPrinterJob();
printerJob.setPrintable( new MyPrintable() );
printerJob.print(new HashPrintRequestAttributeSet());
Thread.sleep(10000);
}
}
class MyPrintable implements Printable {
public int print(Graphics g, PageFormat pf, int pageIndex) {
if (pageIndex == 0) {
g.translate((int) (pf.getImageableX()), (int) (pf.getImageableY()));
g.setFont( new Font("Helvetica",5,Font.BOLD | Font.ITALIC) );
g.drawString( "THIS IS A TEST", 123, 123 );
return Printable.PAGE_EXISTS;
}
return Printable.NO_SUCH_PAGE;
}
}
Normally the text "THIS IS A TEST" should print as size 5, bold and italic. Under Windows it does, but on a Mac system, the text is printed size 12 and in plain.
Note that this is a new issue, in earlier versions of Java 7 this did not occur.
Also, note that these folks seem to have the same issue as we do: https://www.servoy.com/forum/viewtopic.php?p=103912