Ubuntu12.04
安装ibus-fbterm-0.9.1
有没有朋友想在真正的终端(console)下显示并输入中文,我想肯定是有的,比如我自己就研究过好一阵,结果还初见成效,这里分享一点自己的小经验。目前可行的方案有:
fbterm+ucimf
fbterm+ibus-fbterm (通用)
fbterm+fcitx-fbterm
fbterm+yong
这里就介绍最通用的一种,屡试不爽噢!
直接用ubuntu12.04的官方源安装基本组件
sudo
ibus-fbterm
wget
tar
./configure
make
64bit系统会出现一个bug,
display.c: 在函数‘calculate_status_win’中:
display.c:215:23: 错误: ‘IBusProperty’没有名为‘label’的成员
display.c: 在函数‘draw_status_bar’中:
display.c:241:43: 错误: ‘IBusProperty’没有名为‘label’的成员
display.c:241:69: 错误: ‘IBusProperty’没有名为‘label’的成员
display.c:242:8: 错误: ‘IBusProperty’没有名为‘label’的成员
make[1]: *** [ibus_fbterm-ibus-fbterm.o] 错误 1
make[1]:正在离开目录 `/usr/local/src/ibus-fbterm-0.9.1/src'
###############################################
解决方法,/src/display.c
###############################################
https://aur.archlinux.org/packages.php?ID=36078
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-i18n/ibus-fbterm/files/ibus-fbterm-0.9.1-ibus-1.4.1.patch?view=diff&r1=text&tr1=1.1&r2=text&tr2=1.1&diff_format=s
上有高人朋友已经给出了解决办法。
Thannks for your reporting. I found out it is becase ibus upgrade its API, according to https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=771115. I already infomation the author to ask him to make a upgrade. And I do my little try, you may want to test it if you are really in harry. But I am not very sure whether I make it right.
************************************
Here is diff of display.c:
215,216c215
<
< w += text_width(ibus_property_get_label(prop)->text);
---
> w += text_width(prop->label->text);
242,244c241,242
< draw_text(x, y, COLOR_FG, COLOR_BG, ibus_property_get_label(prop)->text,
< strlen(ibus_property_get_label(prop)->text));
< x += FW(text_width(ibus_property_get_label(prop)->text));
---
> draw_text(x, y, COLOR_FG, COLOR_BG, prop->label->text, strlen(prop->label->text));
> x += FW(text_width(prop->label->text));
************************************
就是display.c文件中要改几个地方,改完后再编译就可顺利通过,以下是替换后的display.c
----------------------------------------
enum { AuxiliaryTextWin = 0, LookupTableWin, StatusBarWin };
static unsigned short cursor_x, cursor_y;
static Rectangle auxiliary_text_win, lookup_table_win, status_bar_win;
static const Info info;
#define FW(x) ((x) * info.fontWidth)
#define FH(y) ((y) * info.fontHeight)
#define SW (info.screenWidth)
#define SH (info.screenHeight)
#define MARGIN 5
#define GAP 5
#define WIN_HEIGHT (FH(1) + 2 * MARGIN)
#define WIN_INTERVAL (WIN_HEIGHT + GAP)
#define COLOR_BG Gray
#define COLOR_FG Black
#define COLOR_ACTIVE_CANDIDATE DarkBlue
struct interval {
};
static char bisearch(unsigned ucs, const struct interval *table, unsigned max)
{
}
static char is_double_width(unsigned ucs)
{
}
static inline unsigned short get_cursor_y()
{
}
static void utf8_to_utf16(unsigned char *utf8, unsigned short *utf16)
{