How can I configure the font size for the tree item in the package explorer in Eclipse?
EclipseEclipse Problem Overview
How can I configure the font size for the tree item in the package explorer/outline in Eclipse?
Which item in Font under Preferences I should change?
Eclipse Solutions
Solution 1 - 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
Solution 2 - 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.
Solution 3 - Eclipse
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...
Solution 4 - Eclipse
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).
Solution 5 - Eclipse
This answer applies to Mac OS X user. Tested with Mavericks (10.9.2) but should work in all versions.
As stated before in previous answers, to change the font size in package explorer you need to change system font size. The problem here is to do exactly this. My solution:
- Download the free Tinker Tool utility and adjust font sizes.
- Restart Eclipse
The results:
Happy coding!
Solution 6 - Eclipse
Here is an option that works on my Windows7 machine suggested by Diego V: https://stackoverflow.com/a/15011440/1713920
> On Juno you can adjust that font by CSS. > > Lookup the files in eclipse\plugins\org.eclipse.platform_4.2.x.y\css > for your current style sheet (probably e4_default_win7.css), and then > just add the following rule: > > #org-eclipse-jdt-ui-PackageExplorer Tree, > #org-eclipse-ui-navigator-ProjectExplorer Tree { > font-size: 10px; /* <-- Desired font size */ > }
Solution 7 - Eclipse
Go into eclipse/plugins/org.eclipse.ui.themes_1.1.0.v{HERE_SOME_DIGITS}\css
.
Here you see your installed theme CSS files. Choose you theme, and add at the end of file (for example, e4_default_win7.css
):
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
font: Consolas; /* <-- Font you want to have */
}
It was tested with Eclipse v4.4 (Luna) and Eclipse v4.5 (Mars) on Windows 7.
Solution 8 - Eclipse
FYI:
From Eclipse v4.4 (Luna):
It looks like the CSS files are no longer in the old folder:
eclipse/plugins/org.eclipse.platform_4.x.x.vy/css
They are moved to the new folder:
eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css
And you must select a theme to apply it, in the menu
Windows → Preferences → General → Appearance
Solution 9 - Eclipse
Eclipse v4.5 (Mars) using the built-in dark theme on Linux.
eclipse/plugins/org.eclipse.ui.themes_1.1.0.v20150511-0913/css/dark/e4-dark_globalstyle.css
Around line 204, you can add your chosen font size:
background-color: #2F2F2F;
color: #CCC;
font-size: 8;
Solution 10 - Eclipse
As someone has already mentioned previously, modifying the "e4_basestyle.css" file worked for me on Eclipse v4.3 (Kepler) and Windows 8.
Also, I find that you must also change the text size/style under
Preferences → Team → Git → LabelDecorations
or
Preferences → Appearance → ColorsAndFonts, under the Git section.
to make sure that text size/colors for uncommitted files are in sync with your changes. This is of course if you initialise your project as a repository.
Solution 11 - Eclipse
Eclipse uses a system user interface font for Project Explorer, so you can change it with an OS-specific method. Note: Eclipse will have to be restarted even if other apps respond immediately to the font change.
- On Linux (Gnome), I was able to alter Eclipse's font with Gnome Tweak Tool (Applications → Utilities → Tweak Tool). If it's not already installed, try
sudo yum install gnome-tweak-tool
orsudo apt-get install gnome-tweak-tool
. In the Fonts page, change the Interface font. - On Windows 7, go to Control Panel → Personalization → Window Color and Appearance → Advanced Appearance Settings → Change the font size for "Message Box". (credit: Nathan Monteleone)
- On Mac, unpack the Tinker Tool, run it, go to the Fonts tab and adjust the size of Help tags (tested with Eclipse 2018-12).
Some other parts of Eclipse will also be affected, such as the startup dialog.
Solution 12 - Eclipse
Eclipse inherits the font size of the GUI items, from the operating system. For a demo for example you might want to increase the font size of your OS.
Solution 13 - Eclipse
The following solution works on Mac OS with Eclipse v4.4 (Luna).
Choose Mac appearance: menu Window → Preferences → General → Appearances → Theme: Mac.
Add a copy of the following code snippet contained in
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css
to the end of the file
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/e4_default_mac.css.
Tree,
RegistryFilteredTree,
/* The following are required due to Bug 419482 (see <1>): */
Composite > Tree,
TabFolder > Composite > Tree,
TabFolder > Composite > * > Tree,
DocCommentOwnerComposite > Group > Tree,
TabFolder > Composite > ScrolledComposite > Tree,
Shell > Composite > Composite > Tree,
Composite > Composite > Composite > Group > Tree,
Shell > Composite > Composite > Composite > Tree,
ScrolledComposite > Composite > Composite > Composite > Tree,
Shell > Composite > Composite > Composite > Composite > Composite > Tree,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU']
[style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Tree, Shell[style~='SWT.RADIO']
[style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT']
[style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Tree {
font-size: 13;
}
Solution 14 - Eclipse
In Windows 10,
at the left bottom corner click on the Windows symbol, enter "Display settings", then go to "Advanced display settings", then go to "Advanced sizing of text and other items", there You'll find "Change only the text size":
You'll see a list of
- Title Bars
- Menus
- Message Boxes
- Palette titles
- Icons
- Tooltips
Switch at least "Message Boxes" to font size e.g. 13 instead of 9 (for Eclipse Package Explorer Tree).
I would switch "Menus" also to font size 13 (for Eclipse main menu).
Or all of them :-)
Solution 15 - Eclipse
For Mac users:
In file:
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css
Find this code snippet:
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION']
[style~='SWT.DATE'] > Composite > * > Tree {
background-color: #2F2F2F;
color: #CCC;
}
Modify it adding information about the font size:
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN']
[style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION']
[style~='SWT.DATE'] > Composite > * > Tree {
background-color: #2F2F2F;
color: #CCC;
font-size: 13;
}
This example is for the Dark theme in Eclipse v4.4 (Luna).
Solution 16 - Eclipse
#Ubuntu, Eclipse v4.4 (Luna)*
-
Locate your:
eclipse/plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css
-
Pick the CSS file that you are using per Preferences → General → Appearance inside the Eclipse UI.
-
Backup the original and add something like the following, after first closing Eclipse just for safety:
.MPart Tree { font-size: 14; }
*It was performed on ScalaIDE version of Eclipse v4.4 (Luna) and should be the same for regular Eclipse v4.4 (Luna), I think.
Solution 17 - Eclipse
On Windows 10, if you got hit by the Creators Update:
The Windows 10 Creators Update apparently removed the ability to "Change only the text size" in "Display settings". In addition the update reset my previous text size setting so that I ended up with small font size in the tree items of the package explorer.
A solution that worked for me is to use a small tool 'A+ System Font Size Changer'. There, increasing the "Message box" setting to 4 (a custom unit defined by the tool) and applying the setting changed the font size in the items of the package explorer.
The tool also allows you to increase the size of "Menu", "Title bar", "Palette title", "Icon" (which worked wonders on the display of folders in windows explorer), and "Tooltip".
P.S.: I would have preferred to comment on the answer from Hartmut, but my reputation score is too low.
Solution 18 - Eclipse
In windows server,
go to control panel-->Display section. If default setting is Smaller like picture,you can change the size for your demand,also you can change only the specific text size by option
Note: It is applied based on system setting ,not only for Eclipse based platform.
Solution 19 - Eclipse
To change fonts in eclipse workspace with ubuntu, I modified system fonts desktop > system > preferences > appearance > fonts also modified eclipse indigo -> windows > preferences > General > Appearances > Colors and fonts. It reflected in eclipse.
Solution 20 - Eclipse
In Eclipse v4.2 (Juno) you can modify the CSS by going to menu Window → Preferences → General → Appearances.
Solution 21 - Eclipse
In Windows 8,
- go to Control Panel -> Appearance and Personalization -> Display
- In the middle of the screen there is a drop down under the heading
Change Only the Text Size
, selectMessage bokes
. - Change the font size in the adjacent drop down.
Solution 22 - Eclipse
In Eclipse v4.4 (Luna) Service Release 2 (4.4.2) under Windows 7:
If you select the "Windows" theme (Eclipse default configuration)
[Window => Preferences => General->Appearance -> Theme: Windows]
You could add the following code snippet into below css file.
[Eclipse root folder]\plugins\org.eclipse.ui.themes_x.x.x.vxxxxxxxx-xxxx\css\e4_default_win7.css
Tree,
RegistryFilteredTree,
/* the following are required due to Bug 419482 (see <1>): */
Composite > Tree,
TabFolder > Composite > Tree,
TabFolder > Composite > * > Tree,
DocCommentOwnerComposite > Group > Tree,
TabFolder > Composite > ScrolledComposite > Tree,
Shell > Composite > Composite > Tree,
Composite > Composite > Composite > Group > Tree,
Shell > Composite > Composite > Composite > Tree,
ScrolledComposite > Composite > Composite > Composite > Tree,
Shell > Composite > Composite > Composite > Composite > Composite > Tree,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > Tree,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW_ETCHED_IN'][style~='SWT.SHADOW_ETCHED_OUT'][style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE'] > Composite > * > Tree {
font-size: 13;
}
The value of font-size could be set as wish.
If you install other customized theme packages such as the Eclipse Moonrise UI Theme from Eclipse Marketplace, there will be the JAR file under [Eclipse root folder]\plugins
(Example: com.github.eclipseuitheme.themes.moonrise-ui_0.8.9.201404052318.jar)
Modify below the CSS files in this JAR file
\themes\css\moonrise-ui-standalone.css and moonrise-ui-standalone_WIN.css
There is similar code section in these CSS files starting with:
Tree,
RegistryFilteredTree,
Add the "font-size:13;" like the above code snippet and apply via the below steps.
Menu Window → Preferences → General → Appearance → Theme: MoonRise (standalone)
Solution 23 - Eclipse
I have two screens, a small and a large one. Eclipse is using the size settings from the "main screen". In my case that was a small screen with a scaling of 150%.
Switching the main screen to the large screen resolved the size issues for me.
Solution 24 - Eclipse
In Windows 10 Environements it is not possible to change the text size of the package explorer within Eclipse. he only thing you can do is to change the text size in the OS settings.
Go to Settings (Windows + I) then Ease of Access then Display.
There you can change the text size in the "Make text bigger" section. This applies directly to the package explorer in Eclipse.