Monday, July 16, 2007

Chinese fonts in Linux ( blur when antialias is true )

If you install your Linux box with English as the primary language, you will notice the Chinese fonts are blurred and hard to read. That is due to anti-aliasing of Chinese characters. I would NOT recommend to disable all font anti-aliasing in Font Preferences, because anti-alias is good and it makes many fonts look easier for eyes, just not Chinese characters when they are small.

The solution is so set false for Chinese fonts under a specific font size. Create a file called local.conf under /etc/fonts/ directory
vi /etc/fonts/local.conf

and copy and paste the following to the file:
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

<!-- Disable font alias for Chinese <= 18px -->

<match target="font">

<test qual="any" name="family" compare="eq">

<string>AR PL Mingti2L Big5</string>

<string>AR PL SungtiL Big5</string>

<string>AR PL New Sung</string>

<string>AR PL ShanHeiSun Uni</string>

<string>AR PL ZenKai Uni</string>

<string>Ming(ISO10646)</string>

<string>MingLiu</string>

<string>PMingLiu</string>

<string>Kochi Mincho</string>

<string>Baekmuk Dotum</string>

</test>

<test name="pixelsize" compare="less_eq">

<double>18</double>

</test>

<edit name="antialias">

<bool>false</bool>

</edit>

<edit name="hinting">

<bool>true</bool>

</edit>

</match>

<alias>

<family>serif</family>

<prefer>

<family>Bitstream Vera Serif</family>

<family>Times New Roman</family>

<family>Times</family>

<family>AR PL New Sung</family>

<family>AR PL ShanHeiSun Uni</family>

<family>AR PL Mingti2L Big5</family>

<family>AR PL SungtiL GB</family>

<family>SimSun</family>

</prefer>

</alias>

<alias>

<family>sans-serif</family>

<prefer>

<family>Bitstream Vera Sans</family>

<family>Arial</family>

<family>Verdana</family>

<family>Helvetica</family>

<family>AR PL New Sung</family>

<family>AR PL ShanHeiSun Uni</family>

<family>AR PL kaitiM Big5</family>

<family>AR PL kaitiM GB</family>

</prefer>

</alias>

<alias>

<family>monospace</family>

<prefer>

<family>Bitstream Vera Sans Mono</family>

<family>Courier New</family>

<family>Courier</family>

<family>AR PL New Sung</family>

<family>AR PL ShanHeiSun Uni</family>

</prefer>

</alias>

</fontconfig>

Thursday, June 21, 2007

wordpress import return admin.php

When importing wordpress to wordpress database, there are several problems I encountered.

  1. Unable to create directory "uploads"

  2. If your xml file is big, it forces you to download the admin.php after pressing the "Upload file and import" button.


Fixes:


  1. change mode of your upload directory to writable (chmod 777 uploads)

  2. edit the apache php.ini file to increase the file upload limits

    1. vi /etc/php5/apache2/php.ini

    2. change "memory_limit" from 8M to 20M, or more

    3. change "upload_max_filesize" from 5M to 20M, or more

    4. restart your apache server: /etc/init.d/apache restart





After all these modifications, you should be able to import your wordpress xml file. Good luck!