Ubuntu 시스템 sublime 3 중국어 입력

전재 하 다 http://doc.polarwin.cn/tutorial/Ubuntu_sublime3_chinese_input.html
본문 이 완전히 복 제 된 위의 문장
Ubuntu sublime 3 설치 및 중국어 입력 문제 해결
설치
우선 원본 추가:
sudo add-apt-repository ppa:webupd8team/sublime-text-3

그리고 업데이트:
sudo apt-get update

그리고 설치:
sudo apt-get install sublime-text-installer

2 중국어 입력 문제 해결
우선 필요 한 패 키 지 를 설치 합 니 다.
sudo apt-get install build-essential libgtk2.0-dev

그리고 sublime 라 는 이름 을 만 듭 니 다.imfix. c 의 c 파일, 내용 은 다음 과 같 습 니 다.
 #include <gtk/gtkimcontext.h>

 void gtk_im_context_set_client_window(GtkIMContext *context, GdkWindow *window)
 {
       GtkIMContextClass *klass;

       g_return_if_fail(GTK_IS_IM_CONTEXT(context));

       klass = GTK_IM_CONTEXT_GET_CLASS(context);

       if (klass->set_client_window)
               klass->set_client_window(context, window);

       g_object_set_data(G_OBJECT(context), "window",window);

       if(!GDK_IS_WINDOW(window))
               return;

       int width  = gdk_window_get_width(window);
       int height = gdk_window_get_height(window);

       if(width != 0 && height != 0)

       gtk_im_context_focus_in(context);
}

그리고 컴 파일:
gcc -shared -o libsublime-imfix.so sublime_imfix.c  `pkg-config --libs --cflags gtk+-2.0` -fPIC

그리고 libsublime - imfix. so 를 sublime 로 복사 합 니 다.텍스트 가 있 는 폴 더:
sudo mv libsublime-imfix.so /opt/sublime_text/

수정 / usr / bin / suble 파일:
sudo vim /usr/bin/subl

내용 은 다음 과 같다.
LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text "$@"

그리고 디 렉 터 리 / usr / share / applications / 에 들 어가 서 파일 sublime - text. desktop 을 수정 합 니 다.
sudo vim /usr/share/applications/sublime-text.deskto

Exec = / opt / sublimetext/sublime_text% F 변경:
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F"

Exec = / opt / sublimetext/sublime_text – n 변경:
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n"

Exec = / opt / sublimetext/sublime_text –command new_file 변경:
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file"

같은 장 / opt / ublimetext 경로 의 sublimetext. desktop 은 같은 방식 으로 수정 합 니 다.
3 등 폭 글꼴 설정
기본 설정 메뉴 Settings - User: {
“font_face”: “Courier New”, “font_size”: 14.0
}

좋은 웹페이지 즐겨찾기