title: Setting LCD gamma / contrast (IntelliJ IDEA, JDK 8)
body: <p>I am having trouble with anti-aliased text in IntelliJ IDEA. That thing for some reason ships with its own version of OpenJDK 8. Anyway... sub-pixel aliasing is acceptable with dark-on-bright text:</p>
  
  <p><a href="https://i.stack.imgur.com/lICbo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lICbo.png" alt="enter image description here"></a></p>
  
  <p>But the gamma is wrong for bright-on-dark text:</p>
  
  <p><a href="https://i.stack.imgur.com/1z2qZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1z2qZ.png" alt="enter image description here"></a></p>
  
  <p>Which means in this scheme, text looks as if it was bold-face and horizontally smeared/fuzzy.</p>
  
  <p>Is it possible to specify a system property or hack the system otherwise to change the gamma for AA interpolation towards darker colours? I already choose a very fine font (FicaCode Light), there is simply no font that shows less bold on this computer (Linux with Gnome 3, 1920x1080 display).</p>
  
  <hr>
  
  <p><strong>Edit:</strong> I am really looking for a way to control the AA gamma. I have not used IDEA 2017.1 EAP, but the release version which comes already with the 'fixed' bundled tuned version 1.8.0_112, that is mentioned in the gist comment. If I download that version, I get exactly the same pixel output as the two images above. These are the <code>idea64.jvmoptions</code>:</p>
  
  <h1>custom IntelliJ IDEA VM options</h1>
  
  <pre><code>-Xms128m
  -Xmx750m
  -XX:ReservedCodeCacheSize=240m
  -XX:+UseConcMarkSweepGC
  -XX:SoftRefLRUPolicyMSPerMB=50
  -ea
  -Dsun.io.useCanonCaches=false
  -Djava.net.preferIPv4Stack=true
  -XX:+HeapDumpOnOutOfMemoryError
  -XX:-OmitStackTraceInFastThrow
  -Dawt.useSystemAAFontSettings=lcd
  -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine
  -Djava2d.font.loadFontConf=false
  </code></pre>
  
  <p>Adding or removing the last property simply makes zero difference, also changing from <code>lcd</code> to <code>on</code> or <code>off</code> has zero effect.</p>
  
  <p>Compare these pictures to the regular OpenJDK 1.8.0_121 that I installed via Debian:</p>
  
  <p><a href="https://i.stack.imgur.com/g6u6A.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g6u6A.png" alt="enter image description here"></a></p>
  
  <p>Clearly here the AA is broken (at 1:1 it looks totally coloured). So I think the subpixel rendering of the bundled version is basically <em>correct</em>. Only it uses the wrong gamma for light text on dark background.</p>
  
  <hr>
  
  <p><strong>Edit:</strong> After more investigation, the problem boils down to this: I can use a custom <code>font.conf</code> file with <code>hintstyle</code> between <code>hintslight</code>, <code>hintmedium</code> and <code>hintfull</code>. For slight hinting, the font looks balanced in terms of aspect ratio, but the anti-aliasing has wrong gamma, and so the font lines are thick (everything looks bold face). For medium or full hinting, the font appears more thin-lined and sharp, but now the aspect ratio is broken, the font is too wide.</p>