Commit 774a538
committed
feat(FR-2719): use language-appropriate Noto CJK font for PDF body
The previous CI build of the Korean PDF embedded WenQuanYiZenHei (a
Chinese fontconfig fallback) for the body text instead of a proper
Korean font. The cause was a two-part gap:
1. The release workflow installed only the single-face fonts pdf-lib
needs for header/footer stamping (fonts-nanum / fonts-takao-gothic /
fonts-thai-tlwg). Chromium's HTML rendering needs a different set
of fonts that match what the CSS font-family list requests.
2. The CSS in styles.ts and styles-web.ts requested 'Noto Sans KR/JP'
only, never 'Noto Sans CJK KR/JP/TC'. fonts-noto-cjk on Ubuntu only
registers the latter family names, so even with the package installed
Chromium would fall through to fontconfig's sans-serif default
(WenQuanYiZenHei).
Fixes:
- workflow: add fonts-noto-cjk to the apt install list and run fc-cache
so Chromium picks the proper CJK face when rendering HTML.
- styles.ts: extend the body font-family with 'Noto Sans CJK KR/JP/TC'.
Add :lang(ja) and :lang(th) overrides so the per-language <html lang>
attribute selects the language-appropriate Noto CJK face (the
KR/JP/TC faces differ in kanji/hanja glyph style) instead of always
falling back to the Korean face.
- styles-web.ts: same family extension so the docs website matches.
Verified locally with pdffonts on a freshly rebuilt v26.4.7 set:
ko → NotoSansCJKkr-Regular/Bold (was WenQuanYiZenHei)
ja → NotoSansCJKjp-Regular/Bold (was NotoSansCJKkr fallback)
th → Loma + Loma-Bold + Loma-Oblique (was WenQuanYiZenHei + partial Loma)
en → NotoSansCJKkr (Latin coverage)
The v26.4.7 release assets have been re-uploaded with the corrected
build via `gh release upload --clobber`.1 parent 2f17a09 commit 774a538
3 files changed
Lines changed: 43 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
270 | 278 | | |
271 | 279 | | |
272 | 280 | | |
273 | 281 | | |
274 | 282 | | |
| 283 | + | |
275 | 284 | | |
| 285 | + | |
276 | 286 | | |
277 | 287 | | |
278 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
24 | 43 | | |
25 | 44 | | |
26 | 45 | | |
| |||
0 commit comments