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

123.9. noto-cjk-prefer-ko-1

Noto Sans CJK KR first for sans-serif, serif and monospace — Korean 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, 531 of 1047 · ports/core/fonts/noto-cjk-prefer-ko

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 Korean 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 Korean glyph forms. The lang-ko 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. Fontconfig’s own 65-nonlatin.conf already reaches the KR faces first for sans-serif and monospace, but its serif list names Noto Serif CJK KR, which is not installed, so serif falls through to Noto Sans CJK JP; this port makes all three Korean rather than leaving them to the order of those lists.

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-ko'

build.sh:

install -dm755 $PKG/etc/fonts/conf.d
cat > $PKG/etc/fonts/conf.d/64-noto-cjk-prefer-ko.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 KR</family></prefer>
  </alias>
  <alias>
    <family>serif</family>
    <prefer><family>Noto Sans CJK KR</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>Noto Sans Mono CJK KR</family></prefer>
  </alias>
</fontconfig>
XML

The recipe writes /etc/fonts/conf.d/64-noto-cjk-prefer-ko.conf, one <alias><prefer> per generic family (Noto Sans CJK KR for sans-serif and serif, Noto Sans Mono CJK KR 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. Running first, this file makes the Korean face the first CJK face of all three lists for text with no language, and it lands at the same place as its Japanese and Chinese counterparts. 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.