mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +03:00
Switched from sub-pixel to greyscale text anti-aliasing on macOS when running with a JetBrains JRE.
Sub-pixel anti-aliasing (VALUE_TEXT_ANTIALIAS_LCD_HRGB) causes font rendering with too much weight with a JetBrains JREs (both 8 and 11). This can be seen when comparing the text rendering of UI elements between IntelliJ IDEA and FlatLaf. This commits aligns FlatLaf's behavior with IntelliJ IDEA which disables sub-pixel anti-aliasing on macOS for its IDE anti-aliasing setting and uses greyscale anti-aliasing by default (see com.intellij.ide.ui.AntialiasingType.canUseSubpixelAAForIDE).
This commit is contained in:
@@ -546,7 +546,12 @@ public abstract class FlatLaf
|
||||
}
|
||||
|
||||
private void putAATextInfo( UIDefaults defaults ) {
|
||||
if( SystemInfo.isJava_9_orLater ) {
|
||||
if ( SystemInfo.isJetBrainsJVM ) {
|
||||
// The awt.font.desktophints property suggests sub-pixel anti-aliasing
|
||||
// which renders text with too much weight on macOS in the JetBrains JRE.
|
||||
// Use greyscale anti-aliasing instead.
|
||||
defaults.put( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON );
|
||||
} else if( SystemInfo.isJava_9_orLater ) {
|
||||
Object desktopHints = Toolkit.getDefaultToolkit().getDesktopProperty( DESKTOPFONTHINTS );
|
||||
if( desktopHints instanceof Map ) {
|
||||
@SuppressWarnings( "unchecked" )
|
||||
|
||||
Reference in New Issue
Block a user