ラベル 日本語入力 の投稿を表示しています。 すべての投稿を表示
ラベル 日本語入力 の投稿を表示しています。 すべての投稿を表示

2016年4月14日木曜日

Rxvt-unicodeのフォント設定

Rxvt-nicord の設定


以前からRxvt-unicodeのフォント設定をしているのですが、採集はこうなりました。
以前に Rxvt-unicode の設定を公開してからなんだか納得いかなくてちょいちょい変更 してます。個人的にフォントが小さいのが好みなんですけどあまりにも小さなフォント を設定すると imFont を設定しないと日本語入力が出来なくなるんですよね。そして imFont には xft が指定出来ないという… 

前は Ricty を全面に押し出していたんですけど、そこも変更しました。 pixelsize=14 となってますが Roboto Mono for Powerline だと他のフォントの16ぐらいってのは言い過ぎかもしれませんけど、大きめで豆粒のようにはなりません。

xft.dpi:  96
Xft.autohint: 0
Xft.lcdfilter:  lcddefault
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1

URxvt*termName:  xterm-256color
URxvt*depth:  24
URxvt*saveLIne:  300000
URxvt*geometry:  120x35
URxvt*perl-ext-common: default,matcher,clipboard-osc
URxvt*inputMethod: uim
URxvt*imLocale:  en_US.UTF-8
URxvt*url-launcher: chromium
URxvt*matcher*button: 1

URxvt*foreground: #B2B2B2
URxvt*background: #202020

URxvt*color0:  #2e3436
URxvt*color1:  #cc0000
URxvt*color2:  #4edc4e
URxvt*color3:  #c4a000
URxvt*color4:  #3465a4
URxvt*color5:  #75507b
URxvt*color6:  #06989a
URxvt*color7:  AntiqueWhite
URxvt*color8:  Grey25
URxvt*color9:  Red
URxvt*color10:  #00ff00
URxvt*color11:  Yellow
URxvt*color12:  #5c5cff
URxvt*color13:  Magenta
URxvt*color14:  Cyan
URxvt*color15:  White

URxvt*lefterSpace: -1
URxvt*lineSpace: 0


URxvt.font:              xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:antialiase=true
URxvt.boldfont:          xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:bold:antialiase=true
URxvt.italicfont:        xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:italic:antialiase=true
URxvt.bolditalicfont:    xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true:bold:italic,xft:Ricty:pixelsize=14:bold:italic:antialiase=true

以上、です。また気分で変える可能性がありますけど…

2016年4月12日火曜日

Rxvt-unicode再設定

Rxvt-unicodeフォント設定変更


以前に Rxvt-unicode の設定を公開してからなんだか納得いかなくてちょいちょい変更してます。個人的にフォントが小さいのが好みなんですけどあまりにも小さなフォントを設定すると imFont を設定しないと日本語入力が出来なくなるんですよね。そして imFont には xft が指定出来ないという…

前は Ricty を全面に押し出していたんですけど、そこも変更しました。 pixelsize=14 となってますが Roboto Mono for Powerline だと他のフォントの16ぐらいってのは言い過ぎかもしれませんけど、大きめで豆粒のようにはなりません。

xft.dpi:               96
Xft.autohint:           0
Xft.lcdfilter:         lcddefault
Xft.hintstyle:         hintfull
Xft.hinting:            1
Xft.antialias:          1

URxvt*termName:        xterm-256color
URxvt*depth:           24
URxvt*saveLIne:        300000
URxvt*geometry:        120x35
URxvt*perl-ext-common: default,matcher,clipboard-osc
URxvt*inputMethod:     uim
URxvt*imLocale:        en_US.UTF-8
URxvt*url-launcher:    chromium
URxvt*matcher*button:   1

URxvt*foreground:      #B2B2B2
URxvt*background:      #202020

