<div dir="ltr"><div>Hi all,</div><div><br></div><div>We've had a bit of back-and-forth regarding whether font hinting is enabled or disabled when drawing grayscale text with anti-aliasing and fractional metrics enabled [1, 2]. Setting AA + FM disabled font hinting in JDK 8 - 10, then JDK 11 changed this so that AA + FM would *not* disable hinting, and finally the behavior was reverted in JDK 14 (and backported to JDK 11).<br></div><div><br></div><div>Generalizing a bit, the current behavior (AA + FM disables hinting) is optimal for "the desktop use case" (JavaFX, animations, smooth scaling, etc). The JDK 11/12/13 behavior was optimal for "the backend use case" (individual image creation, no animations).</div><div><br></div><div>I think it would be useful to have a new java.awt.RenderingHints key named RenderingHints.KEY_FONT_HINTING, with the following possible values:</div><div>- RenderingHints.VALUE_FONT_HINTING_DEFAULT: current behavior, dictated by AA + FM</div><div>- RenderingHints.VALUE_FONT_HINTING_ON: enable font hinting, regardless of AA + FM<br></div><div>- RenderingHints.VALUE_FONT_HINTING_OFF: disable font hinting, regardless of AA + FM<br></div><div></div><div><br></div><div>This new rendering hint would allow direct control over whether font hinting is enabled or not, and would specifically enable the use of AA + FM + font hints in Java.</div><div><br></div><div>I'm happy to create a patch with this feature (I have a signed OCA on file), but wanted to get feedback on the idea first. Let me know what you think!</div><div><br></div><div>Take care,</div><div><br></div><div>Daniel<br></div><div><br></div><div>[1] <a href="https://bugs.openjdk.org/browse/JDK-8214481" target="_blank">https://bugs.openjdk.org/browse/JDK-8214481</a></div><div>[2] <a href="https://bugs.openjdk.org/browse/JDK-8242285" target="_blank">https://bugs.openjdk.org/browse/JDK-8242285</a></div><div><br></div></div>