3

I am seeing some characters rendered strangely and would like to know what I can do to fix it.

In Google search bar, rendered strangely. Inside translate box, rendered as desired:

enter image description here

In Google Docs, Firefox or Chrome:

enter image description here

In my terminal:

enter image description here


Is it perhaps trying to render in a Japanese font automatically?

  • OS: Ubuntu 16.04
  • Browsers: Firefox & Chrome (seems to be browser independent)
  • Tested in incognito mode
3

Fixed in both my terminal and browser:

      enter image description here

Since I noticed this problem across all browsers and in my terminal, I figured the proper way to adress it would be at the system level. I found a fix here and have outlined the steps below.

  1. Navigate to /etc/fonts/conf.d/

  2. Edit 64-language-selector-prefer.conf, moving the SC suffixed fonts to the top of each preference list:

 

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>Noto Sans CJK SC</family>
            <family>Noto Sans CJK JP</family> # Original top choice
            <family>Noto Sans CJK TC</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>Noto Sans Mono CJK SC</family>
            <family>Noto Sans Mono CJK JP</family> # Original top choice
            <family>Noto Sans Mono CJK TC</family>
        </prefer>
    </alias>
</fontconfig>

 

  1. Edit 69-language-selector-zh-cn.conf, adding WenQuanYi Micro Hei font to the top of each family (serif, sans-serif, monospace):

 

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

    <match target="pattern">
        <test name="lang">
            <string>zh-cn</string>
        </test>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>WenQuanYi Micro Hei</string> # Added by me
            <string>HYSong</string>
            <string>AR PL UMing CN</string>
            <string>AR PL UMing HK</string>
            <string>AR PL New Sung</string>
            <string>WenQuanYi Bitmap Song</string>
            <string>AR PL UKai CN</string>
            <string>AR PL ZenKai Uni</string>
        </edit>
    </match> 
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <test name="lang">
            <string>zh-cn</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>WenQuanYi Micro Hei</string> # Added by me
            <string>Noto Sans CJK SC</string>
            <string>WenQuanYi Zen Hei</string>
            <string>HYSong</string>
            <string>AR PL UMing CN</string>
            <string>AR PL UMing HK</string>
            <string>AR PL New Sung</string>
            <string>AR PL UKai CN</string>
            <string>AR PL ZenKai Uni</string>
        </edit>
    </match> 
    <match target="pattern">
        <test qual="any" name="family">
            <string>monospace</string>
        </test>
        <test name="lang">
            <string>zh-cn</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>WenQuanYi Micro Hei Mono</string> # Added by me
            <string>DejaVu Sans Mono</string>
            <string>Noto Sans Mono CJK SC</string>
            <string>WenQuanYi Zen Hei Mono</string>
            <string>HYSong</string>
            <string>AR PL UMing CN</string>
            <string>AR PL UMing HK</string>
            <string>AR PL New Sung</string>
            <string>AR PL UKai CN</string>
            <string>AR PL ZenKai Uni</string>
        </edit>
    </match> 

</fontconfig>

Saving the changes and opening a new terminal, the characters are now rendered as desired:

enter image description here

After restarting the computer, one also sees the characters properly rendered in the browser:

enter image description here

0

Yes. It looks like the Japanese font. Font series called Kozuka/小塚 or Mincho/明朝 will rending it as Google Docs, Firefox or Chrome your saw. Because the characters for both Japanese and Chinese have the same Unicode U+5916 for 外 and U+5C06 for 将. Try to switch to a Chinese font instead you will see the correct rending for Chinese Simplified look.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.