Open phronmophobic opened 2 years ago
For whatever reason, I do explicitly turn on anti aliasing when drawing to an image. I wonder if the same artifacts show up when running screenshot
.
I found these two references that might also help:
https://batsov.com/articles/2010/02/26/enable-aa-in-swing/ https://askubuntu.com/questions/636666/ugly-non-anti-aliased-fonts-in-java-swing-applications
Both recommend the following
// enable anti-aliasing
System.setProperty("awt.useSystemAAFontSettings","on");
System.setProperty("swing.aatext", "true");
// Alternatively (and if you do not have access to the source, or if you find this easier) you can simply pass
// the system properties above to the JVM by adding these options to the command line:
-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
As mentioned in https://github.com/phronmophobic/membrane.term/pull/14#issuecomment-977189391, the font rendering on linux using the java2d toolkit looks pretty rough.
Here are the screenshots from the linked comment:
clojure -M:membrane.term run-term --toolkit java2d --font-size 20
clojure -M:membrane.term:skia run-term --toolkit skia --font-size 20
Note: the way github displays the screenshots doesn't look so bad for the java2d toolkit, but if you look at the high resolution version, it should look obviously worse.