2007年12月16日星期日

KDE4.0将以低资源占用率掀Linux界面革命

  Linux图形界面正在迎来一次变革,那就是KDE4即将发布,据开发人员表示,KDE4图形界面不但能给Linux桌面系统带来更好的外观和表现,还在系统资源占用上拥有极大突破。

  KDE是一个开源的用户桌面环境,KDE社区在今天刚刚公布了第二个RC版本的KDE4,美观大方的她终于进入了最后的发布阶段.

  这一版本是一个LiveCD,已经可以提供给用户完整的功能,同时,KDE团队还发布了最终版本的KDE Development Platform,它可以用来构建KDE 4所需要的应用程序外观支持,最终产品大约在明年1月份发布。

  据称相比KDE3,KDE4版本将节省多达39%的内存,能为日常应用空出更多资源以提高效率。测试人员拿到最新版的KDE4后,在一台 Thinkpad X60中限制内存和处理器频率到256MB/1GHz时仍然可以流畅运行,浏览网页,聊天,甚至是开桌面特效都一切正常,这意味着什么?这意味着华硕最新 的Eee PC将非常轻松地跑上美丽的KDE4!

OpenSUSE字体

这款字体来自中国 Linux 公社,作者是 cnhnln ,这款字体是用 fontforge http://fontforge.sourceforge.net/ 修改的,内含两套字体,一套 Vera Sans YuanTi 是比例字体,不等宽。一套 Vera Sans YuanTi Mono 是等宽字体,可以用在终端,不会出现字符重叠,包含常规、斜体、粗体、粗斜体。不需要通过算法生成斜体,也不需要粗体补丁。支持 GBK。英文部分按照是否等宽分别用 Bitstream Vera Sans 和 Bitstream Vera Sans mono,中文常规部分是 方正准圆 ,中文粗体部分用 方正粗圆。并且这款字体中嵌入了从 simsun 里提出的 12、13、14、15、16、18 pixelsize 的 GBK 点阵字体。

这款字体非常漂亮,而且使用起来也很简单。
下载 http://download.coolcode.cn/vera-sans-yuanti.tar.gz

字体及其配置文件:vera-sans-yuanti.tar.gz。
安装

这个包中 ttf-vera-sans-yuanti 目录下为字体文件,把该目录下的文件连同该目录一起复制到 /usr/share/fonts/truetype/ 目录下。接着在 /usr/share/fonts/truetype 执行
fc-cache .

命令,更新字体缓存文件。然后把 local.conf 文件复制到 /etc/fonts/ 目录下,把 gtkrc.zh_CN 和 gtkrc.zh_CN.utf-8 文件复制到 /etc/gtk/ 目录下。最后修改 /etc/X11/xorg.conf 文件,把字体路径加入到 Section “Files” 中:
Section "Files"
# FontPath "unix/:7100" # local font server
# if the local font server has problems, we can fall back on these
FontPath "/usr/share/fonts/truetype/ttf-vera-sans-yuanti"
FontPath "/usr/lib/X11/fonts/misc"
FontPath "/usr/lib/X11/fonts/cyrillic"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/Type1"
FontPath "/usr/lib/X11/fonts/CID"
FontPath "/usr/lib/X11/fonts/100dpi"
FontPath "/usr/lib/X11/fonts/75dpi"
EndSection

注意这里一定要把 FontPath “/usr/share/fonts/truetype/ttf-vera-sans-yuanti” 加在最前面。好了然后重启 X 你就有漂亮的系统界面了。

如果希望 gtk+ 1.2 程序能够显示比较漂亮的 gtk+ 2.0 的界面,请安装 gtk-engines-raleigh 这个包。

次像素渲染补丁,彻底优化opensuse 10.2,10.3字体显示效果

提供脚本给各位使用
将下面存成例如 sbupixel.sh
chmod +x subpixel.sh
./subpixel.sh
自动编译安装
代码:

