0

Location definition in below discussion:folder name and filename in desktop ,file manager,terminal's ui.

I installed debian and fcitx,fcitx-pinyin(for inputing Chinese character) and copy windows Microsoft font into /usr/share/fonts/msfonts,create a new folder named in the desktop,now in the GUI it displays this--It is the Japanese font "vlgothic".

增 shown in debian or arch by default

The character shown with Microsoft YaHei.

增 shown in Microsoft YaHei

In the location,how to make the Chinese character shown with Microsoft YaHei and all English character in these location shown by Hack font?

Here is my try to sole it,edit .config/fontconfig/fonts.conf with below lines:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- $XDG_CONFIG_HOME/fontconfig/fonts.conf for per-user font configuration -->
<fontconfig>

<dir prefix="xdg">fonts</dir>

<match target="font">
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
</match>
<match>
    <test name="lang" compare="eq">
        <string>en</string>
    </test>
    <edit name="family" mode="assign">
        <string>Hack</string>
    </edit>
    <edit name="family" mode="append">
        <string>Microsoft YaHei</string>
    </edit>
</match>

<match>
    <test name="lang" compare="eq">
        <string>zh</string>
    </test>
    <edit name="family" mode="assign">
        <string>Microsoft YaHei</string>
    </edit>
</match>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Microsoft YaHei</family>
    </prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Microsoft YaHei</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Microsoft YaHei</family>
    </prefer>
  </alias>
</fontconfig>

Now a new issue arise: my broser can only call "Microsoft YaHei" to render Chinese characater no matter which font is setted by html's tag font-family(same effect for English character).How to solve the issue then?
I have made the post more shorter than previous status,maybe some important info lost ,in this case ,you can watch the complete post in https://bbs.archlinux.org/viewtopic.php?id=281404.

4
  • You question is unclear: to rambling. You are focused on trying to prove that china and japan are a thing. (of course they are a thing). Instead focus on telling us what you are trying to do (are you writing the page or using the page?). And, tell us what problems you have. (I appreciate that this information may be in there, but it is too long and I did not read). Commented Nov 19, 2022 at 10:03
  • My target is more clear now than before,enjoy your reading please.
    – newview
    Commented Nov 19, 2022 at 10:33
  • I think it would be suffice to say “I’m [building or using] a site on a Debian X.y installation. I created a new folder named "增" but in the GUI it displays this:” and include the photo of Japanese font "vlgothic". Then ask how to resolve this issue. Commented Nov 19, 2022 at 12:47
  • Make it more shorted and more clean for fans to read without losing my meaning.
    – newview
    Commented Nov 19, 2022 at 13:25

1 Answer 1

0

Solved,happy to post the fonts.conf,replace Microsoft YaHei with noto-cjk.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
    <match target="font">
        <edit name="embeddedbitmap" mode="assign">
            <bool>false</bool>
        </edit>
    </match>
    <match>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Serif</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Sans</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Sans Mono</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Noto Serif CJK SC</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Noto Sans CJK SC</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Noto Sans Mono CJK SC</string>
        </edit>
    </match>
</fontconfig>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .