After installing Ubuntu Hardy on my new laptop, I noticed a few slight problems. Firefox would sometimes display ugly large fonts, no matter what I set up in its preferences.
It turns out something is weird with the DPI settings – probably something in Ubuntu, but I’m not sure. Anyway, after some googling I found out how to just override the DPI detection and set it to a good value. Go to about:config and set layout.css.dpi to 96 (or whatever your display’s DPI is – I found 96 to be good on a normal laptop screen). And all of a sudden, fonts look nice.
Something very similar was happening in the Javadoc viewer of Eclipse. The fonts were much too large, and curiously didn’t respond to preference changes in Eclipse either. Of course, on Linux Eclipse just uses Mozilla’s rendering engine to display Javadoc, since Javadoc is basically HTML. But Eclipse provides no interface to set preferences on the embedded Mozilla. Again, Google to the rescue. The “profile” used by Eclipse’s embedded Mozilla is at ~/.mozilla/eclipse. And if you know your way around these profiles, you can now do basically anything. To apply the above setting, simply append this to the file prefs.js:
user_pref("layout.css.dpi", 96);
And lo and behold, the Javadoc view is no longer an eyesore.
Thanks!