How can I configure the font size for the tree item in the package explorer in Eclipse?
In 2010, there was no way in Eclipse to change the font used for Package Explorer and other such views. You can only change the font for editor views. This is a policy decision on the part of the Eclipse developers (see, e.g., bugs 49548, 202091). (Grumble.) The font used is the one set by the general look-and-feel for whatever desktop you are using.
On Linux it is possible to override the system font when you invoke Eclipse. An excellent writeup of various possibilities is here, to which I owe this answer. I'll repeat one suggestion from there for posterity. Create a file named, say, gtkrc-eclipse:
style "eclipse" {
font_name = "Sans Condensed 8"
}
class "GtkWidget" style "eclipse"
Then set a certain environment variable when invoking eclipse:
$ GTK2_RC_FILES=gtkrc-eclipse eclipse
Does your Eclipse .ini file contain a reference to 'smallFonts?' On Mac you might see something like...
-Dorg.eclipse.swt.internal.carbon.smallFonts
If you remove this line, you'll see the font size in various views fatten up.
On Windows 7, you can affect many of the Eclipse GUI fonts, including the Project Explorer by going to:
Control Panel → Personalization → Window Color and Appearance → Advanced Appearance Settings
Change the font size for "Message Box".
Of course this messes with the appearance of other stuff in your OS, but I've found that tolerable compared to squinting at the project explorer...
I just found all those answers for changing the tree view font size in Eclipse, tried several and finally got on the CSS class which reads quite more fashionable to me:
The theme I'm using includes the "e4_basestyle.css" in eclipse/opt/plugins/platform/css
. There I added
.MPart Tree {
font-size: 10;
}
which works very fine with me (Eclipse v4.3-SR2 (Kepler) on Ubuntu).