URxvt*color0:          #2e3436
URxvt*color1:          #cc0000
URxvt*color2:          #4edc4e
URxvt*color3:          #c4a000
URxvt*color4:          #3465a4
URxvt*color5:          #75507b
URxvt*color6:          #06989a
URxvt*color7:          AntiqueWhite
URxvt*color8:          Grey25
URxvt*color9:          Red
URxvt*color10:         #00ff00
URxvt*color11:         Yellow
URxvt*color12:         #5c5cff
URxvt*color13:         Magenta
URxvt*color14:         Cyan
URxvt*color15:         White

URxvt*lefterSpace:    -1
URxvt*lineSpace:       0


URxvt.font:              xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:antialiase=true
URxvt.boldfont:          xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:bold:antialiase=true
URxvt.italicfont:        xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:italic:antialiase=true
URxvt.bolditalicfont:    xft:Roboto\ Mono\ for\ Powerline:pixelsize=14:antialiase=true:bold:italic,xft:Ricty:pixelsize=14:bold:italic:antialiase=true
以上、です。また気分で変える可能性がありますけど…

2016年3月26日土曜日

rxvt-unicodeのフォント再設定

.Xresourceの設定


今の .Xresource 設定です。

URxvt*termName:         xterm-256color
URxvt*depth:            24
URxvt*saveLIne:         300000
URxvt*geometry:         120x35
URxvt*perl-ext-common:  default,matcher,clipboard-osc
!URxvt*perl-ext-common: default,matcher,clipboard-osc,xim-onthespot
URxvt*inputMethod:      uim
URxvt*imLocale:         en_US.UTF-8
!URxvt*preeditType:     OnTheSpot
!URxvt*preeditType:     OverTheSpot
URxvt*url-launcher:     chromium
URxvt*matcher*button:   1

URxvt*foreground:       #B2B2B2
URxvt*background:       #202020
!URxvt*background:      black

URxvt*color0:           #2e3436
URxvt*color1:           #cc0000
URxvt*color2:           #4edc4e
URxvt*color3:           #c4a000
URxvt*color4:           #3465a4
URxvt*color5:           #75507b
URxvt*color6:           #06989a
URxvt*color7:           AntiqueWhite
URxvt*color8:           Grey25
URxvt*color9:           Red
URxvt*color10:          #00ff00
URxvt*color11:          Yellow
URxvt*color12:          #5c5cff
URxvt*color13:          Magenta
URxvt*color14:          Cyan
URxvt*color15:          White

URxvt*lefterSpace:      -1
URxvt*lineSpace: 0

URxvt.font:              xft:Terminus:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:antialiase=true
URxvt.boldfont:          xft:Terminus:piselsize=14:antialiase=true:bold,xft:Ricty:pixelsize=14:bold:antialiase=true
URxvt.italicfont:        xft:Terminus:piselsize=14:antialiase=true:italic,xft:Ricty:pixelsize=14:italic:antialiase=true
URxvt.bolditalicfont:    xft:Terminus:piselsize=14:antialiase=true:bold:italic,xft:Ricty:pixelsize=14:bold:italic:antialiase=true
URxvt.imFont:            -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1

Powerlineを使っているのでTerminusを優先にしています。RictyにPowerlineのパッチを適用しても良いのですが好みの感じにならなかったので、こうしてます。pixelsize=14とかなり文字は小さいので辛いって人はサイズ大きくすると良いかも。またTerminusを最初に持ってきていてpixselsize=14だとrxvt-unicode (urxvt) だと日本語変換 (OnTheSpot) で変換出来ないので imFont を設定しています。

しかし、どうしてか Ricty にパッチあててもうまくいかないんだよな。

2015年8月13日木曜日

uim-mozcやめました

uim-mozcやめました

最初は気に入っていたのですが、賢すぎて emerge -C mozc ってしちゃいました。おバカなと言っては失礼だけど Anthy に戻りました。

まだまだ辞書も鍛えてないので変換は滅茶苦茶ですけど、これから育てます。一種の育成ゲーム?

2015年7月28日火曜日

Chromium 44 + uim の挙動が変

