2009年12月21日星期一

Opera 字体设置

opera
的字体选择机制进步是有目共睹的!如今选择自己想要的中文字体,或者中英文不同字体,已经非常容易方便了。

设置很快!
0. opera:config 里搜索 fonts,去掉 Enable Core X Fonts 的勾;

1. 使用你心爱的编辑器打开 $OPPATH/share/opera/ini/font.ini
这个文件,注意权限;
如果觉得权限麻烦,就复制一份font.ini到~/.opera,然后就直接修改吧。

2. 找到第 35 行,把 family: 到 =
中间的字段改成你想要的,系统中存在的中文字体,比如我的改成
 family:Vera Sans YuanTi=chinese-s try-first ;

3. 保存退出,重新启动 Opera 就可以看到你选择的中文字体的显示效果了;

scim在opera中偶尔失去响应的解决方法

这个问题很有历史了,见http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=434180中的bug报告,里面有几句话提到了解决方法:
And the problem showed up from version 1.4.6. Current transitional
solution is changing the value of \"/FrontEnd/X11/Dynamic\" in
/etc/scim/config or ~/.scim/config from \"false\" to \"true\", which is
known to unfortunately break deadkeys usage in European keyboard layouts.
So this walk around is only recommend when such problem shows up. Seems
further investigation is required.

于是打开编辑~/.scim/config
gedit ~/.scim/config
找到:/FrontEnd/X11/Dynamic = false
改为:/FrontEnd/X11/Dynamic = true
然后重新启动X,在opera中肆意蹂躏了下键盘,暂时没有出现和以前一样突然不能输入的情况。
(不过注意哦,这个方法有个问题上面也说到了:" which is known to
unfortunately break deadkeys usage in European keyboard layouts. ")
-------------------------
还在网上搜索到下面几种解决方法:(本人未测试,不知道可行否,直接转过来给大家参考)

Ubuntu 7.10下scim/libx11的bug及解决方法
在7.10版本的Ubuntu中,默认的scim模式改成了XIM。造成在有些程序中无法输入文字,即使是英文字母也不行的bug。我多次在nautilus里遇到该bug。该bug很早就被报告了,只是最近才由于默认设置的改变而更加容易出现了。不过这似乎是libx11库的bug。

launchpad上给出了两种解决办法:

1. 如果不需要使用依赖 libstdc++5库的程序。可以执行
im-switch -s scim-immodule
把scim模式改掉。但是我需要用到java6,acroread这些依赖stdc++5的程序,所以该方法不适合我。

2. 如果不需要使用deadkeys,可以按以下步骤修改:
a. 执行im-switch -s none,使得scim默认不会启动,退出并重登录
b. 修改 ~/.scim/config 文件, 将 /FrontEnd/X11/Dynamic 改为 true
c. 执行im-switch -s scim,使得scim默认启动。
但是我要用deadkeys来输入法文音标字母,所以该方法也不适合我。

于是有人给出了第三种方法,
a. 按照方法2修改设定
b. 安装 scim-uim以及 uim-latin
c. 设置一个复合键(在gnome的键盘选项中)
d. 启动scim,把输入法改为 UIM-Latin

voila!

还有个更简单的方法。既然是libx11的问题,那就应该从源头上解决,治标治本。
添加源
deb http://ppa.launchpad.net/arnegoetje/ubuntu gutsy main restricted
universe multiverse
deb-src http://ppa.launchpad.net/arnegoetje/ubuntu gutsy main restricted
universe multiverse
把libx11库更新即可。


上面那个是参照debian的bug报告:对于ubuntu用户见https://bugs.launchpad.net/ubuntu/+source/scim/+bug/66104
这里还提到了别的方法:
Bug description

In gutsy, the default mode of scim (detemined by im-switch\'s settings
\"scim\") uses XIM mode. This may cause problems in some applications and
make it impossible to input anything, even if you choose the
English/Keyboard input method. This happens most often in nautilus, but is
also seen in gedit, gnome-terminal, etc.

This bug has been around for a long time, it only became more visible
because of the change in the default settings of scim and the Ubuntu
package.

There are two work arounds for this problem:

1. If you do not use any programs linked to libstdc++5 (very few of the
Ubuntu official packages do, one know exception is the fglrx video driver
for ATi cards; but plenty of third-party programs do, such as firefox
downloaded from http://www.mozilla.com, and Adobe\'s PDF reader), you can
use the scim-immodule setting in im-switch. To change the im-switch
setting, just run \"im-switch -s scim-immodule\" command.

2. If you do not use the deadkeys (often seen on European keyboards, and
if you don\'t know what a deadkey is, you are not using it), you can
change scim\'s \"/FrontEnd/X11/Dynamic\" setting. The procedure to change
this setting is:
(a) Set scim not to start automatically (because it\'s useless to change
the configuration file when scim is running) using the command \"im-switch
-s none\". Log out and re-login.
(b) Edit your ~/.scim/config configuration file, change the
/FrontEnd/X11/Dynamic option to true.
(c) Reset scim to start automatically with command \"im-switch -s scim\".
Log out and re-login.

If you are using programs linked to libstdc++5 as well as deadkeys, there
is no known workaround for you. You may try the scim-bridge settings (you
need to install scim-bridge-* packages first), but it\'s not clear whether
it works or not (and I don\'t even know if there is a written scim-bridge
setting for im-switch of not).
This description was updated. View original description.

其实有个很简单的方法,在网页空白地方点右键打开菜单就又可以继续输入啦
按一下alt-tab切换一下,再按alt-tab切换回来也能解决问题。