Ubuntu12 解决BadName (named color or font does not exist)

今天安装完T32 (2012FEB)后,发现启动gvim后很快就自动退出。

terminal显示:

BadName (named color or font does not exist)
Vim: Got X error
Vim: Finished.

原因:

发现安装t32的脚本中,关于安装字体的部分:

mkdir -p $T32_FONT || exit 1
cd $T32_FONT       || exit 1
mkfontdir .        || exit 1
xset fp $T32_FONT  || exit 1
xset fp rehash     || exit 1

sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf
sudo fc-cache -f -v $T32_FONT  || exit 1

当用mkfontdir .建立字体索引文件后,xset fp 重置了X的font path,覆盖了原有的的path。

解决:

找到另一台Ubuntu,xset q命令查看X的font path都有哪些:

Font Path:
   /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1/,built-ins

然后用xset fp+添加进去

现在的Font Path:
  /opt/t32/fonts,/usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1/,built-ins

参考:

http://www.x.org/archive/X11R7.5/doc/man/man1/mkfontdir.1.html

http://www.x.org/archive/X11R7.5/doc/man/man1/xset.1.html

http://manpages.ubuntu.com/manpages/hardy/man1/fc-cache.1.html

https://wiki.ubuntu.com/Fonts

https://wiki.archlinux.org/index.php/Font_Configuration

http://en.wikipedia.org/wiki/Fontconfig

你可能感兴趣的:(专业知识)