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

            Bug ID: 173919
           Summary: FILESAVE PDF: a space set in a bitmap emoji font (Noto
                    Color Emoji, CBDT) is embedded as a TrueType font
                    without glyf/loca tables since 26.8; poppler draws a
                    box
           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 209011
  --> https://bugs.documentfoundation.org/attachment.cgi?id=209011&action=edit
Reproducer (flat ODT): two emoji and the space between them in Noto Color Emoji

Description:
When text set in Noto Color Emoji (the CBDT/CBLC build, e.g. Debian's
fonts-noto-color-emoji) contains a space, PDF export embeds two fonts for it: a
Type 3 font for the emoji and a TrueType subset (FontFile2) for the space.
Since 26.8 that TrueType subset has no 'glyf' and no 'loca' table.
FreeType-based consumers reject such a font program, and viewers disagree on
the result: poppler draws a tall empty box in place of every space, MuPDF
reports an error and leaves the space blank.

Steps to Reproduce:
1. Have the CBDT build of Noto Color Emoji installed (Debian/Ubuntu package
fonts-noto-color-emoji; tested with 2.051).
2. Take the attached emoji-font-space.fodt: one paragraph "x<U+1F600>
<U+1F600>x" where the two emoji AND the space between them are in font "Noto
Color Emoji"; the two x are in Liberation Sans.
3. soffice --headless --convert-to pdf emoji-font-space.fodt
4. Run pdffonts on the PDF, then render it with poppler (pdftoppm, or a
poppler-based viewer).

Actual Results:
26.8.0.3 and 26.8.1.1:
- pdffonts lists "DAAAAA+NotoColorEmoji  TrueType  WinAnsi  emb sub". The
embedded font file only contains OS/2, cmap, head, hhea, hmtx, maxp, name and
post (1052 bytes, 2 glyphs): no glyf, no loca.
- poppler 25.03 draws an empty box where the space is (attached comparison).
- MuPDF 1.27.2 prints "FT_New_Memory_Face(DAAAAA+NotoColorEmoji): locations
(loca) table missing" and leaves the space blank.
- Ghostscript 10.05.1 renders the page without complaint.

Expected Results:
A usable font program for the space, as in 26.2.6.3: there the same subset
contains cmap, glyf, head, hhea, hmtx, loca, maxp, name and post (2120 bytes,
two empty glyphs) and every viewer shows a plain blank.

Reproducible: Always

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

Additional Info:
This is a regression, most likely from commit 76095f9252 "Use HarfBuzz
subsetter to subset fonts for PDF" (first released in 26.8.0). The CBDT font
has no glyf, loca or CFF table at all. PhysicalFontFace::CreateFontSubset() in
vcl/source/font/PhysicalFontFace.cxx keeps only head, hhea, hmtx, loca, maxp,
glyf, CFF, post, name, OS/2, cvt, fpgm and prep, so nothing carrying outlines
is left, and the result is still written out as a TrueType FontFile2. The
previous subsetter always wrote glyf and loca.

Only fonts without outline tables seem affected: ordinary TrueType fonts used
for nothing but spaces (Arial Bold, Times New Roman Italic, Courier New,
Carlito and Liberation Serif Bold Italic were tried) still get glyf and loca in
26.8.1.1.

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) and NotoColorEmoji.ttf
(fonts-noto-color-emoji 2.051-0+deb13u1):

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