View previous topic :: View next topic |
Author |
Message |
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Sun Mar 13, 2005 4:08 am Post subject: 求教: scim 和 fontforge 的键盘冲突 |
|
|
情況是這樣的:
akar正在主持 開源香港常用中文字體計劃, 需要經常使用 fontforge 這一 中文外框字/全真字(TrueType)的修改工具。
但如果我同時啟用 scim 的中文輸入法程式 和 fontforge, 便 不可以用 鍵盘捷鍵(hotkey), 例如,如果我把要做的中文字編號由 文字處理程式(gedit)下 複制 <control>+C(沒問題) 到 fontforge的 view->goto窗口時 用 <control>+V時便不行 , (這時用 mouse右鍵menu選擇貼上反而可以!)。
現時我的解決方法是:
1。 預設不啟動 scim, 那fontforge 使用便沒有問題。
2。 在要用中文輸入時, 在 console下用 scim -d 人手啟動, 不用了, 就用kill 關閉 scim 背景程式。
這個情況(scim 1.01, 1.0.2)同時出現在 Gentoo 和 GNU/Debian 下不管是 xfce4.2 或 Gnome 2.8, 造成 我和中文字體計劃各成員 極大的不方便!!
所以在這請大家幫一幫忙!
~/.xinitrc wrote: |
export LANG=zh_TW.UTF-8
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export G_FILENAME_ENCODING=@UTF-8
#scim -d
#exec xscreensaver -no-splash &
exec xfce4-session
|
謝謝! _________________ AKar |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
Posted: Sun Mar 13, 2005 7:44 pm Post subject: |
|
|
this is probably a bug in fontforge. Please try to report it to them |
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Mon Mar 14, 2005 2:21 am Post subject: |
|
|
liuspider wrote: | this is probably a bug in fontforge. Please try to report it to them |
謝謝 liuspider 的回覆。
請問我要如何有效地向 fontforge 提供錯誤報告呢?
對了,我在 fontforge的 開發論譠上找來相關的報錯,有一條說可能是
Code: | XMODIFIERS="@im=SCIM" |
的問題, 等會兒我試下。
另外我看到George Williams有嘗試下重現這個錯誤, 但他不懂安裝 scim
George Williams wrote: |
$ LC_CTYPE=zh_TW.UTF-8
$ scim &
...
Starting SCIM ...
GTK Panel of SCIM 0.99.2
Starting as daemon ...
scim::FrontEnd: X11 -- failed to connect to the panel daemon!
SCIM has exited abnormally.
As I have no idea what a "panel daemon" is I have no idea how to address
this issue.
|
_________________ AKar |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
Posted: Mon Mar 14, 2005 3:40 am Post subject: |
|
|
as stated here:
http://fontforge.sourceforge.net/#bugs
if seems you have to post the bug in their mailing list. However I think it is sufficiant for you to send a email directly to the primary author.
May I know what it is based on? Gtk+? or pure Xlib? |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
Posted: Mon Mar 14, 2005 3:54 am Post subject: |
|
|
please also try scim latest releases, although I do not think it's a bug in libscim. |
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Mon Mar 14, 2005 5:07 am Post subject: |
|
|
當我弄清楚問題, 我會提出錯誤/改善報告。
fontforge 不是用gtk的,(至少現在不是)應該是xlibs吧? 甚至可以在 文字模式下使用。
另外我試了一下
~/.xinitrc wrote: |
export LANG=zh_TW.UTF-8
#export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export G_FILENAME_ENCODING=@UTF-8
scim -d
exec xscreensaver -no-splash &
exec xfce4-session
|
注釋掉 XMODIFIERS, 果然 fontforge的問題就消失了!!
但其它的“正常”的軟件就不能使用 scim中文輸入法了。
但用這樣啟動的話 就可以, 比如:
Code: |
$ XMODIFIERS=@im=SCIM firefox &
$ XMODIFIERS=@im=SCIM leafpad &
$ XMODIFIERS=@im=SCIM /opt/openoffice.org1.9.79/program/soffice.bin &
|
對我來說是可以了, 但不够優雅。
如果要向fontforge項目提出 改善的意見,請問該如何說呢?
---
edit: 剛想到另一個方式, 就是保持 環境變量 XMODIFIERS=@im=SCIM 的設定, 再在 fontforge的啟動指令內加入清除 XMODIFIERS環境變量,這樣:
Code: | $ XMODIFIERS='' fontforge & |
下午回來就試一下。 _________________ AKar |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
Posted: Mon Mar 14, 2005 2:31 pm Post subject: |
|
|
without that environment variable, you can not input chinese under fontforge, can you?
the problem is that fontforge can not work with SCIM (via XIM)
Your alternative approach is better, I think. |
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Tue Mar 15, 2005 1:41 am Post subject: |
|
|
不就是! 第二個方法行得通!
現在到目前為止我認為最好的解決方案:
環境配置參數:
~/.xinitrc wrote: |
export LANG=zh_TW.UTF-8
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export G_FILENAME_ENCODING=@UTF-8
scim -d
exec xscreensaver -no-splash &
exec xfce4-session
|
在 ~/.bashrc內加一條 alias
加這條到 ~/.bashrc wrote: |
alias fontforge="XMODIFIERS='' fontforge "
|
看來都解決了。
對了,還有一件事, 請問如果我要告訴 George Williams先生關於這個問題,就這樣告訴他嗎?
liuspider wrote: | fontforge can not work with SCIM (via XIM) |
_________________ AKar |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
Posted: Tue Mar 15, 2005 2:37 pm Post subject: |
|
|
of course not: that's not enough information for him to work on it
you should also state the details of the problem, as in the toppest post in this thread. |
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Sat Mar 19, 2005 4:49 am Post subject: |
|
|
George Williams wrote: | ...I am able to get kinput2 to run, and I have no problems using it in the goto dlg... |
來自 fontforge的項目開發人說,他沒辦法重現我的問題,而他使用 kinput2。
請問liuspider,這 scim 和 kinput2 是否在架構上有根本性的分別呢?
或者縮細到 對 XMODIFIERS環境值的處理及攔截是是否有不同?
謝謝! _________________ AKar |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
Posted: Sat Mar 19, 2005 2:05 pm Post subject: |
|
|
对于 fontforge 来说,这两个都是通过XIM机制来进行输入的,但是,他们在一些细微地方的处理上的差别就会造成这类问题的
如果他可以用 kinput2 的话,为什么不能用 SCIM 呢? |
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Wed Mar 23, 2005 3:26 am Post subject: |
|
|
liuspider 好:
來至 fontforge開發者 George Williams先生對以上問題的探索:
George Williams wrote: |
Ok, I've installed a new version of scim (1.2.1 w/ chinese-0.4.2). It
pops up a little window when I type Control-space in gedit.
In fontforge it seems to prevent all keyboard input from reaching
fontforge.
When fontforge gets an event it calls XFilterEvent. This is supposed to
pass any KeyPress events to the input method which will analyze them. If
XFilterEvent returns true then the input method is supposed to have
handled the event, and the event should not be processed further. When
XFilterEvent returns false, the input method didn't handle the event and
fontforge should.
When the input method is scim, and an input context is active,
XFilterEvent always returns true on KeyPress events, yet scim never does
anything with its events. This is obviously incorrect behavior.
I've looked at the gtk sources and reread the X Input Method spec, and
tried various experiments. I can't figure out what might be wrong.
Personally I can't imagine a combination of inputs I could give X to
make XFilterEvent return true for all keypresses, so I tend to think it
is a bug in scim.
If someone on scim can explain what is wrong perhaps I can fix it, but
I'm afraid I'm at a loss on this one...
|
_________________ AKar |
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
|
Back to top |
|
|
liuspider Apprentice
Joined: 03 Feb 2003 Posts: 237
|
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Fri Mar 25, 2005 6:29 am Post subject: |
|
|
謝謝你的幫忙!
測試安裝 Gentoo的 scim 1.2.1, 現在正在用 scim倉頡打字。
但未能解決 fontforge的問題:
不論是:
還是:
Code: | XMODIFIERS='' fontforge -new& |
以前一直可以的的 熱鍵,現在都有時靈,有時不行, 例: control+shift+ > _________________ AKar |
|
Back to top |
|
|
JamesSu n00b
Joined: 25 Mar 2005 Posts: 2
|
Posted: Fri Mar 25, 2005 3:57 pm Post subject: |
|
|
I can't reproduce this issue on SUSE Linux 9.3 with scim 1.2.1. At least I can use ctrl+c and ctrl+v in View->Goto box. |
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Sun Mar 27, 2005 8:20 am Post subject: |
|
|
JameSu 好:
經過你這嗎一說,那我只有再仔細試一下,看來有點眉目了!
請看以下這兩次實驗的背景程式執行的情況:
這種情況下fontforge的鍵盘組合鍵正常!!
~/.xinitrc 內的 scim -d是注釋掉的;
但任何的程式一執行,便會有輸入法的圖示在工作條上出現,關掉時即時消失;
請看背景程式的的scim的執行情況
ps aux|grep scim (without scim -d in .xinitrc) wrote: |
ac 9709 0.0 0.5 10124 2576 ? Ss 15:07 0:00 /usr/lib/scim-1.0/scim-launcher -d -c simple -e all -f socket --no-stay
ac 9716 0.0 0.3 5792 1912 ? Ss 15:07 0:00 /usr/lib/scim-1.0/scim-helper-manager
ac 9717 0.0 1.6 38080 8340 ? Ssl 15:07 0:00 /usr/lib/scim-1.0/scim-panel-gtk --display :0.0 -c socket -d --no-stay
|
這種情況下fontforge的鍵盘組合鍵不正常!!
~/.xinitrc 內有scim -d;
輸入法的圖示在工作條上永遠出現,就算我在Terminal下kill,之後也會再次出現;
請看背景程式的的scim的執行情況
ps aux|grep scim (with scim -d in .xinitrc) wrote: |
ac 9483 0.0 0.5 10268 2600 ? Ss 15:21 0:00 /usr/lib/scim-1.0/scim-launcher -d -c simple -e all -f socket --no-stay
ac 9485 0.0 0.5 11504 3080 ? Ss 15:21 0:00 /usr/lib/scim-1.0/scim-launcher -d -c socket -e socket -f x11
ac 9488 0.0 0.3 5788 1908 ? Ss 15:21 0:00 /usr/lib/scim-1.0/scim-helper-manager
ac 9489 0.0 1.6 39472 8516 ? Ssl 15:21 0:00 /usr/lib/scim-1.0/scim-panel-gtk --display :0.0 -c socket -d --no-stay
|
這些是在scim 1.2.1下才發現的情況。
Now i am under GNU/Debian same XFCE 4.2, when i comment out the scim -d in ~/.xinitrc, firefox is show up with not scim(1.0.2) at the same time.
_________________ AKar |
|
Back to top |
|
|
JamesSu n00b
Joined: 25 Mar 2005 Posts: 2
|
Posted: Mon Mar 28, 2005 2:21 am Post subject: |
|
|
I can't reproduct this issue for both situations. Maybe there is something wrong in your environment settings. Could you please give me some detailed information of your system? eg.:
locale settings
env settings
fontforge version
etc.
akar wrote: | JameSu 好:
經過你這嗎一說,那我只有再仔細試一下,看來有點眉目了!
請看以下這兩次實驗的背景程式執行的情況:
這種情況下fontforge的鍵盘組合鍵正常!!
~/.xinitrc 內的 scim -d是注釋掉的;
但任何的程式一執行,便會有輸入法的圖示在工作條上出現,關掉時即時消失;
請看背景程式的的scim的執行情況
ps aux|grep scim (without scim -d in .xinitrc) wrote: |
ac 9709 0.0 0.5 10124 2576 ? Ss 15:07 0:00 /usr/lib/scim-1.0/scim-launcher -d -c simple -e all -f socket --no-stay
ac 9716 0.0 0.3 5792 1912 ? Ss 15:07 0:00 /usr/lib/scim-1.0/scim-helper-manager
ac 9717 0.0 1.6 38080 8340 ? Ssl 15:07 0:00 /usr/lib/scim-1.0/scim-panel-gtk --display :0.0 -c socket -d --no-stay
|
這種情況下fontforge的鍵盘組合鍵不正常!!
~/.xinitrc 內有scim -d;
輸入法的圖示在工作條上永遠出現,就算我在Terminal下kill,之後也會再次出現;
請看背景程式的的scim的執行情況
ps aux|grep scim (with scim -d in .xinitrc) wrote: |
ac 9483 0.0 0.5 10268 2600 ? Ss 15:21 0:00 /usr/lib/scim-1.0/scim-launcher -d -c simple -e all -f socket --no-stay
ac 9485 0.0 0.5 11504 3080 ? Ss 15:21 0:00 /usr/lib/scim-1.0/scim-launcher -d -c socket -e socket -f x11
ac 9488 0.0 0.3 5788 1908 ? Ss 15:21 0:00 /usr/lib/scim-1.0/scim-helper-manager
ac 9489 0.0 1.6 39472 8516 ? Ssl 15:21 0:00 /usr/lib/scim-1.0/scim-panel-gtk --display :0.0 -c socket -d --no-stay
|
這些是在scim 1.2.1下才發現的情況。
Now i am under GNU/Debian same XFCE 4.2, when i comment out the scim -d in ~/.xinitrc, firefox is show up with not scim(1.0.2) at the same time.
|
|
|
Back to top |
|
|
akar Bodhisattva
Joined: 03 Dec 2004 Posts: 348 Location: HKSAR,China
|
Posted: Tue Mar 29, 2005 2:40 am Post subject: |
|
|
locale settings & env settings
please refer to my first post, and i enter the Desktop Environment [X.org 6.8.1, XFCE4.2] via startx
fontforge version:
it is the bleeding edge 20050310 version, but the problem reproduced nomatter the version.
etc. :
I will produce more the system information, such as gcc and its flags later i return home.
Akar C to George, Arne --- Mar 22 wrote: |
I have debug the fontforge under Gentoo, with scim 1.0.1 installed and running.
I found when C^V pressed, the gdb screen show me NOthing changes,
until i attempt to paste via mouse right-click.
the string i have copied from leafpad. "U+3AF0"
Sorry i do not found "xlsatoms"
AKar
=======================gdb screen ========================
root@room fontforge-20050309 # gdb /usr/local/bin/fontforge
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host
libthread_db library "/lib/libthread_db.so.1".
(gdb) r -new
Starting program: /usr/local/bin/fontforge -new
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
[Thread debugging using libthread_db enabled]
[New Thread -1213319584 (LWP 8511)]
Copyright (c) 2000-2005 by George Williams.
Executable based on sources from 15:20 9-Mar-2005.
Program received signal SIGTSTP, Stopped (user).
[Switching to Thread -1213319584 (LWP 8511)]
0xffffe410 in ?? ()
(gdb) b gxdraw.c:3813
Breakpoint 1 at 0xb7fd65dd: file gxdraw.c, line 3813.
(gdb) c
Continuing.
Program received signal SIGTSTP, Stopped (user).
0xffffe410 in ?? ()
(gdb) c
Continuing.
Breakpoint 1, GXDrawSelectionHasType (w=0x8580488, sn=sn_clipboard,
typename=0xb7fdcda3 "UTF8_STRING") at gxdraw.c:3813
3813 return( true );
(gdb) p gd->seltypes.cnt
$1 = 8
(gdb) p gd->seltypes.types[0]
$2 = 343
(gdb) p gd->seltypes.types[1]
$3 = 268
(gdb) p gd->seltypes.types[2]
$4 = 342
(gdb) p gd->seltypes.types[3]
$5 = 31
(gdb) p gd->seltypes.types[4]
$6 = 453
(gdb) p gd->seltypes.types[5]
$7 = 384
(gdb) p gd->seltypes.types[6]
$8 = 233
(gdb) p gd->seltypes.types[7]
$9 = 578
(gdb) p gd->seltypes.types[8]
$10 = 1048576
(gdb) p gd->seltypes.types[9]
$11 = 113
(gdb)
|
thank you. _________________ AKar |
|
Back to top |
|
|
|