some cjk bold font can't display in firefox

Bug #38595 reported by easthero
10
Affects Status Importance Assigned to Milestone
fontconfig (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

The cjk characters bold font can't display in firefox which use <strong>bold font</strong> html tag,the display is correct which use <b>bold font></b> html tag.
we must modify /etc/fonts/fonts.conf,modify this part

               <test target="pattern" name="weight" compare="more_eq">
                        <int>200</int>
                </test>

change "<int>200</int>" to "<int>180</int>",then The cjk characters bold font can display which use <strong>bold font</strong> html tag

Revision history for this message
atie (atie-at-matrix) wrote :

@easthero, could you test with following configuration?

 <match target="font">
        <test name="weight" compare="less_eq">
                <const>medium</const>
        </test>
        <test target="pattern" name="weight" compare="more">
                <const>medium</const>
        </test>
        <edit name="embolden" mode="assign">
                <bool>true</bool>
        </edit>
        <edit name="weight" mode="assign">
                <const>bold</const>
        </edit>
 </match>

Changed in fontconfig:
status: Unconfirmed → Confirmed
Revision history for this message
easthero (easthero) wrote :

sorry,no effective,and all Chinese characters can't display at all。

Revision history for this message
atie (atie-at-matrix) wrote :

@easthero, please attach your font configurations, let me know the URL you tested.

Revision history for this message
easthero (easthero) wrote :

this is my $HOME/.fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <match target="pattern" >
  <test name="family" qual="any" >
   <string>serif</string>
  </test>
  <edit mode="append" binding="strong" name="family" >
   <string>Bitstream Vera Serif</string>
  </edit>
 </match>
 <match target="pattern" >
  <test name="family" qual="any" >
   <string>sans-serif</string>
  </test>
  <edit mode="append" binding="strong" name="family" >
   <string>Bitstream Vera Sans</string>
  </edit>
 </match>
 <match target="pattern" >
  <test name="family" qual="any" >
   <string>monospace</string>
  </test>
  <edit mode="append" binding="strong" name="family" >
   <string>Bitstream Vera Sans Mono</string>
  </edit>
 </match>
 <alias>
  <family>serif</family>
  <prefer>
   <family>Bitstream Vera Serif</family>
   <family>SimSun</family>
   <family>WenQuanYi Bitmap Song</family>
   <family>AR PL New Sung</family>
  </prefer>
 </alias>
 <alias>
  <family>sans-serif</family>
  <prefer>
   <family>Bitstream Vera Sans</family>
   <family>SimSun</family>
   <family>WenQuanYi Bitmap Song</family>
   <family>Tahoma</family>
   <family>AR PL New Sung</family>
  </prefer>
 </alias>
 <alias>
  <family>monospace</family>
  <prefer>
   <family>Bitstream Vera Sans Mono</family>
   <family>SimSun</family>
   <family>WenQuanYi Bitmap Song</family>
   <family>AR PL New Sung</family>
  </prefer>
 </alias>
<!-- disable antialias when font size lessthan<17 pixelsize --> <match target="font" >
  <test name="family" >
   <string>SimSun</string>
   <string>AR PL New Sung</string>
   <string>AR PL ShanHeiSun Uni</string>
  </test>
  <test compare="more_eq" name="pixelsize" >
   <double>12</double>
  </test>
  <test compare="less_eq" name="pixelsize" >
   <double>16</double>
  </test>
  <edit mode="assign" name="antialias" >
   <bool>false</bool>
  </edit>
 </match>
<!--Enable "hinting & autohint" for all fonts. --> <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="autohint" >
   <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hinting" >
   <bool>true</bool>
  </edit>
 </match>
 <match target="font" >
  <edit mode="assign" name="hintstyle" >
   <const>hintmedium</const>
  </edit>
 </match>
</fontconfig>

Revision history for this message
Abel Cheung (abelcheung) wrote :

easthero, do you mean ALL chinese chars can't be displayed, including bold or non-bold ones?

Btw, Michael, I have created a sample test page that demonstrates this problem. After installing chinese fonts, visit this page:

http://deaddog.org/~deaddog/boldfont.html

This is screenshot captured without atie's config:

http://paste.ubuntu-nl.org/12821

The 2nd line and 3rd line in test page are both marked as bold, but the chinese letters in right hand side differ; one is emboldened and one is not.

The problem is, when using CSS style "style='font-weight: bold'", the font weight in fontconfig becomes 200, and hence becomes emboldened as requested in /etc/fonts/fonts.conf. But when sentences are enclosed inside <b> and </b>, the font weight is only 180 (semibold), and synthetic embolden glyph is not turned on.

Revision history for this message
easthero (easthero) wrote :

I mean use <strong></strong> tag can't display bold,use <b></b> and style='font-weight: bold is normal

Revision history for this message
easthero (easthero) wrote :

sorry for my mistake,I tested again,when <int>200</int>,use <b> and <strong> tags,chinese bold can't display,only use css "font-weight: bold" can display normal
here is my test file http://linuxfire.com.cn/~easthero/cjktest/test.html
here is my snapshot
use <int>200</int> http://linuxfire.com/~easthero/cjktest/200.png
use <int>180</int> http://linuxfire.com/~easthero/cjktest/180.png

Revision history for this message
easthero (easthero) wrote :

sorry,the snapshot url is error,the correct is here:
use <int>200</int> http://linuxfire.com.cn/~easthero/cjktest/200.png
use <int>180</int> http://linuxfire.com.cn/~easthero/cjktest/180.png

Revision history for this message
easthero (easthero) wrote :

this happen only in firefox,in konquror all is normal

Revision history for this message
easthero (easthero) wrote :

please close this issue ... all is normal

Revision history for this message
easthero (easthero) wrote :

this bug is resolved by version upgrade .. upgrade

Changed in fontconfig:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.