June 25, 2010

A hack to allow editing the charset and the lang in a font on fontconfig

Background

fontconfig is scanning a font and gathering the information to see what kind of character sets it's possible to support. being used to pick up the certain font according to  a request from a user. having said that all of the fonts doesn't necessarily have certain coverage of the glyphs for certain character sets. so given that missing glyphs are not a big deal or still looks good with a fallback font for them, there should be needs to use such fonts for the certain language anyway.

Syntax

After this hack, two elements are available. <charset> to update the character sets information a.k.a. FcCharSet and <langset> to update the language coverage information a.k.a. FcLangSet. in either case, the element has to have the language name that is available as orth file in fontconfig but without .orth suffix, as CDATA. it looks like:

<match target="scan"> <test name="family"> <string>HanaMin</string> </test> <edit name="charset" mode="assign" binding="strong"> <charset>ja</charset> </edit> <edit name="lang" mode="assign" binding="strong"> <langset>ja</langset> </edit> </match>

And you have to run fc-cache again to re-generate the fontconfig cache file because the above rule only affects the scan phase. then starting to match HanaMin for serif:lang=ja in this case. which originally has zh-hk, zh-mo and zh-tw coverage.

Code

See private git repo

June 1, 2010

How to reset the background on GNOME desktop (with unusual way...)

ニッチな需要かもだけど、どうなってんのという感じで。

背景画像や背景色の変更はGNOME上ではgnome-appearance-propertiesで行う。ここを一度でも変えると個々人の設定として記録される。ディストリビューションによっては毎リリースごとテーマを変えてくるものもあり、新しいバージョン入れた!って気分を味わえなくてつまらないので、これを強制的にリセットする方法を探してみた。

といってもそんな大した話ではないけど、まずひとつ。/desktop/gnome/background/picture_filenameというキーがあって、こいつをクリアすると背景画像がデフォルトのものに戻る。が、しかし、再びgnome-appearance-propertiesを起動すると設定したものへまた戻ってしまう。
で、もうひとつ。$HOME/.gnome2/backgrounds.xmlというファイル。ここにも背景画像、背景色に関する情報が記録される。両方消すとデフォルトのものが正しく適用されるようになる。

おしまい。

May 20, 2010

Fedora yum repository for Mozc available

I've just created yum repository metadata for Mozc on my fedorapeople space. you can install the latest package after installing mozc.repo file under /etc/yum.repo.d on your system.


Currently it contains the binary rpms for i686 and x86_64 only on Fedora 12 and 13. but not for ppc nor ppc64 because unfortunately the build failed.

For another news,  started to include mozc-config in the package. though I pondered to make another package for that, it was difficult to do so because it requires the build environment of Mozc for header files and static libraries and objects.

Enjoy,

[Update: 2010/05/28]: fixed a fail on i386 box to fetch the metadata via yum; sorry for inconvenience.
[Update: 2010/06/22]: fixed the repo file and URL because it has been changed due to the restructure of the package.

March 17, 2010

ドリンククーラー

オフィスが暑すぎる。買ったドリンクも途端に温くなる。イケてない。ということで、昨日BUY NOWしたブツが早速届いた。昨日の夕方注文して、午前中には届いていたので、予想よりだいぶ早かった。

とりあえず箱。

中身。
保冷の場合はファンが回る。音はほとんど気にならない。ノートPCでちょっと勢いよくファンが回転したぐらいの音か?
保温時にはファンは回らないらしい。




サイズは缶が密着するぐらいのサイズ。なので、ちょっと太めのペットボトルなんかはアウト。とりあえずポカリスエットぐらいのサイズは入った。取説には一応、「350ml缶のように、本体内側金属部に接していないと、保温・保冷効果が低い場合があります」と注意書きが書いてあるが、現状では入りさえすれば問題なさそう。
缶もペットボトルも冷たい状態を保持しつづけてる。
温いものを入れた場合の冷却具合は試していないが、時間をかければいけそうな気もする。まあ保温・保冷目的のガジェットなのであまり期待しない方がいいかもしれない。