Refactor font configuration in local.conf for improved clarity and organization

This commit is contained in:
Anduin Xue 2025-05-09 10:30:54 +00:00
parent 0c188066a3
commit 4ced0bfdae
No known key found for this signature in database
GPG Key ID: D33FA9407A6BE728
2 changed files with 151 additions and 310 deletions

View File

@ -24,14 +24,6 @@ You MUST be using an `AMD64` architecture to build AnduinOS.
To edit the build parameters, modify the `./src/args.sh` file.
The first two parts of the `TARGET_BUILD_VERSION` MUST be the same as the git branch name. For example:
```bash
TARGET_BUILD_VERSION="1.1.0"
```
Then the git branch name MUST be `1.1`.
To build the OS, run the following command:
```bash

View File

@ -2,52 +2,192 @@
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<!-- Default system-ui fonts -->
<!-- Map "system-ui" to sans-serif -->
<match target="pattern">
<test name="family">
<string>system-ui</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<edit name="family" mode="prepend">
<string>sans-serif</string>
</edit>
</match>
<!-- Default sans-serif fonts-->
<!-- Default sans-serif: Latin first, then CJK-SC, then emoji -->
<match target="pattern">
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans CJK SC</string>
<edit name="family" mode="prepend">
<string>Noto Sans</string>
<string>Noto Sans CJK SC</string>
<string>Twitter Color Emoji</string>
</edit>
</match>
<!-- Default serif fonts-->
<!-- Language-specific sans-serif overrides -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-HK</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK HK</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-TW</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ja</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ko</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK KR</string>
</edit>
</match>
<!-- Default serif: Latin first, then CJK-SC, then emoji -->
<match target="pattern">
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif CJK SC</string>
<edit name="family" mode="prepend">
<string>Noto Serif</string>
<string>Noto Serif CJK SC</string>
<string>Twitter Color Emoji</string>
</edit>
</match>
<!-- Default monospace fonts-->
<!-- Language-specific serif overrides -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-HK</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-TW</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ja</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ko</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK KR</string>
</edit>
</match>
<!-- Default monospace: Cascadia Code first, then CJK-SC, then nerd, then emoji -->
<match target="pattern">
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<edit name="family" mode="prepend">
<string>Cascadia Code</string>
<string>Noto Sans Mono CJK SC</string>
<string>Symbols Nerd Font</string>
<string>Twitter Color Emoji</string>
</edit>
</match>
<!-- Language-specific monospace overrides -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-HK</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK HK</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-TW</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ja</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ko</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK KR</string>
</edit>
</match>
<!-- Program-specific override: non-Chrome requests for CJK Mono → Cascadia Code -->
<match target="pattern">
<test name="prgname" compare="not_eq">
<string>chrome</string>
@ -55,300 +195,9 @@
<test name="family" compare="contains">
<string>Noto Sans Mono CJK</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<edit name="family" mode="prepend">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-HK</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK HK</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-HK</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-HK</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK HK</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-TW</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-TW</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>zh-TW</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK TC</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ja</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ja</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ja</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK JP</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ko</string>
</test>
<test name="family">
<string>Noto Sans CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans CJK KR</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ko</string>
</test>
<test name="family">
<string>Noto Serif CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif CJK KR</string>
</edit>
</match>
<match target="pattern">
<test name="lang">
<string>ko</string>
</test>
<test name="family">
<string>Noto Sans Mono CJK SC</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Mono CJK KR</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>th</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Sans Thai</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>th</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Serif Thai</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>th</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ar</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Naskh Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ar</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" binding="strong">
<string>Noto Naskh Arabic</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>ar</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string><string>de</string><string>fr</string><string>es</string>
<string>it</string><string>pt</string><string>nl</string><string>sv</string>
<string>pl</string><string>ru</string><string>vi</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string><string>de</string><string>fr</string><string>es</string>
<string>it</string><string>pt</string><string>nl</string><string>sv</string>
<string>pl</string><string>ru</string><string>vi</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string><string>de</string><string>fr</string><string>es</string>
<string>it</string><string>pt</string><string>nl</string><string>sv</string>
<string>pl</string><string>ru</string><string>vi</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="contains">
<string>Source Code</string>
</test>
<edit name="family" binding="strong">
<string>Cascadia Code</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test name="family" compare="contains">
<string>Noto Sans CJK</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>en</string>
</test>
<test name="family" compare="contains">
<string>Noto Serif CJK</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
</edit>
</match>
</fontconfig>