https://bugs.documentfoundation.org/show_bug.cgi?id=172728
Bug ID: 172728
Summary: Closing a document with embedded fonts leaves stale
font-matching state: later documents referencing the
same family name lose CJK glyph fallback (rendered as
.notdef boxes)
Product: LibreOffice
Version: 26.2.4.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: graphics stack
Assignee: [email protected]
Reporter: [email protected]
Description:
Since the embedded-font lifecycle rework ("Keep track of documents' embedded
fonts, and unregister them on unload", Aug 2025, shipped in 26.2), embedded
fonts are correctly unregistered when the owning document closes — the font no
longer leaks into later documents (great!). However, some name-keyed matching
state survives the release: in the same soffice process, a later document that
merely references the same family name (without embedding it) is substituted
incorrectly — the substitution lands on a Latin-only default (DejaVu Sans /
Liberation Serif) and, critically, per-glyph CJK fallback never runs, so CJK
text renders as .notdef boxes.
Steps to Reproduce:
Attachments:
carrier.docx — embeds a font whose family name is "Malgun Gothic" (the attached
font is NanumMyeongjo (OFL) with renamed name-table entries, so the attachment
is redistributable; the behavior is identical with a real Microsoft Malgun
Gothic embedded by Word's "Embed fonts in the file")
probe.docx — plain document that only references family "Malgun Gothic"
(w:rFonts, no embedded fonts) with Korean text
On a Linux system where "Malgun Gothic" is NOT installed (tested on Debian with
fonts-noto-cjk + fonts-nanum installed):
Control run (fresh process): soffice --headless --convert-to pdf probe.docx →
pdffonts probe.pdf shows Noto Sans CJK / Noto Serif; Korean text renders
correctly (missing family resolved by substitution + glyph fallback).
Bug run (one process, carrier first): soffice --headless --convert-to pdf
carrier.docx probe.docx → carrier.pdf correctly uses the embedded font. →
probe.pdf now embeds ONLY DejaVuSans + LiberationSerif — no CJK font at all —
and every Korean character renders as a notdef box (tofu).
Actual Results:
After the carrier document closes, lookups of "Malgun Gothic" short-circuit to
a Latin default and skip glyph fallback; Korean text is lost (tofu).
Expected Results:
Same result as the control run: substitution to an installed CJK-capable font
(e.g. Noto Sans CJK KR) with working glyph fallback, i.e. closing a document
must leave the process's font matching in the same state as if the document had
never been opened.
Reproducible: Always
User Profile Reset: Yes
Additional Info:
This looks closely related to the unregister-on-unload work (see also
tdf#167849, which fixed embedded fonts being dropped across concurrently loaded
documents): EmbeddedFontsHelper::releaseFonts removes the font but the
name→match cache entry created while the font was alive is left dangling.
--
You are receiving this mail because:
You are the assignee for the bug.