random findings by wt8008
RSS icon Home icon
  • Chinese Characters in Flash

    Posted on July 17th, 2009 wt8008 No comments

    With flash, Chinese (font) characters show up as boxes instead of the character itself. To remedy the issue

     $ sudo rm /etc/fonts/conf.d/69-language-selector-zh-cn.conf

    I don’t like the shipped configuration default for Ubuntu CN anymore. Don’t worry this is only removing a symbolic link.

    Create a new file /etc/fonts/conf.d/63-wqy-zenhei.conf and populate it with

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <alias>
    <family>sans-serif</family>
    <prefer>
    <family>WenQuanYi Zen Hei</family>
    </prefer>
    </alias>
    <alias>
    <family>monospace</family>
    <prefer>
    <family>WenQuanYi Zen Hei</family>
    </prefer>
    </alias>
    </fontconfig>

    This files adds the WenQuanYi Zen Hei font to the sans-serif and monospace font families.

    Next, in the 30-cjk-aliases.conf file accept the WenQuanYi Zen Hei font as acceptable mappings to Windows fonts such as SimSum and MingLiu. Make sure that the font is first, as the system will pick the font by ordering. A sample snippet of affected areas

    <!-- Aliases for Simplified Chinese Windows fonts -->
    <alias>
    <family>SimSun</family>
    <family>NSimSun</family>
    <family>SimSun-18030</family>
    <family>NSimSun-18030</family>
    <family>宋体</family>
    <family>AR MingtiM GB</family>
    <accept><family>WenQuanYi Zen Hei</family></accept>
    <accept><family>AR PL UMing CN</family></accept>
    <accept><family>AR PL ShanHeiSun Uni</family></accept>
    </alias>
    <!-- Aliases for Traditional Chinese Windows fonts -->
    <alias>
    <family>MingLiU</family>
    <family>細明體</family>
    <family>PMingLiU</family>
    <family>新細明體</family>
    <family>AR MingtiM BIG-5</family>
    <accept><family>WenQuanYi Zen Hei</family></accept>
    <accept><family>AR PL UMing TW</family></accept>
    <accept><family>AR PL ShanHeiSun Uni</family></accept>
    </alias>
    <alias>
    <family>標楷體</family>
    <accept><family>WenQuanYi Zen Hei</family></accept>
    <accept><family>AR PL UKai TW</family></accept>
    <accept><family>AR PL ZenKai Uni</family></accept>
    </alias>
    <!-- Alias for HKSCS -->
    <alias>
    <family>Ming (for ISO10646)</family>
    <accept><family>WenQuanYi Zen Hei</family></accept>
    <accept><family>AR PL UMing HK</family></accept>
    <accept><family>AR PL ShanHeiSun Uni</family></accept>
    </alias>

    Now, Chinese charaters in font work correctly without editing 49-sansserif.conf to map unknown fonts to sans instead of sans-serif. The solution which others have suggested created an issue with the font of a buddy on pidgin.

    Leave a reply