diff --git a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt index 76e70201b5e4..adb1a28a6a8c 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt +++ b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.kt @@ -475,14 +475,19 @@ class UISettings @NonInjectable constructor(private val notRoamableOptions: NotR val shadowInstance: UISettings get() = instanceOrNull ?: UISettings(NotRoamableUiSettings()) - @JvmField - val FORCE_USE_FRACTIONAL_METRICS = SystemProperties.getBooleanProperty("idea.force.use.fractional.metrics", SystemInfo.isMacOSCatalina) + @JvmStatic + val PREFERRED_FRACTIONAL_METRICS_VALUE: Any + get() { + return if (!Registry.`is`("ide.disable.fractionalMetrics", false) + && SystemProperties.getBooleanProperty("idea.force.use.fractional.metrics", SystemInfo.isMacOSCatalina)) + RenderingHints.VALUE_FRACTIONALMETRICS_ON + else + RenderingHints.VALUE_FRACTIONALMETRICS_OFF + } @JvmStatic fun setupFractionalMetrics(g2d: Graphics2D) { - if (FORCE_USE_FRACTIONAL_METRICS) { - g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON) - } + g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, PREFERRED_FRACTIONAL_METRICS_VALUE) } /** diff --git a/platform/lang-impl/src/com/intellij/refactoring/suggested/SignatureChangePresentation.kt b/platform/lang-impl/src/com/intellij/refactoring/suggested/SignatureChangePresentation.kt index 9fdad7fb7f38..8547f4d0441f 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/suggested/SignatureChangePresentation.kt +++ b/platform/lang-impl/src/com/intellij/refactoring/suggested/SignatureChangePresentation.kt @@ -33,7 +33,7 @@ class SignatureChangePresentation( private val dummyFontRenderContext = FontRenderContext( AffineTransform(), AntialiasingType.getKeyForCurrentScope(false), - if (UISettings.FORCE_USE_FRACTIONAL_METRICS) RenderingHints.VALUE_FRACTIONALMETRICS_ON else RenderingHints.VALUE_FRACTIONALMETRICS_OFF + UISettings.PREFERRED_FRACTIONAL_METRICS_VALUE ) val requiredSize by lazy { diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java index bf7f0907ed4d..577e52abd53e 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java @@ -600,10 +600,7 @@ public final class LafManagerImpl extends LafManager implements PersistentStateC uiDefaults.put(RenderingHints.KEY_TEXT_ANTIALIASING, AntialiasingType.getKeyForCurrentScope(false)); uiDefaults.put(RenderingHints.KEY_TEXT_LCD_CONTRAST, UIUtil.getLcdContrastValue()); - uiDefaults.put(RenderingHints.KEY_FRACTIONALMETRICS, - UISettings.FORCE_USE_FRACTIONAL_METRICS - ? RenderingHints.VALUE_FRACTIONALMETRICS_ON - : RenderingHints.VALUE_FRACTIONALMETRICS_OFF); + uiDefaults.put(RenderingHints.KEY_FRACTIONALMETRICS, UISettings.getPREFERRED_FRACTIONAL_METRICS_VALUE()); for (Frame frame : Frame.getFrames()) { updateUI(frame); diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 772ae1d54996..9867e8069fdd 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -1350,7 +1350,10 @@ ide.text.effect.new.scale=true ide.text.effect.new.scale.description=Enables scalable effect painter for text ide.text.effect.new.metrics=true ide.text.effect.new.metrics.description=Use line metrics to calculate text offset in the effect painter - +ide.disable.fractionalMetrics=false +ide.disable.fractionalMetrics.restartRequired=true +ide.disable.fractionalMetrics.description=Fractional metrics are used by default in macOS Catalina to improve font rendering. \ + In some cases it may cause slowdown and the key allows switch them off ide.intellij.laf.enable.animation=false ide.intellij.laf.enable.animation.description=Provides visually smooth switching between LAFs