Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] fontconfig rejection of ugly japanese fonts?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
tholin
Apprentice
Apprentice


Joined: 04 Oct 2008
Posts: 203

PostPosted: Thu Jul 11, 2013 7:18 pm    Post subject: [Solved] fontconfig rejection of ugly japanese fonts? Reply with quote

I'm trying to prevent opera from using ugly japanese fonts. The only font I want to use for japanese is arial unicode ms but opera likes to pick other fonts if they are available.

Playing with the settings in opera doesn't work so I'm trying to work around the problem with fontconfig.
First I tried to increase the priority of arial unicode over all other fonts in the file 65-nonlatin.conf but that didn't work.
Next I tried to blacklist all unicode fonts except arial unicode using two different techniques but none of them worked.


Code:
99-blacklist-japanese.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <selectfont>
          <rejectfont>
            <pattern>
              <patelt name="family"><string>Baekmuk Gulim</string></patelt>
              <patelt name="family"><string>AR PL UMing CN</string></patelt>
              <patelt name="family"><string>AR PL UMing HK</string></patelt>
              <patelt name="family"><string>AR PL UMing TW</string></patelt>
              <patelt name="family"><string>AR PL UMing TW MBE</string></patelt>
              <patelt name="family"><string>Sazanami Gothic</string></patelt>
              <patelt name="family"><string>AR PL UKai CN</string></patelt>
              <patelt name="family"><string>AR PL UKai HK</string></patelt>
              <patelt name="family"><string>AR PL UKai TW</string></patelt>
              <patelt name="family"><string>AR PL UKai TW MBE</string></patelt>
              <patelt name="family"><string>AR PL SungtiL GB</string></patelt>
              <patelt name="family"><string>AR PL Mingti2L Big5</string></patelt>
            </pattern>
          </rejectfont>
        </selectfont>
</fontconfig>

Code:
99-blacklist-japanese.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <selectfont>
        <rejectfont>*/ukai.ttc</rejectfont>
        <rejectfont>*/uming.ttc</rejectfont>
        <rejectfont>*/gulim.ttf</rejectfont>
    </selectfont>
</fontconfig>


Are there any way of blacklisting them that works? I've made sure opera parse my fontconfig settings and it respects the hinting at least. I have "Prefer Fontconfig Settings" set to true in opera's opera:config.

Running fc-match -s will also list the ugly fonts.

The only way I've been able to work around this problem is to delete the fonts but they get reinstalled all the time.

Here is the content of /etc/fonts/conf.d:
20-fix-globaladvance.conf
20-unhint-small-vera.conf
30-metric-aliases.conf
30-urw-aliases.conf
42-luxi-mono.conf
45-latin.conf
49-sansserif.conf
51-local.conf
60-latin.conf
69-unifont.conf
80-delicious.conf
90-synthetic.conf
99-blacklist-japanese-try2.conf
README

They haven't been modified besides 99-blacklist-japanese-try2.conf

Code:
/etc/fonts/local.conf

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">

  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>

  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>

  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>

  <edit mode="assign" name="hintstyle">
   <const>hintfull</const>
  </edit>

  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>

  <edit mode="assign" name="lcdfilter">
    <const>lcdlight</const>
  </edit>

 </match>
</fontconfig>


Last edited by tholin on Thu Jul 11, 2013 11:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Jul 11, 2013 8:25 pm    Post subject: Reply with quote

About what fonts are you saying?
Webpages fonts or fonts that using for opera's menus, panels, window and tabs titles?
Back to top
View user's profile Send private message
tholin
Apprentice
Apprentice


Joined: 04 Oct 2008
Posts: 203

PostPosted: Thu Jul 11, 2013 8:29 pm    Post subject: Reply with quote

Fonts in web pages.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Thu Jul 11, 2013 8:34 pm    Post subject: Reply with quote

Webpages fonts depends on the contents of .css files. Each web page has it's own .css file that describes which font to use, their sizes, styles and so on.
You can try to disable pages styles in opera settings, but it drops all the formatting for pages.
Back to top
View user's profile Send private message
tholin
Apprentice
Apprentice


Joined: 04 Oct 2008
Posts: 203

PostPosted: Thu Jul 11, 2013 11:48 pm    Post subject: Reply with quote

I found a way to reject the fonts in fontconfig with <glob>.
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <selectfont>
        <rejectfont><glob>/usr/share/fonts/arphicfonts*</glob></rejectfont>
        <rejectfont><glob>/usr/share/fonts/baekmuk-fonts*</glob></rejectfont>
        <rejectfont><glob>/usr/share/fonts/sazanami*</glob></rejectfont>
        <rejectfont><glob>/usr/share/fonts/kanjistrokeorders*</glob></rejectfont>
    </selectfont>
</fontconfig>

Now opera and everything else ignore those fonts. I would have preferred a way to force arial unicode only when using japanese but this will do.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Jul 12, 2013 1:16 am    Post subject: Reply with quote

tholin wrote:

Now opera and everything else ignore those fonts. I would have preferred a way to force arial unicode only when using japanese but this will do.

You just marked these fonts as not installed. And got only one font for your system, not for web pages only.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum