Setting LCD gamma / contrast (IntelliJ IDEA, JDK 8)












22















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:



enter image description here



But the gamma is wrong for bright-on-dark text:



enter image description here



Which means in this scheme, text looks as if it was bold-face and horizontally smeared/fuzzy.



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).





Edit: 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 idea64.jvmoptions:



custom IntelliJ IDEA VM options



-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


Adding or removing the last property simply makes zero difference, also changing from lcd to on or off has zero effect.



Compare these pictures to the regular OpenJDK 1.8.0_121 that I installed via Debian:



enter image description here



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 correct. Only it uses the wrong gamma for light text on dark background.





Edit: After more investigation, the problem boils down to this: I can use a custom font.conf file with hintstyle between hintslight, hintmedium and hintfull. 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.










share|improve this question

























  • See gist.github.com/CrazyCoder/0d9e54f450000d3fb6edcbda6d9788be.

    – CrazyCoder
    Mar 29 '17 at 12:39






  • 1





    @CrazyCoder thanks - I was in fact already using the updated JDK that the gist mentions, as I installed the release version of IDEA. So my question is, if it is possible to tune the AA gamma value that is used by the renderer.

    – 0__
    Mar 29 '17 at 15:40






  • 1





    JDK in gist is not the same as in the release version.

    – CrazyCoder
    Mar 29 '17 at 15:43











  • @CrazyCoder I tried that one as well, but output looks completely identical to first two images. Also toggling the -Djava2d.font.loadFontConf=false has no effect at all. It seems the rendering is hardcoded, using off instead of lcd doesn't have any effect, either.

    – 0__
    Mar 29 '17 at 15:54











  • Your font is too large to be affected by the settings. Either create custom font.conf or modify the one inside JetBrains Runtime lib/fonts/font.conf and use -Djava2d.font.loadFontConf=true to load this customized config.

    – CrazyCoder
    Mar 30 '17 at 8:57


















22















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:



enter image description here



But the gamma is wrong for bright-on-dark text:



enter image description here



Which means in this scheme, text looks as if it was bold-face and horizontally smeared/fuzzy.



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).





Edit: 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 idea64.jvmoptions:



custom IntelliJ IDEA VM options



-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


Adding or removing the last property simply makes zero difference, also changing from lcd to on or off has zero effect.



Compare these pictures to the regular OpenJDK 1.8.0_121 that I installed via Debian:



enter image description here



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 correct. Only it uses the wrong gamma for light text on dark background.





Edit: After more investigation, the problem boils down to this: I can use a custom font.conf file with hintstyle between hintslight, hintmedium and hintfull. 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.










share|improve this question

























  • See gist.github.com/CrazyCoder/0d9e54f450000d3fb6edcbda6d9788be.

    – CrazyCoder
    Mar 29 '17 at 12:39






  • 1





    @CrazyCoder thanks - I was in fact already using the updated JDK that the gist mentions, as I installed the release version of IDEA. So my question is, if it is possible to tune the AA gamma value that is used by the renderer.

    – 0__
    Mar 29 '17 at 15:40






  • 1





    JDK in gist is not the same as in the release version.

    – CrazyCoder
    Mar 29 '17 at 15:43











  • @CrazyCoder I tried that one as well, but output looks completely identical to first two images. Also toggling the -Djava2d.font.loadFontConf=false has no effect at all. It seems the rendering is hardcoded, using off instead of lcd doesn't have any effect, either.

    – 0__
    Mar 29 '17 at 15:54











  • Your font is too large to be affected by the settings. Either create custom font.conf or modify the one inside JetBrains Runtime lib/fonts/font.conf and use -Djava2d.font.loadFontConf=true to load this customized config.

    – CrazyCoder
    Mar 30 '17 at 8:57
















22












22








22


3






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:



enter image description here



But the gamma is wrong for bright-on-dark text:



enter image description here



Which means in this scheme, text looks as if it was bold-face and horizontally smeared/fuzzy.



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).





Edit: 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 idea64.jvmoptions:



custom IntelliJ IDEA VM options



-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


Adding or removing the last property simply makes zero difference, also changing from lcd to on or off has zero effect.



Compare these pictures to the regular OpenJDK 1.8.0_121 that I installed via Debian:



enter image description here



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 correct. Only it uses the wrong gamma for light text on dark background.





Edit: After more investigation, the problem boils down to this: I can use a custom font.conf file with hintstyle between hintslight, hintmedium and hintfull. 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.










share|improve this question
















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:



enter image description here



But the gamma is wrong for bright-on-dark text:



enter image description here



Which means in this scheme, text looks as if it was bold-face and horizontally smeared/fuzzy.



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).





Edit: 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 idea64.jvmoptions:



custom IntelliJ IDEA VM options



-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


Adding or removing the last property simply makes zero difference, also changing from lcd to on or off has zero effect.



Compare these pictures to the regular OpenJDK 1.8.0_121 that I installed via Debian:



enter image description here



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 correct. Only it uses the wrong gamma for light text on dark background.





Edit: After more investigation, the problem boils down to this: I can use a custom font.conf file with hintstyle between hintslight, hintmedium and hintfull. 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.







java intellij-idea java-2d antialiasing text-rendering






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 11 '17 at 11:46







0__

















asked Mar 29 '17 at 12:35









0__0__

49.8k13128211




