完美调整Ubuntu下的Eclipse字体及界面显示

我的Ubuntu一直是通过一些常见的美化方法,安装一些商业字体的方式进行美化,用下来也来看得过去,但是,近来工作需要,较多的使用eclipse,发现eclipse在linux下明显字体偏大,和当年习惯的windows平台上的显示相对,浪费大量屏幕空间不说,感觉自己一下就到了老花眼要看大字报的悲凉感觉。

心有不甘之余,开始google,找到这个字体包:

ttf-liberation - Free fonts with the same metrics as Times, Arial and Courier

号称使用了和习惯上相同的最美观的metrics,可以通过apt-get安装:

sudo apt-get install ttf-liberation

安装完成之后,打开字体属性,把“应用程序/文档/桌面”字体都调整为Liberation Sans 9,“窗口标题”字体调整为Liberation Sans Bold 9,“等宽”字体调整为Liberation Mono 9;如果是高分屏,可以把字体大小调整为10。字体渲染可以自己调整到满意为止。

这样调整后,如果eclipse使用默认的系统字体的话,基本上还看得过去了,不过导航树的缩进还是过宽,可以通过在~/.gtkrc-2.0中加入以下内容:

style "gtkcompact" {
font_name="Sans 8"
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkExpander::expander_size=10
GtkExpander::expander_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::expander-size=8
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
class "GtkWidget" style "gtkcompact"

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/27465.html