Chromium 44 と uim の相性

Chromium 44 で uim を利用すると文字入力が変になります。mozc, anthy であればアドレスバーに1文字だけ入力し Enter をタイプするとそのまま検索されちゃいます。チャットなどの文字入力欄では1文字だけ入力して Enter で確定すると、そのままポストされる状態です。

これが SKK になるともっとひどい動きになります。

対策

Gentoo では問題のなかったバージョンである Chromium 43 系の ebuild ファイルが portage ツリーから消えているのでパッチ適用でしのぎます。もちろん独自 Overlay で 43 系の ebuild ファイルを用意しても良いのですが、可能なら新しいのが使いたいってなもんです。

さて、問題は次の Issue で報告され Closed になってます。
Issue 1257003002: OnPreeditChanged should update the internal composition after checking it. (Closed)
これを参考にパッチを作ります。以下のようになりました。

diff -urPN a/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux.cc b/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux.cc
--- a/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux.cc       2015-07-16 05:30:08.000000000 +0900
+++ b/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux.cc       2015-07-28 06:59:15.478133281 +0900
@@ -236,8 +236,6 @@
   if (suppress_next_result_ || IsTextInputTypeNone())
     return;
 
-  composition_ = composition_text;
-
   if (is_sync_mode_) {
     if (!composition_.text.empty() || !composition_text.text.empty())
       composition_changed_ = true;
@@ -245,6 +243,8 @@
     SendFakeProcessKeyEvent(0);
     GetTextInputClient()->SetCompositionText(composition_text);
   }
