Question

This is a weird one. I've been using Eclipse on Linux for years, with Inconolata as my fixed-width font of choice. I've recently switched to giving Kubuntu 11.10 a try, and at the same time upgraded to Eclipse Indigo. The problem I'm now having is that the fixed-width characters don't align vertically in the editor pane. Here's an image to illustrate (there are no tabs in this sample, not that that should matter anyway):

screen grab from Eclipse editor window

This is a screen grab, scaled 2x in the Gimp. I've added some guide lines to highlight the issue.

In all the time I've been using Eclipse on Linux, I've never had anything like this. I don't know whether it's a KDE problem, an Eclipse problem, or some other weird thing. dpkg reports that this is version 001.010-2 of ttf-inconolata.

Any suggestions for debugging for fixing this would be very welcome!

Was it helpful?

Solution

So after some digging, I found the answer. In my ~/.fonts.config, I set the autohint property because otherwise some of the fonts, e.g. in Firefox or pidgin are rendered too small or too thin. However, autohinting screws up fixed-width character alignment in Eclipse - I don't know why, and would welcome an explanation.

The fix was to turn off autohinting for just Inconsolata. So in .fonts.config, I have:

<match target="font">
 <test name="family" compare="eq" qual="any"><string>Inconsolata</string></test>
 <edit name="autohint" mode="assign"><bool>false</bool></edit> 
 <edit name="hintstyle" mode="assign"><const>hintnone</const></edit> 
</match>

and all is well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top