#!/bin/sh
echo "重新編譯並不需要 root 權限,但是新增套件庫與安裝套件需要輸入 root 密碼"
echo "加入 source rpm 的套件庫"
sudo zypper ar -t rpm-md \
http://ftp.twaren.net/Linux/OpenSuSE/distribution/10.3/repo/
(此行补上行后面!)src-oss/suse/ source
sudo zypper ref source
echo "安裝 source rpm"
zypper si freetype2
echo "修改 spec 檔以開啟 sub-pixel hinting 支援"
sed 's/%define enable_subpixel_rendering 0%{?opensuse_bs}/%define enable_subpixel_rendering 1/' \
/usr/src/packages/SPECS/freetype2.spec > /usr/src/packages/SPECS/freetype2.spec.tmp
mv /usr/src/packages/SPECS/freetype2.spec.tmp /usr/src/packages/SPECS/freetype2.spec
echo "安裝編譯所需的套件"
sudo zypper -n in automake gcc make autoconf libtool zlib-devel
echo "重新編譯套件"
rpmbuild -bb /usr/src/packages/SPECS/freetype2.spec
echo "重新安裝支援 sub-pixel hinting 支援的 freetype2"
sudo rpm -ivh --force /usr/src/packages/RPMS/*/freetype2-*.rpm
echo "請重新登入,在設定字型處設定使用 sub-pixel hinting"
完成后可将 source 这个源去除
zypper rr source

SubpixelHinting

Disclaimer

The subpixel hinting implementation in freetype2 might infringe Microsoft's ClearType patents, which is why it is disabled both upstream (by the freetype2freetype2 RPM packages that ship with openSUSE. authors)

Target Distributions

Only works on openSUSE 10.2 or later -- on older openSUSE versions, it might create issues because the following instructions also upgrade to the latest freetype2 library.

How to enable subpixel hinting

Rebuild freetype2 with subpixel hinting

Note: the following commands must be executed using your regular non-root account

The following commands will download a source package for freetype2 and rebuild the binary RPMs with subpixel hinting enabled:

mkdir -p ~/download/freetype2

cd ~/download/freetype2 wget http://ftp.skynet.be/pub/suser-guru/rpm/experimental/packages/freetype2/src/freetype2-2.3.5-0.1.guru.suse102.src.rpm TARGET_OPT=`case \`uname -m\` in i*86) echo --target=i586;; esac`

rpmbuild --rebuild $TARGET_OPT --with subpixel freetype2-*.guru.suse*.src.rpm

At this point, there must be a lot of output, with rpmbuild building the source package. Note that rpmbuild might complain about missing dependencies (gcc, make, python, glibc-devel, autoconf, automake and libtool are required). If so, install the missing packages and run the two last lines again (TARGET_OPT=... and rpmbuild --rebuild ...).

When the build succeeds, you will end up with the binary freetype2 RPM packages in /usr/src/packages/RPMS/i586/ (32bit system) or /usr/src/packages/RPMS/x86_64/ (64bit system).

Upgrade to the subpixel hinting enabled freetype2 packages

Note: the following commands will require access to the root account (which means you have to know the password of the root user)

To upgrade to the subpixel hinting enabled freetype2 packages, do as follows:

su - rpm --freshen -hv /usr/src/packages/RPMS/*/freetype2-*.rpm

Note: after the first line (su -), you will be prompted for the password of the root user, which is necessary to upgrade the RPM packages

KDE Configuration

Note: the following commands must be executed using your regular non-root account

Note: the KDE Control Center application must be installed on your system (packages: kdelibs3 and kdebase3)

If you're using the KDE desktop or any KDE-based application, here is how to set up subpixel hinting for KDE:

  • start the KDE font configuration with the following command:
    kcmshell fonts
  • enable the checkbox "Use anti-aliasing for fonts"
  • click on the "Configure" button next to the above mentioned checkbox
  • enable the checkbox "Use sub-pixel hinting:"
  • select "Medium" or "Full" from the Hinting style: list (the best settings is both a matter of taste and depending on your monitor, try the different hinting style options to see what suits you best)
  • click the "OK" button
  • click the "OK" button

GNOME Configuration

Note: the following commands must be executed using your regular non-root account

Note: the GNOME Control Center application must be installed on your system (package: control-center2)

If you're using the GNOME desktop or any GNOME/GTK2-based application (e.g. Firefox), here is how to set up subpixel hinting for GNOME/GTK:

  • start the GNOME font configuration with the following command:
    gnome-font-properties
  • in the "Font Rendering" section, select "Subpixel smoothing (LCDs)"
  • click on the "Details..." button below the above mentioned option
  • in the "Smoothing" section, select the option "Subpixel (LCDs)"
  • in the "Hinting" section, select the option that suits you best (the best settings is both a matter of taste and depending on your monitor)
  • click the "Close" button
  • click the "Close" button

Firefox Configuration

Type in about:config in the address box and search for freetype. By double-clicking on a specific setting you can change it. Apply the changes in bold as shown below.

If you experience an issue with the font sizes search for dpi and set it to 0. This will make Firefox use only X's dpi value.

For even better experience it is recommended that you install dejavu-fonts-ttf from Package Sources/Guru (see Installing Software) and set Firefox to use them by opening up Edit -> Preferences -> Content -> in the Fonts & Colors box -> Advanced and setting them up as follows.

Linux in Windows OR Windows in Linux?

曾经很想使用Linux系统,因为一是想“尝鲜”,二是为了学习它的基本技能,因为许多科研仪器都使用linux/unix作为基本系统构架的。本想在WindowsXP里安装一个VMware软件虚拟一个linux用,但因为windows效率太低,安好了发现用起来很不舒服……于是变换了思路:在Linux中安装VirturalBox,里面虚拟windows用……结果呢,不仅Linux不卡,就连里面的windows运行的也更顺利了,得出一个结论:linux系统构架实在很优秀,沉溺于windows真是人生不幸阿。Windows in Linux,好处有二:不拖速度,安全可靠,很少见到Linux死机!