How can I configure the font size for the tree item in the package explorer in Eclipse?

Eclipse

Eclipse 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 → PersonalizationWindow Color and AppearanceAdvanced 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:

  1. Download the free Tinker Tool utility and adjust font sizes.
  2. Restart Eclipse

enter image description here

The results:

enter image description here

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

WindowsPreferencesGeneralAppearance

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

PreferencesTeamGitLabelDecorations

or

PreferencesAppearanceColorsAndFonts, 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 or sudo 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 WindowPreferencesGeneralAppearancesTheme: 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)*

  1. Locate your: eclipse/plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css

  2. Pick the CSS file that you are using per PreferencesGeneralAppearance inside the Eclipse UI.

  3. 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. 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 WindowPreferencesGeneralAppearances.

Enter image description here

Solution 21 - Eclipse

In Windows 8,

  1. go to Control Panel -> Appearance and Personalization -> Display
  2. In the middle of the screen there is a drop down under the heading Change Only the Text Size, select Message bokes.
  3. 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 WindowPreferencesGeneralAppearanceTheme: 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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmichaelView Question on Stackoverflow
Solution 1 - EclipseDan HalbertView Answer on Stackoverflow
Solution 2 - EclipseRick WinscotView Answer on Stackoverflow
Solution 3 - EclipseNathan MonteleoneView Answer on Stackoverflow
Solution 4 - EclipsewambachView Answer on Stackoverflow
Solution 5 - EclipseDiego FrenicheView Answer on Stackoverflow
Solution 6 - Eclipsevir usView Answer on Stackoverflow
Solution 7 - EclipseVitalijView Answer on Stackoverflow
Solution 8 - EclipseLi YingView Answer on Stackoverflow
Solution 9 - EclipseDylanView Answer on Stackoverflow
Solution 10 - EclipseindoballerView Answer on Stackoverflow
Solution 11 - EclipseQwertieView Answer on Stackoverflow
Solution 12 - EclipseTobiasView Answer on Stackoverflow
Solution 13 - EclipsePokaFaceView Answer on Stackoverflow
Solution 14 - EclipseHartmut PfarrView Answer on Stackoverflow
Solution 15 - Eclipseuser1344271View Answer on Stackoverflow
Solution 16 - EclipsematansterView Answer on Stackoverflow
Solution 17 - EclipsejechterhoffView Answer on Stackoverflow
Solution 18 - EclipseK.Andy WangView Answer on Stackoverflow
Solution 19 - EclipseMallikView Answer on Stackoverflow
Solution 20 - EclipseSharifView Answer on Stackoverflow
Solution 21 - EclipseSGT Grumpy PantsView Answer on Stackoverflow
Solution 22 - EclipseGinuinbuView Answer on Stackoverflow
Solution 23 - EclipseStefanView Answer on Stackoverflow
Solution 24 - EclipseM46View Answer on Stackoverflow