<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>niceType &#187; Theme</title>
	<atom:link href="http://www.nicetype.com/tag/theme/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nicetype.com</link>
	<description>君子风是一种操守</description>
	<lastBuildDate>Wed, 20 Jan 2010 06:23:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Arch Linux: KDE 环境下的 Gtk 程序美化问题</title>
		<link>http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/</link>
		<comments>http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 03:01:36 +0000</pubDate>
		<dc:creator>Bodhi</dc:creator>
				<category><![CDATA[Linux 实践论]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Gtk]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://www.nicetype.com/?p=370</guid>
		<description><![CDATA[KDE 本身使用 Qt 进行开发，可以为原生的 Qt 程序提供系统的界面资源。但很多优秀软件使用 Gtk 开发，为了使其在 KDE 环境下和系统视觉风格一致需要做一些美化工作（我恨用户美化 :x 个性开放得像 SNS 一样，少了执著多了迷失）。本文讨论了 KDE 下 Gtk 风格、配色、字体的相关配置工作。]]></description>
			<content:encoded><![CDATA[<p>喜欢 KDE 不喜欢 Gnome —— 这是个个人喜好和应用程度的选择，我们并没有也无法否定 Gnome 在桌面领域的杰出成就 <img src='http://www.nicetype.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  就我而言安装之后能尽快的完成审美核查并进入实用阶段就很好。</p>
<p>KDE 的默认主题窗体设计平滑配色冷峻，整体感觉冷静平实，Oxygen 图标有些扎眼但是看久了也就无视了。</p>
<p>KDE 本身使用 Qt 进行开发，可以为原生的 Qt 程序提供系统的界面资源。但仍有很多优秀软件使用 Gtk 开发，为了使其在 KDE 环境下和系统视觉风格一致需要做一些美化工作（我恨用户美化 <img src='http://www.nicetype.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' />  个性开放得像 SNS 一样，少了执著多了迷失）。<span id="more-370"></span></p>
<h4><strong>什么是主题？</strong></h4>
<p>一般来说：主题=风格+图标组+配色+字体<br />
英文的说：Theme/Appearance = Style + Colors Scheme + Icons set + Fonts</p>
<p><strong>风格</strong>（窗体边框+控件风格）——指的是窗体和控件的外观表现，包括贴图、边角设计等；<br />
<strong>图标组</strong>——指的是整个系统所使用的所有的图标的集合，他们基于一个既定的映射关系，只要遵循这种关系的图标组都可以用来替换当前所用的；<br />
<strong>配色</strong>——指的是 UI 设计过程中所用的纯色参数的集合，例如某处文本的颜色、某处阴影的颜色、某个控件在不同激活状态下的色彩表现，同样基于既定的映射关系可被替换；<br />
<strong>字体</strong>——“字体”在中文中是一个很容易混淆的概念，这里指的是系统各处文本所用字体族（font-family: serif, sans-serif, mono ...）、电脑字体名称（中易宋体/Simsun, 华文细黑/STXihei ...）、风格（常规、斜体、加粗 ...）、字号（10pt, 13px ...）的集合；</p>
<p>以上几种资源都遵循着既定的映射关系，例如只要是按钮资源我们都必须命名为 buttons.png，只要依照这种关系来制作或组装出来的美化资源都可以用以替换当前所用。</p>
<p>将以上几种视觉资源合理搭配便形成桌面的“主题”。</p>
<h4><strong>Gtk 和 KDE/Qt 默认主题风格差异</strong></h4>
<p>我们知道 Qt 和 Gtk 都可以进行图形界面应用程序的开发，而二者预设的“主题”却是不同的。当我们在一个环境中使用另一种环境开发出的程序时就可能出现观感的冲突，例如下图：</p>
<div id="attachment_371" class="wp-caption aligncenter" style="width: 410px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><a href="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-02.png"><img src="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-02-400x310.png" alt="gtk-in-kde-02-contrast-of-gtk-and-kde" title="gtk-in-kde-02-contrast-of-gtk-and-kde" width="400" height="310" class="size-medium wp-image-371" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">常见 Linux 桌面主题的对比</p></div>
<p>这是用 gtk-switch2 调用常见桌面风格的预览对比，由后至前依次是 Raleigh、Clearlooks、KDE 4 Oxygen。其中 Raleigh 较为接近原生无贴图的 Gtk 风格，KDE 4 Oxygen 较为接近 KDE 4.3.3 所用的 Oxygen 风格。也就是说，如果不做美化，在 KDE 中安装 gvim、pidgin、Firefox、Eclipse、GIMP 等 Gtk 程序所得到的外观是近似 Raleigh 的，美丑无法定论，至少是不统一。</p>
<h4><strong>统一 Qt 和 Gtk 程序外观</strong></h4>
<p>看到了二者的差别，我们要做的就是为 Gtk 程序指定一套完整的模仿所在环境风格的主题资源，又或者将二者同时更换为第三方的风格。</p>
<p><strong>为 Qt/Gtk 同时指定第三方主题风格： QtCurve</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># pacman -S qtcurve-gtk2 qtcurve-kde3 qtcurve-kde4</span></pre></div></div>

<p>通过安装 QtCurve 一系列包可以获得适用于 Gtk2、Qt3、Qt4 各种环境的统一的风格和配色。之后我们在相应的配置中分别指向 QtCurve 即可。</p>
<div id="attachment_372" class="wp-caption aligncenter" style="width: 410px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><a href="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-03.png"><img src="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-03-400x238.png" alt="gtk-in-kde-03-QtCurve" title="gtk-in-kde-03-QtCurve" width="400" height="238" class="size-medium wp-image-372" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">QtCurve 和 KDE 4.3.3 视觉风格对比</p></div>
<p>我们看到 QtCurve（右） 类似于 KDE 4.3.3 Oxygen（左），但有一些差异。</p>
<p>为 Qt 程序指定 QtCurve：System Settings - Appearance - Style - Widget style - QtCurve；System Settings - Appearance - Colors - Scheme - QtCurve；System Settings - Appearance - Windows - Window Decoration - QtCurve；</p>
<p>为 Gtk 程序指定 QtCurve：安装 gtk-chtheme、gtk-theme-switch4（执行 switch4） 等 Gtk 主题指定工具或者直接修改 ~/.gtkrc-2.0 或 ~/.gtkrc-2.0-kde4 文件即可.我的示例，</p>

<div class="wp_syntax"><div class="code"><pre class="config" style="font-family:monospace;"># -- THEME AUTO-WRITTEN DO NOT EDIT
# 修改 qtcurve 为你预先安装的 Gtk 主题，路径如下
include &quot;/usr/share/themes/qtcurve/gtk-2.0/gtkrc&quot;
# 这是为 Gtk 程序指定界面字体设置，稍后讨论
style &quot;user-font&quot; {
	font_name = &quot;Segoe UI Symbol 10&quot;
}
&nbsp;
widget_class &quot;*&quot; style &quot;user-font&quot;
&nbsp;
gtk-font-name=&quot;Segoe UI Symbol 10&quot;
&nbsp;
include &quot;/home/bodhi/.gtkrc.mine&quot;
&nbsp;
# -- THEME AUTO-WRITTEN DO NOT EDIT</pre></div></div>

<p>如果你喜欢让整个系统保持 KDE 4.3.3 Oxygen 的模样，可以单独为 Gtk 程序指定高仿 Oxygen 的风格而不修改 Qt 默认设置。</p>
<p><strong>为 Gtk 程序指定高仿 Oxygen 的风格</strong></p>
<p>和上面的方法类似，我们需要为 Gtk 预先安装（就是拷贝粘贴 <img src='http://www.nicetype.com/wp-includes/images/smilies/icon_neutral.gif' alt=':neutral:' class='wp-smiley' />  ）相应主题包，这里提供一款模仿 KDE 4.3.3 较好的选择——<a href="http://www.schristiancollins.com/linuxthemes.php">kde43-oxygen-molecule</a>（作者：S. Christian Collins）。</p>
<p>解压之后我们得到的目录 kde43-oxygen-molecule （下级包含 gtk-2.0）拷贝至 Gtk 主题目录：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cp -R kde43-oxygen-molecule /usr/share/themes/</span></pre></div></div>

<p>之后使用 gtk-chtheme 或 switch2 工具来选择主题 kde43-oxygen-molecule 即可。至于配色以及该主题对主题引擎的依赖请参考下载包中的文档。</p>
<p>当然还有一些仿制的主题例如使用   GTK-QT-Engine 主题引擎的 Qt4 主题，但应用之后 Firefox 的标签栏显示很有问题，可能是 Firefox 标签高度大于系统控件中的标签高度造成的，我试图修改 Firefox userChrome.css 未果。</p>
<p>至此，KDE 的 Qt 程序和 Gtk 程序外观<strong>基本一致</strong>了。</p>
<h4><strong>统一 Qt/Gtk 程序界面字体样式</strong></h4>
<p>对于用户来讲 Linux 桌面环境下字体设置很灵活，高深的我也不懂……</p>
<p>基本的是可以通过类似 CSS 字体筛选的方法在多语言混排的情况下为每一种语言的文字指定字体族（衬线与否、等宽与否）以及相应的字体，还有 Ubuntu 下的 language-selector 好像原理不太一样（不懂  <img src='http://www.nicetype.com/wp-includes/images/smilies/icon_redface.gif' alt=':oops:' class='wp-smiley' />  ）。</p>
<p>配置 Qt 西文字体：System Settings - Appearance - Fonts，这里指定了 Qt 界面各种组件的西文默认字体，我选择的是 Segoe UI Symbol 10 号非衬线字体和 Courier 10 Pitch 等宽字体，配置文件在 ~/.kderc 中。如果你修改了抗锯齿和微调配置，那么会在你的家目录下生成一个当前用户的字体配置文件 ~/.fonts.conf 。<br />
配置 Gtk 西文字体：使用上面提到的 gtk-chtheme 或 switch4 工具即可配置，配置文件保存在  ~/.gtkrc-2.0 或 ~/.gtkrc-2.0-kde4 中。<br />
配置中文字体：由于全局和个体用户的影响范围不同，如果你的桌面环境只有一个非 root 用户，那么最好在自己的字体配置文件（前文提到的 ~/.fonts.conf）中进行修改，大致示例如下，</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fontconfig<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
#允许点阵字体
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;embeddedbitmap&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
# 微调设置
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;rgba&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>rgb<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hinting&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hintstyle&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>hintslight<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/const<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 # 为衬线、非衬线、等宽字体族指定默认的中文字体，STXihei 是华文西黑，不推荐使用
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>serif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>STXihei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>sans-serif<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>STXihei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>monospace<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Monaco<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>STXihei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/family<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prefer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/alias<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
# 抗锯齿
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;font&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;edit</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;assign&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;antialias&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/edit<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fontconfig<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>重启某个程序例如 Dolphin 或者整个 KDE 这些字体设置就会为之生效。</p>
<h4><strong>改良 Gtk 字体渲染</strong></h4>
<p>完成以上设置之后在相应字形上显示没问题了，但是 Gtk 程序的字体渲染和 Qt 的还是有一些差别，Gtk 的 hinting 效果不如 Qt 重，如下图：</p>
<div id="attachment_373" class="wp-caption aligncenter" style="width: 410px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><a href="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-04.png"><img src="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-04-400x165.png" alt="Konqueror/Qt 和 Firefox/Gtk 主菜单字体渲染对比" title="Konqueror/Qt 和 Firefox/Gtk 主菜单字体渲染对比" width="400" height="165" class="size-medium wp-image-373" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">Konqueror/Qt 和 Firefox/Gtk 主菜单字体渲染对比</p></div>
<p>我使用了 libxft-cleartype 来替换 libxft 达到了目的：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ yaourt libxft-cleartype</pre></div></div>

<p>而常说的 <code>GDK_USE_XFT="1"</code>好像是针对 Gtk2 之前的设置吧？我没有使用这个选项。那么现在的 Qt Gtk 字体效果基本一致了，如图：</p>
<div id="attachment_374" class="wp-caption aligncenter" style="width: 410px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><a href="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-05.png"><img src="http://www.nicetype.com/wp-content/uploads/gtk-in-kde-05-400x217.png" alt="gtk-in-kde-05" title="gtk-in-kde-05" width="400" height="217" class="size-medium wp-image-374" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">应用 Cleartype 补丁之后的 Qt/Gtk 字体效果</p></div>
<p>由上至下：Qt/Qt/Gtk/Gtk</p>
<p>另外，我所用的 STXihei 和 Segoe UI Symbol 是不是支持 Cleartype 功能，又或者能否通过其他方法来实现统一我就不得而知了。</p>
<h4><strong>不同用户的配置</strong></h4>
<p>我们都知道每个用户都有个家目录，一般的应用程序配置都记录在这里，每当这个用户登录的时候就会调用相应的 bash 或者 gui 配置来组建操作环境。那么频繁执行 sudo 来获取 root 权限的人灰发现以上种种配置都会失效，也就是因为 root 他也是个用户需要相应的配置文件。</p>
<p>那么我们需要把上面的操作用 sudo/kdesu/gksu 来重做一遍或者把相应的配置文件拷贝到 root 用户的家目录（/root），又或者在全局层面进行修改，当然以后重做系统的话记得备份。</p>
<h4><strong>总结陈词</strong></h4>
<p>美化个屁啊！能用就得了，赶紧干正事儿去！</p>
<hr /><h2>Comments</h2><ul><li><a href="http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/#comment-224">November 24, 2009</a>, <a href='http://www.metsky.com' rel='external nofollow' class='url'>天缘博客</a> 提到: KDE GNOME我怎么感觉都差不多啊，美化到真的没这个功夫，能用就行。</li><li><a href="http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/#comment-254">January 3, 2010</a>, huangbochn 提到: 我觉得这篇文章很有用，我用kde，firefox界面都惨不忍睹。</li><li><a href="http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/#comment-267">February 15, 2010</a>, Loaden 提到: 有一个插件叫KFirefox，很不错的！
http://ramonantonio.net/kde-firefox/</li><li><a href="http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/#comment-268">February 16, 2010</a>, <a href='http://www.nicetype.com/' rel='external nofollow' class='url'>Bodhi</a> 提到: 最早用的就是这个——模拟 KDE 的 Firefox 主题，但是实际用过之后就会发现，差距太大了。</li><li><a href="http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/#comment-308">July 2, 2010</a>, cavin 提到: 还是没读懂，等我慢慢理解理解。看着看着就乱了：）</li></ul><hr /><small>Copyright &copy; 2008-2009 <a href="www.nicetype.com/">君子风博客 Nicetype.COM</a><br />该 Feed 只供个人使用,禁止未注明的转载或商业应用。<br /> 除非该 Feed 出现在订阅器中，否则一切引用皆视为对本站的侵权行为。<br /> </small><hr />]]></content:encoded>
			<wfw:commentRss>http://www.nicetype.com/archlinux-gtk-fonts-rendering-in-kde/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Firefox 3.5+ 模仿 Firefox 4 新主题</title>
		<link>http://www.nicetype.com/apply-strata-4-to-firefox-35/</link>
		<comments>http://www.nicetype.com/apply-strata-4-to-firefox-35/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 15:24:54 +0000</pubDate>
		<dc:creator>Bodhi</dc:creator>
				<category><![CDATA[浏览器经验谈]]></category>
		<category><![CDATA[Customiz]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Strata]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[主题]]></category>

		<guid isPermaLink="false">http://www.nicetype.com/?p=360</guid>
		<description><![CDATA[虽然 Firefox 4 的主题样式并未敲定，但已可估量大体框架。Opera 支持者免“这是盗用 Opera 10 的主题设计”，真真假假就那么回事儿，好好混日子吧。 本文也不算原创，满世界都是类似文章了…… 最终效果也不能尽如人意，各人喜好不同]]></description>
			<content:encoded><![CDATA[<div id="attachment_361" class="wp-caption aligncenter" style="width: 410px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; display: block; margin-right: auto; margin-left: auto;"><a href="http://www.nicetype.com/wp-content/uploads/Firefox_Strata_4_like.png"><img class="size-medium wp-image-361" title="Firefox_Strata_4_like" src="http://www.nicetype.com/wp-content/uploads/Firefox_Strata_4_like-400x320.png" alt="最终效果图" width="400" height="320" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">最终效果图</p></div>
<p>虽然 <a href="https://wiki.mozilla.org/Firefox/4.0_Windows_Theme_Mockups">Firefox 4 的主题样式</a>并未敲定，但已可估量大体框架。Opera 支持者免“这是盗用 Opera 10 的主题设计”，真真假假就那么回事儿，（我们）好好混日子吧。</p>
<p>本文也不算原创，满世界都是类似文章了…… 最终效果也不能尽如人意，各人喜好不同。<span id="more-360"></span></p>
<ol>
<li>安装 <a href="https://addons.mozilla.org/en-US/firefox/addon/14284">Strata40</a> 主题，获得 Strata 4 的主题图标等资源；</li>
<li>安装<a href="https://addons.mozilla.org/en-US/firefox/addon/14288/"> StrataGlass</a> 扩展，为程序头部提供整体 Aero 毛玻璃效果；</li>
<li>隐藏菜单栏（以下扩展二选一）
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3895">Personal Menu</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4762">Hide Menubar</a></li>
</ul>
</li>
<li>将标签栏移到导航栏地址栏上部；
<ol>
<li>安装 <a href="https://addons.mozilla.org/en-US/firefox/addon/2108">Stylish</a> 扩展，用以执行 Firefox 界面定制的样式表
<li>为 Stylish 添加样式表<a href="http://userstyles.org/styles/20866">将标签栏移到导航栏地址栏上部</a></li>
</ol>
</li>
<li>安装 <a href="https://addons.mozilla.org/en-US/firefox/addon/8823">Omnibar</a> 扩展隐藏搜索栏并将搜索功能整合到地址栏（不太好用……）</li>
<li>安装 <a href="https://addons.mozilla.org/en-US/firefox/addon/1951">Fission</a> 扩展模仿 Safari 将页面载入的进度条表现在地址栏；***** Fission 这个有点问题，显示异常，暂停。</li>
<li> 如果想模拟 IE7/8 将“刷新”和“停止载入”按钮整合到一处，可以使用 <a href="https://addons.mozilla.org/en-US/firefox/addon/313">Stop-or-Reload Button</a>；</li>
<li>我不太喜欢状态栏……，直接隐藏了。然后用 <a href="https://addons.mozilla.org/en-US/firefox/addon/12015">URL Tooltip</a> 显示链接的 title 和 url——当然，Fission 也有类似功能。</li>
</ol>
<p>没了，各有所好，非喜勿扰。</p>
<hr /><h2>Comments</h2><ul><li><a href="http://www.nicetype.com/apply-strata-4-to-firefox-35/#comment-183">September 15, 2009</a>, <a href='http://louishan.com' rel='external nofollow' class='url'>Louis Han</a> 提到: 步骤太琐碎，所以不搞了</li><li><a href="http://www.nicetype.com/apply-strata-4-to-firefox-35/#comment-184">September 16, 2009</a>, <a href='http://www.nicetype.com/' rel='external nofollow' class='url'>Bodhi</a> 提到: 还好啦，装个主题配俩扩展。浏览器么，就是个小PP软件，不值得多花心思的，哈哈！</li><li><a href="http://www.nicetype.com/apply-strata-4-to-firefox-35/#comment-190">September 20, 2009</a>, <a href='http://www.a-shun.com/' rel='external nofollow' class='url'>A.shun</a> 提到: FF也把标签放到上面去了。。
不过改下外观要这么多扩展。。值得么</li><li><a href="http://www.nicetype.com/apply-strata-4-to-firefox-35/#comment-192">September 20, 2009</a>, <a href='http://www.nicetype.com/' rel='external nofollow' class='url'>Bodhi</a> 提到: 我只是新增了 Strata 40 主题以及那个 Stylish 脚本，其他的扩展早已安装，所以也不琐碎。既然没有拯救世界的大业要我完成，何必惧惮琐碎呢。</li><li><a href="http://www.nicetype.com/apply-strata-4-to-firefox-35/#comment-207">October 11, 2009</a>, <a href='http://zww.me' rel='external nofollow' class='url'>zwwooooo</a> 提到: 喜欢这界面的折腾一下，不喜欢就观望，没啥琐碎和值得</li></ul><hr /><small>Copyright &copy; 2008-2009 <a href="www.nicetype.com/">君子风博客 Nicetype.COM</a><br />该 Feed 只供个人使用,禁止未注明的转载或商业应用。<br /> 除非该 Feed 出现在订阅器中，否则一切引用皆视为对本站的侵权行为。<br /> </small><hr />]]></content:encoded>
			<wfw:commentRss>http://www.nicetype.com/apply-strata-4-to-firefox-35/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
