mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Keys to play with lcd text rendering. IDEA-117324
This commit is contained in:
@@ -25,6 +25,7 @@ import com.intellij.openapi.components.*;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.SimpleModificationTracker;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
import com.intellij.util.PlatformUtils;
|
||||
import com.intellij.util.SystemProperties;
|
||||
@@ -295,6 +296,10 @@ public class UISettings extends SimpleModificationTracker implements PersistentS
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||
}
|
||||
}
|
||||
if (Registry.is("force.subpixel.hinting")) {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, Registry.intValue("lcd.contrast.value"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -504,4 +504,11 @@ JDK8042508.bug.fixed=false
|
||||
JDK8042508.bug.fixed.description=Disable check for type variable until javac bug is fixed
|
||||
|
||||
check.power.supply.for.mbp=false
|
||||
check.power.supply.for.mbp.description=Check for discrete video card and power supply on MBPs
|
||||
check.power.supply.for.mbp.description=Check for discrete video card and power supply on MBPs
|
||||
|
||||
|
||||
force.subpixel.hinting=false
|
||||
force.subpixel.hinting.description=Force using sub-pixel antialiasing
|
||||
|
||||
lcd.contrast.value=140
|
||||
lcd.contrast.value.description=Set LCD text contrast value from 100 to 250
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.openapi.ui.GraphicsConfig;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -71,6 +72,11 @@ public class GraphicsUtil {
|
||||
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||
enableAA ? RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
|
||||
}
|
||||
|
||||
if (Registry.is("force.subpixel.hinting")) {
|
||||
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
|
||||
g.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, Registry.intValue("lcd.contrast.value"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1673,11 +1673,16 @@ public class UIUtil {
|
||||
}
|
||||
|
||||
public static void applyRenderingHints(final Graphics g) {
|
||||
Graphics2D g2d = (Graphics2D)g;
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
//noinspection HardCodedStringLiteral
|
||||
Map map = (Map)tk.getDesktopProperty("awt.font.desktophints");
|
||||
if (map != null) {
|
||||
((Graphics2D)g).addRenderingHints(map);
|
||||
g2d.addRenderingHints(map);
|
||||
if (Registry.is("force.subpixel.hinting")) {
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, Registry.intValue("lcd.contrast.value"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user