sd/qa/unit/data/pdf/sciencejournalsource.pdf |binary
 sd/qa/unit/export-tests.cxx                  |   21 +++++++++++++++++++++
 2 files changed, 21 insertions(+)

New commits:
commit 617ad63bf18983df174f60a5acb57ad75d646573
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed Oct 15 13:51:04 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Fri Oct 17 08:58:26 2025 +0200

    add test that font was extracted and embedded
    
    Change-Id: I1294dfaa43cb357b15b408ca9b0c7ed55db122ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192448
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/qa/unit/data/pdf/sciencejournalsource.pdf 
b/sd/qa/unit/data/pdf/sciencejournalsource.pdf
new file mode 100644
index 000000000000..3863fd6d28c1
Binary files /dev/null and b/sd/qa/unit/data/pdf/sciencejournalsource.pdf differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 651eaa406c90..753b6e0e365f 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1202,6 +1202,27 @@ CPPUNIT_TEST_FIXTURE(SdExportTest, 
testExplodedPdfMissingFontVersion)
     CPPUNIT_ASSERT_EQUAL(u"Errare humanum est"_ustr, sText);
 }
 
+CPPUNIT_TEST_FIXTURE(SdExportTest, testExplodedPdfEmbeddedFonts)
+{
+    auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+    if (!pPdfium)
+        return;
+    UsePdfium aGuard;
+
+    loadFromFile(u"pdf/sciencejournalsource.pdf");
+
+    
setFilterOptions("{\"DecomposePDF\":{\"type\":\"boolean\",\"value\":\"true\"}}");
+    save(u"OpenDocument Drawing Flat XML"_ustr);
+
+    xmlDocUniquePtr pXmlDoc = parseExportedFile();
+
+    // The PT Serif embedded font should have been extracted and embedded into 
the fodg,
+    // ensure we have the bold variant
+    assertXPath(pXmlDoc, 
"/office:document/office:font-face-decls/style:font-face[@style:name='PT "
+                         
"Serif']/svg:font-face-src/svg:font-face-uri[@loext:font-weight='bold' "
+                         "and @loext:font-style='normal']/office:binary-data");
+}
+
 CPPUNIT_TEST_FIXTURE(SdExportTest, testEmbeddedText)
 {
     createSdDrawDoc("objectwithtext.fodg");

Reply via email to