LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 631|回复: 5

光标(cursor)盖住当前的汉字

[复制链接]
发表于 2010-4-6 10:40:24 | 显示全部楼层 |阅读模式
改一下中文字体凑合用

~/.Xresources 内容:

Emacs.FontBackend:xft
Emacs.font: Bitstream Vera Sans Mono-10
Emacs.geometry: 140x40+60+21
Emacs.toolBar: 0
Emacs.ScrollBars: off
Emacs.menuBar: 0
Emacs.Foreground: wheat
Emacs.Background: gray20

.emacs 修改的内容

;; 用文泉驿就有问题
;; (setq my-zh-font-size "-wenquanyi-wenquanyi bitmap song-medium-r-normal--16-*-*-*-*-*-iso10646-1")
;; 用这个就正常了
(setq my-zh-font-size "-unknown-Droid Sans Fallback-normal-normal-normal-*-16-*-*-*-*-0-iso10646-1")
(set-fontset-font "fontset-default" 'nil my-zh-font-size)
(set-fontset-font "fontset-default" 'kana my-zh-font-size)
(set-fontset-font "fontset-default" 'han my-zh-font-size)
(set-fontset-font "fontset-default" 'symbol my-zh-font-size)
(set-fontset-font "fontset-default" 'cjk-misc my-zh-font-size)
(set-fontset-font "fontset-default" 'bopomofo my-zh-font-size)

------------------------------原帖--------------------------------

换了台机器重装 gentoo,结果出现这样的问题:

$ emacs -Q

$ gvim

默认光标都是一个方块,光标把它底下的汉字给覆盖住了(英文字母没问题),导致看不见光标底下是啥。
目前把光标类型换成竖线凑合用的 (setq-default cursor-type 'bar)

有没有可能是 libXft 的问题?我试过 gentoo-china 和官方源里的 libXft 都
装过,现象都一样

# emerge --info

Portage 2.1.8.3 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.11-r1, 2.6.33-gentoo i686)
=================================================================
System uname: Linux-2.6.33-gentoo-i686-Intel-R-_Core-TM-2_Duo_CPU_T6670_@_2.20GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 05 Apr 2010 22:00:01 +0000
app-shells/bash:     4.1_p2-r1
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r1, 3.1.2-r1
dev-python/pycrypto: 2.1.0
dev-util/cmake:      2.8.1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.4_p6-r1, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.3.4, 4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://61.135.158.199 http://distfiles.gentoo.org/ http://gentoo.aditsu.net/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/gentoo-china /var/lib/layman/sunrise"
SYNC="rsync://61.135.158.199/gentoo-portage"
USE="X acl acpi alsa bash-completion berkdb branding bzip2 bzlib cjk cleartype cli cracklib crypt cups cxx dri fb fortran freetype gdbm gif gpm hal iconv ipv6 jpeg lock mmx modules mudflap ncurses nls nptl nptlonly openmp pam pcre perl png pppd python readline reflection session spl sse sse2 ssl startup-notification svg sysfs tcpd thunar truetype unicode x86 xft xorg zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
发表于 2010-4-6 12:47:33 | 显示全部楼层
你主题的问题吧。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-6 13:57:07 | 显示全部楼层
Post by zhou3345;2081012
你主题的问题吧。

是指 gnome、kde 的主题还是 emacs、gvim 的主题?

我只用 fvwm 和 fluxbox,这2个按默认的配置也有问题,至于 emacs -Q 启动的本身就按默认的配置,没有加载自定义的设置,除了读取 ~/.Xresources

后来把 /etc/fonts/local.conf ~/.fonts.conf ~/.Xresources 都去掉问题依旧

我之前怀疑可能是 libXft 这块出问题,重新编了 emacs,USE="-xft"
emacs -Q 就显示正常了,但去掉 xft 的支持并不是我想要的

查看 emacs 自带的 PROBELMS 文档,里面有提到一个

** Characters are displayed as empty boxes or with wrong font under X.

*** This can occur when two different versions of FontConfig are used.
For example, XFree86 4.3.0 has one version and Gnome usually comes
with a newer version.  Emacs compiled with Gtk+ will then use the
newer version.  In most cases the problem can be temporarily fixed by
stopping the application that has the error (it can be Emacs or any
other application), removing ~/.fonts.cache-1, and then start the
application again.  If removing ~/.fonts.cache-1 and restarting
doesn't help, the application with problem must be recompiled with the
same version of FontConfig as the rest of the system uses.  For KDE,
it is sufficient to recompile Qt.

但好像问题不出在这里,gvim 也有这样的问题
回复 支持 反对

使用道具 举报

发表于 2010-4-6 14:06:27 | 显示全部楼层
我说的配置问题,是指默认配置可能就是有这个问题的,需要你自己设置一下。
估计跟.Xresources和color-theme的设置有关。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-6 14:33:06 | 显示全部楼层
Post by zhou3345;2081030
我说的配置问题,是指默认配置可能就是这样的,需要你自己设置一下。
估计跟.Xresources和color-theme的设置有关。



呃,emacs -Q 已经是默认的设置了。我还装过 emacs-vcs,最新版的按 -Q 启动连 .Xresources
都不读取

现在试验的结果就是去掉 xft 的支持就没问题。还有一个可能跟字体相
关,emerege emacs 结束后会有提示

* You need to install some fonts for Emacs.
* Installing media-fonts/font-adobe-{75,100}dpi on the X server's
* machine would satisfy basic Emacs requirements under X11.
* See also http://www.gentoo.org/proj/en/lisp/emacs/xft.xml
* for how to enable anti-aliased fonts.

而我的字体安装也安装了

$ eix media-fonts/font-adobe
media-fonts/font-adobe-100dpi
     Available versions:  1.0.0 (~)1.0.1 {X nls}
     Installed versions:  1.0.1(03:01:22 PM 03/17/2010)(X nls)
     Homepage:            http://xorg.freedesktop.org/
     Description:         X.Org Adobe bitmap fonts

media-fonts/font-adobe-75dpi
     Available versions:  1.0.0 (~)1.0.1 {X nls}
     Installed versions:  1.0.1(02:54:42 PM 03/17/2010)(X nls)
     Homepage:            http://xorg.freedesktop.org/
     Description:         X.Org Adobe bitmap fonts

media-fonts/font-adobe-utopia-100dpi
     Available versions:  1.0.1 (~)1.0.2 {X nls}
     Installed versions:  1.0.2(02:53:29 PM 03/17/2010)(X nls)
     Homepage:            http://xorg.freedesktop.org/
     Description:         X.Org Adobe Utopia bitmap fonts

media-fonts/font-adobe-utopia-75dpi
     Available versions:  1.0.1 (~)1.0.2 {X nls}
     Installed versions:  1.0.2(02:56:20 PM 03/17/2010)(X nls)
     Homepage:            http://xorg.freedesktop.org/
     Description:         X.Org Adobe Utopia bitmap fonts

media-fonts/font-adobe-utopia-type1
     Available versions:  1.0.1 (~)1.0.2 {X}
     Installed versions:  1.0.2(03:04:40 PM 03/17/2010)(X)
     Homepage:            http://xorg.freedesktop.org/
     Description:         X.Org Adobe Utopia Type 1 fonts


$ eselect fontconfig list
Available fontconfig .conf files (* is enabled):
  [1]   10-autohint.conf
  [2]   10-no-sub-pixel.conf
  [3]   10-sub-pixel-bgr.conf
  [4]   10-sub-pixel-rgb.conf
  [5]   10-sub-pixel-vbgr.conf
  [6]   10-sub-pixel-vrgb.conf
  [7]   10-unhinted.conf
  [8]   20-fix-globaladvance.conf *
  [9]   20-unhint-small-dejavu-sans.conf
  [10]  20-unhint-small-dejavu-sans-mono.conf
  [11]  20-unhint-small-dejavu-serif.conf
  [12]  20-unhint-small-vera.conf *
  [13]  25-unhint-nonlatin.conf
  [14]  30-metric-aliases.conf *
  [15]  30-urw-aliases.conf *
  [16]  40-nonlatin.conf *
  [17]  44-wqy-zenhei.conf *
  [18]  45-latin.conf *
  [19]  49-sansserif.conf *
  [20]  50-user.conf *
  [21]  51-local.conf *
  [22]  57-dejavu-sans.conf
  [23]  57-dejavu-sans-mono.conf
  [24]  57-dejavu-serif.conf
  [25]  60-latin.conf *
  [26]  65-fonts-persian.conf *
  [27]  65-khmer.conf
  [28]  65-nonlatin.conf *
  [29]  66-wqy-zenhei-sharp.conf
  [30]  66-wqy-zenhei-sharp-no13px.conf *
  [31]  69-unifont.conf *
  [32]  70-no-bitmaps.conf
  [33]  70-yes-bitmaps.conf
  [34]  80-delicious.conf *
  [35]  85-wqy-bitmapsong.conf *
  [36]  90-synthetic.conf *
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-7 14:44:32 | 显示全部楼层
貌似这哥们也遇到相同的问题,期待一下能有解决方法

Re: Weird cursor blinking with emacs-23 branch
Fabian Ezequiel Gallina <galli.87 <at> gmail.com>
2010-04-07 05:13:41 GMT

2010/4/7 Fabian Ezequiel Gallina <galli.87 <at> gmail.com>:
> Hi,
>
> I'm using the latest emacs-23 branch and I'm having a really weird and
> annoying problem with the cursor.
>
> When the cursor blinks, it hides the character behind it for a little
> period, it does this for each blink.
>
> The problem looks pretty much the same as this[0], however no real
> solution is given in this thread.
>
> Any advice?
>
>
> [0] http://bbs.archlinux.org/viewtopic.php?id=92445
>
>
> Thanks!
>

I forgot to mention, I'm using Arch GNU/Linux x86_64 and Gnome 2.30.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表