The root cause is not fonts-katex itself but font caches holding
placeholder entries for its .woff/.woff2 files: only "file" and
"fontwrapper", no family and no charset. They are written by a
fontconfig built with the fontations backend:

- Google Chrome 154 bundles fontconfig 2.18.3, whose cache writer replaces 
~/.cache/fontconfig/*.cache-9 with symlinks to its own .cache-12 files, and 
fontconfig 2.17.1 reads them: 
https://gitlab.freedesktop.org/fontconfig/fontconfig/-/work_items/565
- On a fresh Kubuntu 26.04.1 install (image 20260826.1) the 
/var/cache/fontconfig/*.cache-9 file for /usr/share/fonts/truetype/katex 
already had these placeholders for all 40 .woff/.woff2 files, dated at image 
build time, although the archive's fontconfig 2.17.1 has no fontations and 
writes full entries for the same files.

A placeholder wins every match (hence `fc-match sans` -> KaTeX_AMS-
Regular.woff above), and Qt 6.10 then crashes in FcCharSetHasChar()
because it does not check that the fallback pattern has a charset. Qt
fixed that upstream (qtbase 80ddc8dee6a0) but not in 6.10; SRU request
for qt6-base: bug 2168504.

A lighter workaround than purging fonts-katex, since the same fonts are
installed as .ttf: reject the web font files in
~/.config/fontconfig/conf.d/70-no-webfonts.conf

  <?xml version="1.0"?>
  <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
  <fontconfig><selectfont><rejectfont>
    <glob>*.woff</glob><glob>*.woff2</glob>
  </rejectfont></selectfont></fontconfig>

then run `sudo fc-cache -r -s` and `fc-cache -r`. It keeps working after
Chrome rewrites its cache.

(Analysed with the help of an AI assistant, Claude.)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2168311

Title:
  Default-installed fonts-katex crashes fontconfig (FcCharSetHasChar);
  Plasma won't start

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/node-katex/+bug/2168311/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to