Skip to main content

2024-07-26

One-liner

Our science is always about finding approximate truths. --- Einstein · Kyanite


Today, I received an email from Stack Overflow. I realized that ever since I started using ChatGPT, I haven't logged into Stack Overflow. Before GPT, Stack Overflow was the site I visited the most to look up solutions to my problems.

Arch Linux Font Priority Configuration

On Arch Linux, you can prioritize specific fonts by setting up font configuration files. Here are the steps:

  1. View Installed Fonts:

    Use fc-list to view the family names of installed fonts.

    fc-list :family | sort | uniq
  2. Create Font Configuration File: Create or edit the /etc/fonts/local.conf file to set font priorities.

    sudo vim /etc/fonts/local.conf
  3. Configure Font Priorities: Add the following content to the local.conf file:

    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <fontconfig>
    <!-- Prioritize LXGW Wenkai font for displaying Chinese -->
    <match>
    <test name="lang" compare="contains">
    <string>zh</string>
    </test>
    <edit name="family" mode="prepend">
    <string>LXGW Wenkai</string>
    </edit>
    </match>

    <!-- Prioritize JetBrains Mono font for displaying English -->
    <match>
    <test name="lang" compare="not_contains">
    <string>zh</string>
    </test>
    <edit name="family" mode="prepend">
    <string>JetBrains Mono</string>
    </edit>
    </match>
    </fontconfig>
  4. Refresh Font Cache: Save and close the file, then refresh the font cache to apply the changes:

    fc-cache -fv

After configuring this, the system will prioritize using the LXGW Wenkai font to display Chinese and the JetBrains Mono font to display English. If you notice that the fonts are not correctly applied in some applications, you may need to manually specify these fonts in the application's font settings.