We are developing an application for printing. The same text is rendered using AWT in two modes with different resolutions - screen (small DPI) and printing (300 DPI).
The problem is that text layout depends on DPI. And this dependency is non-linear. There are examples:
Width: 200 px, font size: 10 pt
Width: 400 px, font size: 20 pt
Width: 600 px, font size: 30 pt
The rectangle width and font size are increasing proportionally from the first to the third image. But on the first image we have only "lazy", on the second we have "lazy do", and on the third only "lazy d".
Is there any way to constrain text layout while increasing total image size in pixels?
graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With