https://bugs.documentfoundation.org/show_bug.cgi?id=173918

            Bug ID: 173918
           Summary: FILESAVE PDF: the .notdef box of a character missing
                    from all fonts is no longer drawn since 26.8 (font
                    subset loses the .notdef outline)
           Product: LibreOffice
           Version: 26.8.0.3 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Keywords: regression
          Severity: normal
          Priority: medium
         Component: Printing and PDF export
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 209010
  --> https://bugs.documentfoundation.org/attachment.cgi?id=209010&action=edit
Reproducer (flat ODT): A<U+0378>B, A<U+10FFFD>B and AB in Liberation Sans

Description:
Since 26.8, a character that no installed font covers is exported to PDF as an
empty gap. Up to 26.2 the PDF showed the font's .notdef glyph (the "missing
character" box). LibreOffice 26.8 itself still renders the box (for instance
with --convert-to png), so the exported PDF no longer matches what the
application displays, and characters silently disappear from the output.

Steps to Reproduce:
1. Take the attached notdef-not-drawn.fodt: three paragraphs in Liberation Sans
36 pt, "A<U+0378>B", "A<U+10FFFD>B" and "AB". U+0378 is an unassigned code
point and U+10FFFD a private-use one; no font has a glyph for them.
2. soffice --headless --convert-to pdf notdef-not-drawn.fodt
3. Open the PDF in any viewer.

Actual Results:
26.8.0.3 and 26.8.1.1: nothing is drawn between A and B in the first two
paragraphs. The advance is kept (a 27 pt gap), only the outline is gone. Same
result with poppler 25.03 and MuPDF 1.27.2.

Expected Results:
The .notdef box between A and B, as in the PDF exported by 26.2.6.3, and as in
the PNG that 26.8.1.1 produces from the same file (soffice --headless
--convert-to png). See the attached comparison.

Reproducible: Always

User Profile Reset: Yes (fresh profile for every run)

Additional Info:
This is a regression. The Liberation Sans subset embedded in the PDF shows the
difference:
- 26.2.6.3: .notdef has 2 contours, and so has the glyph standing for the
uncovered character;
- 26.8.0.3 and 26.8.1.1: both have 0 contours.

It most likely comes from commit 76095f9252 "Use HarfBuzz subsetter to subset
fonts for PDF" (first released in 26.8.0). PhysicalFontFace::CreateFontSubset()
in vcl/source/font/PhysicalFontFace.cxx calls hb-subset with
HB_SUBSET_FLAGS_DEFAULT, and hb-subset drops the outline of .notdef unless
HB_SUBSET_FLAGS_NOTDEF_OUTLINE is set. As of 2026-10-10 that flag appears
neither on master nor on libreoffice-26-8.

Tested with the official TDF .deb builds on Debian 13 (x86-64), headless
conversion, fresh user profile, and a private fontconfig that only contains
LiberationSans-Regular.ttf (fonts-liberation 2.1.5), so that no other font can
interfere:

Version: 26.8.1.1 (X86_64)
Build ID: bf6ef2662401c7d6dce671ab4deb26ee0af3a7c1
-> bug

Version: 26.8.0.3 (X86_64)
Build ID: bce0998afefdbc355585ca324285661a2170ba77
-> bug

Version: 26.2.6.3 (X86_64)
Build ID: 8221e31b3ac356a1623c672912a3d2b492f7e3d1
-> OK

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to