如何在Eclipse中为PackageExplorer中的树项目配置字体大小?
如何在Eclipse中为PackageExplorer/outline中的树项目配置字体大小如何在Eclipse中为PackageExplorer中的树项目配置字体大小?,eclipse,Eclipse,如何在Eclipse中为PackageExplorer/outline中的树项目配置字体大小 我应该更改首选项下字体中的哪一项?在2010年,Eclipse无法更改用于PackageExplorer和其他类似视图的字体。您只能更改编辑器视图的字体。这是Eclipse开发人员的一个策略决定(请参阅bug等)。(抱怨)所使用的字体是由您使用的任何桌面的总体外观设置的 在Linux上,调用Eclipse时可以覆盖系统字体。这是一本关于各种可能性的优秀著作,对此我有这个答案。我将从那里为后代重复一个建议
我应该更改首选项下字体中的哪一项?在2010年,Eclipse无法更改用于PackageExplorer和其他类似视图的字体。您只能更改编辑器视图的字体。这是Eclipse开发人员的一个策略决定(请参阅bug等)。(抱怨)所使用的字体是由您使用的任何桌面的总体外观设置的 在Linux上,调用Eclipse时可以覆盖系统字体。这是一本关于各种可能性的优秀著作,对此我有这个答案。我将从那里为后代重复一个建议。创建一个名为gtkrc eclipse的文件:
style "eclipse" {
font_name = "Sans Condensed 8"
}
class "GtkWidget" style "eclipse"
然后在调用eclipse时设置某个环境变量:
$ GTK2_RC_FILES=gtkrc-eclipse eclipse
您的Eclipse.ini文件是否包含对“smallFonts”的引用?在Mac上,您可能会看到类似于 -Dorg.eclipse.swt.internal.carbon.smallFonts
如果删除这一行,您将看到各种视图中的字体大小变大。Eclipse从操作系统继承GUI项目的字体大小。例如,对于演示,您可能希望增加操作系统的字体大小。在Windows 7上,您可以通过以下步骤影响许多Eclipse GUI字体,包括Project Explorer: 控制面板→ 个性化→ 窗户颜色和外观→ 高级外观设置 更改“消息框”的字体大小
当然,这会影响操作系统中其他东西的外观,但我发现,与眯着眼睛看project explorer相比,这是可以容忍的…使用ubuntu在eclipse工作区中更改字体, 我修改了系统字体桌面>系统>首选项>外观>字体
还修改了eclipse indigo->windows>首选项>常规>外观>颜色和字体。它反映在eclipse中。下面是一个在我的Windows7机器上工作的选项,建议使用: 在Juno上,您可以通过CSS调整字体 在eclipse\plugins\org.eclipse.platform\u 4.2.x.y\css中查找文件 对于您当前的样式表(可能是e4\u default\u win7.css),然后 只需添加以下规则:
#org-eclipse-jdt-ui-PackageExplorer Tree,
#org-eclipse-ui-navigator-ProjectExplorer Tree {
font-size: 10px; /* <-- Desired font size */
}
org eclipse jdt ui PackageExplorer树,
#OrgEclipseUI导航器项目浏览器树{
字体大小:10px;/*在Eclipsev4.2(Juno)中,您可以通过转到
菜单窗口→ 偏好→ 一般的→ 外表
在Windows 8中
仅更改文本大小
,选择消息框
这个答案适用于MacOSX用户。使用Mavericks(10.9.2)进行测试,但应适用于所有版本 正如前面的回答中所述,要在package explorer中更改字体大小,您需要更改系统字体大小。这里的问题就是要这样做。我的解决方案:
快乐的编码!我刚刚找到了在Eclipse中更改树视图字体大小的所有答案,尝试了几种,最后进入了CSS类,该类对我来说非常流行: 我使用的主题包括
eclipse/opt/plugins/platform/css
中的“e4_basestyle.css”
.MPart Tree {
font-size: 10;
}
这对我来说非常好(Ubuntu上的Eclipsev4.3-SR2(开普勒)。FYI:
从日食4.4(月亮)开始:
看起来CSS文件不再位于旧文件夹中:
eclipse/plugins/org.eclipse.platform_4.x.x.vy/css
它们将被移动到新文件夹:
eclipse/plugins/org.eclipse.ui.themes_x.x.x.vxxxxx/css
您必须在菜单中选择一个主题来应用它
窗户→ 偏好→ 一般的→ 外观正如前面有人提到的,在Eclipsev4.3(开普勒)和Windows8上修改“e4_basestyle.css”文件对我很有效 此外,我发现您还必须更改下的文本大小/样式 偏好→ 团队→ 吉特→ 唇形装饰 或 偏好→ 外表→ 颜色和字体,在Git部分下 确保未提交文件的文本大小/颜色与您的更改同步。当然,如果您将项目初始化为存储库,则需要这样做。对于Mac用户: 存档:
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css
查找以下代码段:
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;
}
添加有关字体大小的信息后对其进行修改:
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;
}
background-color: #2F2F2F;
color: #CCC;
font-size: 8;
此示例适用于Eclipsev4.4(Luna)中的黑暗主题。以下解决方案适用于带有Eclipsev4.4(Luna)的Mac OS 选择Mac外观:菜单窗口→ 偏好→ 一般的→ 外表→ 主题:Mac 添加中包含的以下代码段的副本
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/dark/e4-dark_globalstyle.css
到文件的末尾
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;
}
plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css/e4_default_mac.css。
树,
RegistryFilteredTree,
/*由于Bug 419482(请参阅),需要执行以下操作:*/
复合>树,
TabFolder>Composite>Tree,
TabFolder>Composite>*>树,
DocCommentOwnerComposite>Group>Tree,
选项卡文件夹>组合>滚动组合>树,
壳>复合>复合>树,
组合>组合>组合>组>树,
壳>复合>复合>复合>树,
滚动复合>复合>复合>复合>树,
壳>复合>复合>复合>复合>复合>复合>树,
Shell[style~='SWT.RADIO'][style~='SWT.CASCADE'][style~='SWT.SHADOW\u蚀刻在']
[style~='SWT.SHADOW\u ETCHED\u 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\u ETCHED\u IN'][style~='SWT.SHADOW\u ETCHED\u OUT']
[style~='SWT.RESIZE'][style~='SWT.MENU'][style~='SWT.FULL_SELECTION'][style~='SWT.DATE']>复合>*>树{
字号:13 ;;
}
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;
}
Tree,
RegistryFilteredTree,
background-color: #2F2F2F;
color: #CCC;
font-size: 8;
#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 */
}