49.8k13128211













  • See gist.github.com/CrazyCoder/0d9e54f450000d3fb6edcbda6d9788be.

    – CrazyCoder
    Mar 29 '17 at 12:39






  • 1





    @CrazyCoder thanks - I was in fact already using the updated JDK that the gist mentions, as I installed the release version of IDEA. So my question is, if it is possible to tune the AA gamma value that is used by the renderer.

    – 0__
    Mar 29 '17 at 15:40






  • 1





    JDK in gist is not the same as in the release version.

    – CrazyCoder
    Mar 29 '17 at 15:43











  • @CrazyCoder I tried that one as well, but output looks completely identical to first two images. Also toggling the -Djava2d.font.loadFontConf=false has no effect at all. It seems the rendering is hardcoded, using off instead of lcd doesn't have any effect, either.

    – 0__
    Mar 29 '17 at 15:54











  • Your font is too large to be affected by the settings. Either create custom font.conf or modify the one inside JetBrains Runtime lib/fonts/font.conf and use -Djava2d.font.loadFontConf=true to load this customized config.

    – CrazyCoder
    Mar 30 '17 at 8:57





















  • See gist.github.com/CrazyCoder/0d9e54f450000d3fb6edcbda6d9788be.

    – CrazyCoder
    Mar 29 '17 at 12:39






  • 1





    @CrazyCoder thanks - I was in fact already using the updated JDK that the gist mentions, as I installed the release version of IDEA. So my question is, if it is possible to tune the AA gamma value that is used by the renderer.

    – 0__
    Mar 29 '17 at 15:40






  • 1





    JDK in gist is not the same as in the release version.

    – CrazyCoder
    Mar 29 '17 at 15:43











  • @CrazyCoder I tried that one as well, but output looks completely identical to first two images. Also toggling the -Djava2d.font.loadFontConf=false has no effect at all. It seems the rendering is hardcoded, using off instead of lcd doesn't have any effect, either.

    – 0__
    Mar 29 '17 at 15:54











  • Your font is too large to be affected by the settings. Either create custom font.conf or modify the one inside JetBrains Runtime lib/fonts/font.conf and use -Djava2d.font.loadFontConf=true to load this customized config.

    – CrazyCoder
    Mar 30 '17 at 8:57



















See gist.github.com/CrazyCoder/0d9e54f450000d3fb6edcbda6d9788be.

– CrazyCoder
Mar 29 '17 at 12:39





See gist.github.com/CrazyCoder/0d9e54f450000d3fb6edcbda6d9788be.

– CrazyCoder
Mar 29 '17 at 12:39




1




1





@CrazyCoder thanks - I was in fact already using the updated JDK that the gist mentions, as I installed the release version of IDEA. So my question is, if it is possible to tune the AA gamma value that is used by the renderer.

– 0__
Mar 29 '17 at 15:40





@CrazyCoder thanks - I was in fact already using the updated JDK that the gist mentions, as I installed the release version of IDEA. So my question is, if it is possible to tune the AA gamma value that is used by the renderer.

– 0__
Mar 29 '17 at 15:40




1




1





JDK in gist is not the same as in the release version.

– CrazyCoder
Mar 29 '17 at 15:43





JDK in gist is not the same as in the release version.

– CrazyCoder
Mar 29 '17 at 15:43













@CrazyCoder I tried that one as well, but output looks completely identical to first two images. Also toggling the -Djava2d.font.loadFontConf=false has no effect at all. It seems the rendering is hardcoded, using off instead of lcd doesn't have any effect, either.

– 0__
Mar 29 '17 at 15:54





@CrazyCoder I tried that one as well, but output looks completely identical to first two images. Also toggling the -Djava2d.font.loadFontConf=false has no effect at all. It seems the rendering is hardcoded, using off instead of lcd doesn't have any effect, either.

– 0__
Mar 29 '17 at 15:54













Your font is too large to be affected by the settings. Either create custom font.conf or modify the one inside JetBrains Runtime lib/fonts/font.conf and use -Djava2d.font.loadFontConf=true to load this customized config.

– CrazyCoder
Mar 30 '17 at 8:57







Your font is too large to be affected by the settings. Either create custom font.conf or modify the one inside JetBrains Runtime lib/fonts/font.conf and use -Djava2d.font.loadFontConf=true to load this customized config.

– CrazyCoder
Mar 30 '17 at 8:57














1 Answer
1






active

oldest

votes


















0














Since you are running Linux, why not download the version without the JDK: https://www.jetbrains.com/idea/download/download-thanks.html?platform=linuxWithoutJDK






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43093692%2fsetting-lcd-gamma-contrast-intellij-idea-jdk-8%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Since you are running Linux, why not download the version without the JDK: https://www.jetbrains.com/idea/download/download-thanks.html?platform=linuxWithoutJDK






    share|improve this answer




























      0














      Since you are running Linux, why not download the version without the JDK: https://www.jetbrains.com/idea/download/download-thanks.html?platform=linuxWithoutJDK






      share|improve this answer


























        0












        0








        0







        Since you are running Linux, why not download the version without the JDK: https://www.jetbrains.com/idea/download/download-thanks.html?platform=linuxWithoutJDK






        share|improve this answer













        Since you are running Linux, why not download the version without the JDK: https://www.jetbrains.com/idea/download/download-thanks.html?platform=linuxWithoutJDK







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 1:21









        JayenJayen

        2,58012448




        2,58012448
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f43093692%2fsetting-lcd-gamma-contrast-intellij-idea-jdk-8%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith