You are not logged in.

#1 2012-10-04 14:12:56

stozi
Member
Registered: 2010-03-02
Posts: 148

Setting preferred Chinese font

Hi I've looked in the Wiki but I can't get this to work.

ttf-tw gives me two fonts, Song and Kai. Kai is way better but everthing defaults to Song.

thx!

Last edited by stozi (2012-10-04 14:14:12)

Offline

#2 2012-10-04 15:11:59

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Setting preferred Chinese font

You may want to edit /etc/fonts/conf.d/65-nonlatin.conf, and place the preferred font higher in hierarchy (IIRC, in the sans-serif group).


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2012-10-05 01:20:39

stozi
Member
Registered: 2010-03-02
Posts: 148

Re: Setting preferred Chinese font

Thanks! Big improvement. Doesn't seem to have effected webkit though

Offline

#4 2012-10-05 11:57:41

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Setting preferred Chinese font

This is probably not going to change much, but the TW-MOE-Std-Kai font should be placed in both 40-nonlatin.conf and 65-nonlatin.conf in serif groups, not as I suggested above in the sans-serif one. BTW, I'm puzzled as to why Midori wouldn't use the fonts specified by fontconfig... Just in case, you may want to try a couple of tricks: create a new file in /etc/fonts/conf.d/85-final-lang.conf with the following content:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>

  <match>
    <test name="lang" compare="contains">
      <string>zh</string>
    </test>
    <test name="family">
      <string>serif</string>
    </test>
    <edit name="family" mode="prepend">
      <family>TW-MOE-Std-Kai</family>
    </edit>
  </match>

</fontconfig>

This should force the use a specified font if the language code of "zh" is selected. If necessary, you may need to play with dialects, and either multiple the entire rule for each one, or replace the language line with one of the following:

<string>zh-hans</string>
<string>zh-hant</string>
<string>zh-cn</string>
<string>zh-hk</string>
<string>zh-sg</string>
<string>zh-tw</string>

If your default font is set to sans, you may also check if replacing the family line with

<string>sans-serif</string>

does the trick. Last but not least, IIRC Midori offers an option to use only the fonts you specified, so check if setting / unsetting it in Midori's settings helps.

Last edited by bohoomil (2012-10-05 18:47:49)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

Board footer

Powered by FluxBB