Monthly Archives: May 2013

MozTW Lab 宜蘭分店開張

MozTW Lab 是什麼?

參見:[MozTW Lab – MozTW, Mozilla Taiwan Community]

宜蘭分店(支部?)資訊

候選地點

本週 MozTW Lab 宜蘭分店將辦在 6/1 9:30 於伯朗咖啡館宜蘭大學店,對,我知道這時間對於 IT 人而言太早太殘酷,不過宜蘭目前要找到晚間時段、好訂位、低消費價位、有 Wi-Fi 的場地,有點難度。

希望不久的將來我可以買到一間鄉下的老房子,這樣就可以邀大家來辦深夜 hackathon 或深夜食堂。

往後的 MozTW Lab 宜蘭分店資訊,請追蹤此討論串

My Fontconfig

~/.config/fontconfig/fonts.conf:

< ?xml version='1.0'?>
< !DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <dir>~/.fonts</dir>
 <alias>
  <family>serif</family>
  <prefer>
   <family>Bitstream Vera Serif</family>
   <family>DejaVu Serif</family>
   <family>FreeSerif</family>
   <family>Liberation Serif</family>
   <family>WenQuanYi Micro Hei</family>
  </prefer>
 </alias>
 <alias>
  <family>sans-serif</family>
  <prefer>
   <family>Bitstream Vera Sans</family>
   <family>DejaVu Sans</family>
   <family>FreeSans</family>
   <family>Liberation Sans</family>
   <family>WenQuanYi Micro Hei</family>
  </prefer>
 </alias>
 <alias>
  <family>monospace</family>
  <prefer>
   <family>Bitstream Vera Sans Mono</family>
   <family>DejaVu Sans Mono</family>
   <family>FreeMono</family>
   <family>Liberation Mono</family>
   <family>WenQuanYi Micro Hei Mono</family>
  </prefer>
 </alias>
 <!-- general configurations -->
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
  <edit mode="assign" name="lcdfilter">
   <const>lcdlegacy</const>
  </edit>
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hinting">
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintnone</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>
 <!-- For not Chinese fonts -->
 <match target="font">
  <test compare="not_contains" name="lang">
   <string>zh</string>
  </test>
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
  <edit mode="assign" name="lcdfilter">
   <const>lcdlight</const>
  </edit>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>
 <!-- WenQuanYi Micro Hei -->
 <match target="font">
  <test compare="eq" name="family">
   <string>WenQuanYi Micro Hei</string>
  </test>
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
  <edit mode="assign" name="lcdfilter">
   <const>lcdnone</const>
  </edit>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>
 <match target="font">
  <test compare="eq" name="family">
   <string>WenQuanYi Micro Hei Mono</string>
  </test>
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
  <edit mode="assign" name="lcdfilter">
   <const>lcdnone</const>
  </edit>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>
 <!--換掉文泉驛的英文部份,subpixel rendering 比較好看-->
 <match target="pattern">
  <test compare="eq" name="family">
   <string>WenQuanYi Micro Hei</string>
  </test>
  <edit binding="strong" mode="prepend" name="family">
   <string>Bitstream Vera Sans</string>
  </edit>
 </match>
 <match target="pattern">
  <test compare="eq" name="family">
   <string>WenQuanYi Micro Hei Mono</string>
  </test>
  <edit binding="strong" mode="prepend" name="family">
   <string>Bitstream Vera Sans Mono</string>
  </edit>
 </match>
 <!-- specific config -->
 <!-- bold fonts -->
 <match target="font">
  <test target="pattern" compare="more_eq" name="weight">
   <!--<test compare="more_eq" name="weight">-->
   <!--<int>180-->
   <const>semibold</const>
  </test>
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
  <edit mode="assign" name="lcdfilter">
   <const>lcddefault</const>
  </edit>
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintmedium</const>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>
 <!-- very small fonts -->
 <match target="font">
  <test compare="less_eq" name="pixelsize">
   <double>12</double>
  </test>
  <!--設定字型最小尺寸-->
  <!--<edit mode="assign" name="pixelsize">-->
  <!--<double>12-->
  <!--</edit>-->
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
</fontconfig>

這應該是我能調整的最終型態了,能讓 KDE (Qt) 與 GNOME (Gtk+) 底下的程式都有接近的、清晰的筆畫顯示品質,同時考慮到中、英文字型的 rendering 差異、大字小字、普通與粗體等。

筆記:編出給 arm-linux-androideabi 用的 libchewing

先記下目前暫時有點進展的作法,日後還是要盡可能自動處理…。

從 Android NDK 建立 toolchain:

  1. cd $HOME
  2. ~/Applications/android-ndk/build/tools/make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-clang3.2 --system=linux-x86_64 --install-dir=toolchain

編出 libchewing:

  1. cd libchewing/
  2. vim src/tools/Makefile.am 把 CC 改為指定使用電腦上的 gcc (感謝 +Wen Chun Lin 提點)
  3. sh ./autogen.sh
  4. CC=~/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc ac_cv_func_malloc_0_nonnull=yes ./configure --host=arm-linux-androideabi --prefix="$HOME/workspace/AndroidChewingIME/jni"
  5. make
  6. file ./src/.libs/libchewing.so.3.0.1 確認是 ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV),以免跟昨晚早先之前一樣空歡喜一場。
  7. make install