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

前端 未结 23 783
孤城傲影
孤城傲影 2020-11-29 16:33

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?

相关标签:
23条回答
  • 2020-11-29 17:06

    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.

    0 讨论(0)
  • 2020-11-29 17:07

    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 */
    }
    
    0 讨论(0)
  • 2020-11-29 17:07

    In Eclipse v4.2 (Juno) you can modify the CSS by going to menu WindowPreferencesGeneralAppearances.

    Enter image description here

    0 讨论(0)
  • 2020-11-29 17:11

    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.

    0 讨论(0)
  • 2020-11-29 17:13

    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.

    0 讨论(0)
  • 2020-11-29 17:16

    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;
    
    0 讨论(0)
提交回复
热议问题