+
+  composition_ = composition_text;
 }
 
 void InputMethodAuraLinux::OnPreeditEnd() {
diff -urPN a/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux_unittest.cc b/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux_unittest.cc
--- a/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux_unittest.cc      2015-07-16 05:30:08.000000000 +0900
+++ b/chromium-44.0.2403.89/ui/base/ime/input_method_auralinux_unittest.cc      2015-07-28 07:09:14.228367499 +0900
@@ -606,6 +606,18 @@
   test_result_->ExpectAction("compositionstart");
   test_result_->ExpectAction("compositionupdate:a");
   test_result_->Verify();
+
+  // crbug.com/513124.
+  context_->SetSyncMode(true);
+  context_->SetEatKey(true);
+  context_->AddCommitAction("c");
+  context_->AddCompositionUpdateAction("");
+  input_method_auralinux_->DispatchKeyEvent(key);
+
+  test_result_->ExpectAction("keydown:229");
+  test_result_->ExpectAction("compositionend");
+  test_result_->ExpectAction("textinput:c");
+  test_result_->Verify();
 }
 
 TEST_F(InputMethodAuraLinuxTest, MixedAsyncAndSyncTest) {

これを /etc/portage/patches/www-client/chromium-44.0.2403.89/ に拡張子を .patch にして適当な名前で保存します。chromium の ebuild には epatch_user が記載されているので、これで emerge を実施すれば自動でパッチが適用されコンパイルされます。

ここで掲載したパッチの利用は自己責任でお願いします。急がない方はバックポートされるらしいので、それまで uim から他の物に乗り換えるなどした方が安全だと思います。

2015年6月5日金曜日

Gentooでuim-mozcを利用する

Arch Linuxなどにはuim-mozcが標準で用意されているのですが、Gentooには男前なのか(?)標準では用意されていません。そこでPORTDIR_OVERLAYを使ってuim-mozcを導入しちゃいます。

wjn-overlay とうOverlayを利用します。

以下、すべて root 権限で実施します。

# mv -p /usr/local/portage/wjn-overlay
# git clone https://bitbucket.org/wjn/wjn-overlay.git /usr/local/portage/wjn-overlay

# vi /etc/portage/make.conf に PORTDIR_OVERLAY="/usr/local/portage/wjn-overlay"
を追加します。

すると、equery コマンドで uim の文字が出るようになります。
equery u mozc
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for app-i18n/mozc-2.17.2097.102:
 U I
 - - clang                    : Use sys-devel/clang for building
 - - emacs                    : Enable support for virtual/emacs
 - - fcitx                    : Enable support for app-i18n/fcitx
 - - ibus                     : Enable support for app-i18n/ibus
 + + python_targets_python2_7 : Build with Python 2.7
 + + qt4                      : Add support for the Qt GUI/Application Toolkit version 4.x
 - - renderer                 : Enable native candidate window
 - - test                     : Enable src_test phase for runtests
 + + uim                      : Enable support for app-i18n/uim

では、この状態で emerge -av mozc を実施します。
ibus とか他の IM は終了して .xinitrc などに以下のように書きます。

export XMODIFIERS=@im=uim                    
export GTK_IM_MODULE=uim
export QT4_IM_MODULE=uim                                
export QT_IM_MODULE=uim                                
export DefaultIMmodule=uim
これで X を再起動したら日本語の入力で mozc が利用可能になっているはずです。
それでは快適な日本語入力ライフを!

2015年3月9日月曜日

新しいエディタ

ぶらぶらしていると ne (http://ne.di.unimi.it/) という中々良さげなエディタを見つけたので紹介します。一番の売りは動作が軽いのに各種言語のシンタックスハイライトに対応していることでしょうか。

こんな感じでメニューも用意されていてヘビーユーザだけでなくライトユーザでも満足できるエディタになっていると思ってます。軽量なので mutt のような好きなエディタをメールの編集に使えるソフトでのメールを書くエディタにしても良さそうです。

2014年11月15日土曜日

rxvt-unicode またの名を urxvt の .Xresources 公開

タイトルのままです。rxvt-unicode (urxvt) の設定を曝け出します。これ変だよってのが、あればご指摘下さい。この状態で OnTheSpot で日本語入力が出来ています。

URxvt*termName:  xterm-256color
URxvt*depth:  24
URxvt*saveLIne:  300000
URxvt*geometry:  120x35
URxvt*perl-ext-common: default,matcher,clipboard-osc
!URxvt*perl-ext-common: default,matcher,clipboard-osc,xim-onthespot
URxvt*inputMethod: uim
URxvt*imLocale:  en_US.UTF-8
!URxvt*preeditType: OnTheSpot
!URxvt*preeditType: OverTheSpot
URxvt*url-launcher: chromium
URxvt*matcher*button: 1
URxvt*foreground: #DCDCCD
URxvt*background: #2C2C2C
URxvt*color0:  #3F3F3F
URxvt*color1:  #705050
URXvt*color2:  #60B48A
URxvt*color3:  #DFAF8F
URxvt*color4:  #9AB9D7
URxvt*color5:  #DC8CC4
URxvt*color6:  #8CD1D3
URxvt*color7:  #DCDCCD
URxvt*color8:  #709080
URxvt*color9:  #DCA3A3
URxvt*color10:  #72D5A2
URxvt*color11:  #F0DFAF
URxvt*color12:  #94C0F3
URxvt*color13:  #EC93D5
URxvt*color14:  #93E1E3
URxvt*color15:  #FFFFFF

URxvt*lefterSpace: -1
URxvt.font:              xft:Ricty:size=12:antialiase=true
URxvt.boldFont:          xft:Ricty:bold:size=12:antialiase=true
URxvt.italicFont:        xft:Ricty:italic:size=12:antialiase=true
URxvt.bolditalicFont:    xft:Ricty:bold:italic:size=12:antialiase=true
!URxvt.imFont:            7x14
こうした方が良いよってあれば教えてください。

2014年10月29日水曜日

やっぱり SKK なのか

UIM と Anthy の組み合わせで Linux で日本語入力を行なってきましたが、もとは SKK ユーザなので入力方式を Anthy から SKK に変更しました。

最近の SKK 辞書の SKK-JISYO.L には annotation が付加されていて変換するときに意味が表示されるようになっていて驚きました。

SKK ではありませんが uim を mozc に対応したものもあるんですねぇ。残念なことに Gentoo にはありませんが… ebuild 作れよって話ですが。

Vim での文字コード自動判断

どこかからいただいたもので、以下のようにしてました。

"--------------------------------------------------------------------------------
" 文字コードの自動認識
if &encoding !=# 'utf-8'
set encoding=japan
set fileencoding=japan
endif
if has('iconv')
let s:enc_euc = 'euc-jp'
let s:enc_jis = 'iso-2022-jp'
" iconvがeucJP-msに対応しているかをチェック
if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'eucjp-ms'
let s:enc_jis = 'iso-2022-jp-3'
" iconvがJISX0213に対応しているかをチェック
elseif iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'euc-jisx0213'
let s:enc_jis = 'iso-2022-jp-3'
endif
" fileencodingsを構築
if &encoding ==# 'utf-8'
let s:fileencodings_default = &fileencodings
let &fileencodings = s:enc_jis .','. s:enc_euc
if s:fileencodings_default =~ 'utf-8'
let &fileencodings = &fileencodings .','. s:fileencodings_default
let &fileencodings = substitute(&fileencodings, "utf-8", "utf-8,cp932", "g")
else
let &fileencodings = s:enc_jis .','. s:enc_euc ,', cp932'
let &fileencodings = &fileencodings .',cp932,'. s:fileencodings_default
endif
unlet s:fileencodings_default
else
let &fileencodings = &fileencodings .','. s:enc_jis
set fileencodings+=utf-8,ucs-2le,ucs-2
if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)#39;
set fileencodings+=cp932
set fileencodings-=euc-jp
set fileencodings-=euc-jisx0213
set fileencodings-=eucjp-ms
let &encoding = s:enc_euc
let &fileencoding = s:enc_euc
else
let &fileencodings = &fileencodings .','. s:enc_euc
endif
endif
" 定数を処分
unlet s:enc_euc
unlet s:enc_jis
endif
" 日本語を含まない場合は fileencoding に encoding を使うようにする
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
" 改行コードの自動認識
set fileformats=unix,dos,mac
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
set ambiwidth=double
endif
"--------------------------------------------------------------------------------
が最近文字化けが発生するようになりました。思いあたるのは Vim をバージョンアップしたぐらいなのですが、とにかく文字化けはストレスが溜るので次のように変更しちゃいました。

"-----------------------------------------------------------------------------
" 文字コード関連
set encoding=utf-8
set fileencodings=ucs-bom,iso-2022-jp-3,iso-2022-jp,eucjp-ms,euc-jisx0213,euc-jp,sjis,cp932,utf-8
" 改行コードの自動認識
set fileformats=unix,dos,mac
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
    set ambiwidth=double
endif
"-----------------------------------------------------------------------------
いまのところ誤判定もなくファイルを開くことが出来ています。時間があるときに見直したいと思います。

2014年10月22日水曜日

uim, anthyのカスタマイズ

UIM って多くは GUI で設定出来るけど .uim ファイルでないと設定出来ない事もあるんですよね。そこで私が設定している .uim を公開します。大した設定をしてないです…

(require "japanese.scm")
(define ja-space '(" " " " " "))
(define ja-alnum-space '(" " " "))

(require "japanese.scm")
  (define ja-rk-rule (append '(
    ((("(") . ()) ("(" "(" "("))
    (((")") . ()) (")" ")" ")"))
    ((("{") . ()) ("{" "{" "{"))
    ((("}") . ()) ("}" "}" "}"))
    ((("|") . ()) ("|" "|" "|"))
    ((("\\\\") . ()) ("\\\\" "\\\\" "\\\\"))
    ((("@") . ()) ("@" "@" "@"))
  )
ja-rk-rule))


(define uim-pref-suppress-dot-uim-warning-dialog? #t)


最後の「(define uim-pref-suppress-dot-uim-warning-dialog? #t)」は GUI の設定画面でメッセージを出さないためのものです。