mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-1986 Enabling fractional metrics causes visual artifacts in font rendering on macOS 10.14+
Disable subpixel positioning for macOS 10.13+ if legacy LCD rendering is disabled (cherry picked from commitdbd24232e4) (cherry picked from commit9fbf990e83)
This commit is contained in:
@@ -39,6 +39,8 @@ extern int gNumberOfButtons;
|
||||
// InputEvent mask array
|
||||
extern jint* gButtonDownMasks;
|
||||
|
||||
extern int lcdSubPixelPosSupported;
|
||||
|
||||
extern int useFontSmoothing;
|
||||
|
||||
@interface AWTToolkit : NSObject { }
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
int gNumberOfButtons;
|
||||
jint* gButtonDownMasks;
|
||||
int lcdSubPixelPosSupported;
|
||||
int useFontSmoothing;
|
||||
|
||||
// Indicates that the app has been started with -XstartOnFirstThread
|
||||
|
||||
@@ -230,6 +230,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
|
||||
CFPreferencesGetAppBooleanValue(
|
||||
CFSTR("CGFontRenderingFontSmoothingDisabled"),
|
||||
kCFPreferencesCurrentApplication, &status);
|
||||
lcdSubPixelPosSupported = YES;
|
||||
useFontSmoothing = NO;
|
||||
if (status) {
|
||||
if (fontSmoothingDisabled) {
|
||||
@@ -248,6 +249,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
|
||||
if (!status) {
|
||||
smoothFonts = YES;
|
||||
}
|
||||
lcdSubPixelPosSupported = !smoothFonts;
|
||||
useFontSmoothing = smoothFonts;
|
||||
if (!smoothFonts) {
|
||||
J2dRlsTraceLn(J2D_TRACE_INFO,
|
||||
|
||||
@@ -1171,6 +1171,7 @@ OGLTR_DrawColorGlyphNoCache(OGLContext *oglc, GlyphInfo *ginfo, jint x, jint y)
|
||||
|
||||
// Control subpixel positioning for macOS 13+ grayscale glyphs
|
||||
#ifdef MACOSX
|
||||
extern int lcdSubPixelPosSupported;
|
||||
extern int useFontSmoothing;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user