Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

123.7. noto-cjk-prefer-ja-1

Noto Sans CJK JP first for sans-serif, serif and monospace — Japanese Han glyph forms

The build-state snapshot was taken from 1-1; this recipe is 1-2, so the size, time and contents below describe the earlier build.

1-2 · MIT · 0.1 SBU · 445 B, 1 file · 41_system, 529 of 1047 · ports/core/fonts/noto-cjk-prefer-ja

Homepage: https://github.com/notofonts/noto-cjk

Why it is in KDOS. The comment above the 3 ports from noto-cjk-prefer-ja to noto-cjk-prefer-ko in script/phases/41_system/packages.d/fonts.txt:

One per CJK language group: a fontconfig default that puts that language's Noto Sans CJK variant first for text that names no language, which is all of it in an en_US session. Without one, Han text takes the Korean glyph forms.

A fontconfig default with no source of its own: it makes noto-cjk’s Japanese variant the first CJK face of sans-serif, serif and monospace, so Han text the program has not tagged with a language is drawn with Japanese glyph forms. The lang-ja group installs it. A KDOS session runs with LANG=en_US.UTF-8, so no CJK language reaches fontconfig unless a document names one, and 70-noto-cjk.conf only acts on a language; without this port the first CJK face fontconfig reaches is Noto Sans CJK KR for sans-serif and Noto Sans Mono CJK KR for monospace, whatever the reader’s language.

Depends on: noto-cjk.

Required by: no port names it.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install noto-cjk-prefer-ja'

build.sh:

install -dm755 $PKG/etc/fonts/conf.d
cat > $PKG/etc/fonts/conf.d/64-noto-cjk-prefer-ja.conf <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <alias>
    <family>sans-serif</family>
    <prefer><family>Noto Sans CJK JP</family></prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer><family>Noto Sans CJK JP</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Noto Sans Mono CJK JP</family></prefer>
  </alias>
</fontconfig>
XML

The recipe writes /etc/fonts/conf.d/64-noto-cjk-prefer-ja.conf, one <alias><prefer> per generic family (Noto Sans CJK JP for sans-serif and serif, Noto Sans Mono CJK JP for monospace). A prefer is inserted just before the generic name, after every face an earlier file preferred, so the number decides where the face lands. At 64 it comes after 56-noto-preferred.conf, 57-dejavu-*.conf and 60-latin.conf, which keep Latin, Greek, Cyrillic and the other scripts on their own faces, and before fontconfig’s 65-nonlatin.conf, whose sans-serif and monospace lists name Noto Sans CJK KR. Numbered 65 or later, the file would place the Japanese face after KR in those two lists, and only serif would change. 70-noto-cjk.conf still runs after it, so text that does carry a CJK language keeps that language’s variant.

With two of the three installed, the lower file name comes first: ja before ko before zh.