Welcome! Anonymous

Infinality and OpenJDK - Patch

A place to ask questions, or discuss anything related to infinality.net stuff.

Infinality and OpenJDK - Patch

Postby infinality » Sat Dec 08, 2012 4:19 pm

Found a openjdk patch here that makes java obey fontconfig! The biggest impact is that it allows for *slight hinting* which is where the magic happens in Infinality patches. So, no more crappy looking java progs!
https://gist.github.com/2893461

It required some modification in order to work with the latest Fedora openjdk package.
http://koji.fedoraproject.org/koji/buil ... dID=371294

My version of the patch (that works with Fedora's current release) is here:
http://infinality.net/files/openjdk-obe ... nfig.patch

Also, in order to make the java UI font be the same as your system font, you have to create a file called fontconfig.properties (varies by distro) in the jdk's /jre/lib/ directory. Here's mine from Fedora. Search for "segoeui" and replace the paths with the paths of the fonts you want java to use.
http://infinality.net/files/fontconfig.properties

:ugeek:
- Linux font rendering has gone from the most reviled to the most renowned.
User avatar
infinality
Site Admin
 
Posts: 736
Joined: Wed Oct 20, 2010 7:57 am
Location: Wisconsin, USA

Re: Infinality and OpenJDK - Patch

Postby lemonzest » Sat Dec 08, 2012 4:33 pm

Any example screen shots of before/after?
AMD Phenom II x6 1090T@3.6/4Ghz, MSI 870-C45, 16GB A-Data DDR3 1333Mhz
Sapphire Radeon HD6670 2GB, 4x 1TB Samsung HDDs, ASUS Xonar D1, C-Media 8738
Samsung 23" 2343nw@ 2048x1152, Bush HDMI@ 1920x1080
lemonzest
 
Posts: 29
Joined: Tue Jul 05, 2011 6:06 pm

Re: Infinality and OpenJDK - Patch

Postby infinality » Sat Dec 08, 2012 6:40 pm

Well, I don't have a before, but here's jconsole after.
Attachments
jconsole.png
jconsole.png (50.52 KiB) Viewed 14193 times
- Linux font rendering has gone from the most reviled to the most renowned.
User avatar
infinality
Site Admin
 
Posts: 736
Joined: Wed Oct 20, 2010 7:57 am
Location: Wisconsin, USA

Re: Infinality and OpenJDK - Patch

Postby tangent » Mon Dec 10, 2012 8:50 pm

I've spent quite a while messing with the same patch on ubuntu but have yet to get it to use slight hinting.

The patch definitely improves font rendering in swing apps, and makes them follow my AA settings properly (without having to force it in the vmoptions). However, I'm still getting full hinting no matter what level I set the hinting at. I've tried messing around with the Xresources settings, using patched and unpatched freetype libs, using the java2d Xrender pipeline, etc.. nothing seems to work.

Is there any pointers you can give on other things I might try to figure out why its not using slight hinting?
tangent
 
Posts: 2
Joined: Mon Dec 10, 2012 4:24 pm

Re: Infinality and OpenJDK - Patch

Postby infinality » Mon Dec 10, 2012 9:17 pm

tangent wrote:I've spent quite a while messing with the same patch on ubuntu but have yet to get it to use slight hinting.

The patch definitely improves font rendering in swing apps, and makes them follow my AA settings properly (without having to force it in the vmoptions). However, I'm still getting full hinting no matter what level I set the hinting at. I've tried messing around with the Xresources settings, using patched and unpatched freetype libs, using the java2d Xrender pipeline, etc.. nothing seems to work.

Is there any pointers you can give on other things I might try to figure out why its not using slight hinting?


What do you get when you run:

Code: Select all
which java


Whatever path you get, follow it (if it's a symlink) and see where it ends up. You're likely running a different JRE than you think you are. At least, that's what happened to me a couple times.

:ugeek:


EDIT: If that doesn't work, try running strace and seeing which freetype libs are getting loaded. They should be the infinality ones.

Code: Select all
strace -F jconsole 2>&1 | grep freetype
- Linux font rendering has gone from the most reviled to the most renowned.
User avatar
infinality
Site Admin
 
Posts: 736
Joined: Wed Oct 20, 2010 7:57 am
Location: Wisconsin, USA

Re: Infinality and OpenJDK - Patch

Postby tangent » Wed Dec 12, 2012 1:59 pm

I solved my problem, I was using a patched version of openjdk but apparently it wasn't patched correctly =)

For anyone else on ubuntu 12.10, I found one that works properly here: https://launchpad.net/~no1wantdthisname ... dk-fontfix

also the same package maintainer has infinality patched freetype for ubuntu 12.10 here:
https://launchpad.net/~no1wantdthisname/+archive/ppa

Finally, Jetbrains IDEA looks halfway decent!
tangent
 
Posts: 2
Joined: Mon Dec 10, 2012 4:24 pm

Re: Infinality and OpenJDK - Patch

Postby infinality » Wed Dec 12, 2012 4:10 pm

tangent wrote:https://launchpad.net/~no1wantdthisname/+archive/openjdk-fontfix


They have a great example there of before / after:

E.G. Intellij Idea 12 with Lucida Grande/Consolas
before (jdk 1.7): http://i.imgur.com/wzVVm.png
after (this repo's openjdk 1.7): http://i.imgur.com/BwVk4.png


EDIT: While the patched version here looks blurry, it's worth noting that this blurriness can be controlled with the infinality patches. The letters also don't look as "constrained" (i.e. forced) in the patched version. I think a black on white background would do it a bit more justice, actually.
- Linux font rendering has gone from the most reviled to the most renowned.
User avatar
infinality
Site Admin
 
Posts: 736
Joined: Wed Oct 20, 2010 7:57 am
Location: Wisconsin, USA

Re: Infinality and OpenJDK - Patch

Postby slow » Sat Dec 15, 2012 12:13 am

That's actually my repo.

I used the defaults to make the screenshot. Is that not how it looks in fedora?
slow
 
Posts: 2
Joined: Thu Dec 13, 2012 2:50 am

Re: Infinality and OpenJDK - Patch

Postby infinality » Sat Dec 15, 2012 12:22 am

slow wrote:That's actually my repo.

I used the defaults to make the screenshot. Is that not how it looks in fedora?


Well, I can't say since I don't use that prog or light text on black! But, it's at least plausible. From what I understand, if you have sharp text with black text on white, you'll have blurry text with white text on black. Kinda makes sense, when the part that combines them doesn't know one from the other. Still, it looks way better than the default, IMO. :)

Thanks for putting that out there... the more people that help out this effort, the more demand there is for fonts to render nicely under free software operating systems.

:ugeek:

It's possible that you could adjust the LCD filter environment variable to get sharper text. I guess I can see others complaining about how blurry it is. ;) I've been in this business long enough!
- Linux font rendering has gone from the most reviled to the most renowned.
User avatar
infinality
Site Admin
 
Posts: 736
Joined: Wed Oct 20, 2010 7:57 am
Location: Wisconsin, USA

Re: Infinality and OpenJDK - Patch

Postby peteralm » Mon Feb 11, 2013 2:45 am

I created a arch linux package for this patch. It's available at https://aur.archlinux.org/packages/jre7 ... s-fontfix/ Enjoy!
peteralm
 
Posts: 1
Joined: Sun Feb 10, 2013 12:57 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests