Bug 63028 - Provide font embedding for slideshows
Summary: Provide font embedding for slideshows
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SL Common (show other bugs)
Version: 4.0.x-dev
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-21 00:21 UTC by Andreas Beeker
Modified: 2018-12-28 23:48 UTC (History)
0 users



Attachments
PPTX with embedded font (688.27 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2018-12-21 00:23 UTC, Andreas Beeker
Details
PPT with embedded font (745.00 KB, application/vnd.ms-powerpoint)
2018-12-21 00:24 UTC, Andreas Beeker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Beeker 2018-12-21 00:21:13 UTC
The project [1] which brought me to POI has some font embedding functionality [2].
My goal is now to provide convenience methods for XSLF and helper classes for HSLF (not sure, if the unknown font records also contain MTX fonts), to embed fonts.

In POI, I can only provide the interface to integrate the converted/compiled MTX fonts - similar to PJs poi-shared-strings project, I forked [3] and will provide a sfntly project [4] to convert and embed the truetype fonts. Although google put the code under ASF license, I think it's better to keep it outside our trunk.

A bit off-topic:
With things like the SVG-support (with huge a dependency to batik, which is not listed in the poms on purpose), signature support (with dependencies to bouncycastle / xmlsec) and Apache service mix changes (which we don't track), I think about a place how to provide those non-core features in a more user-friendly way. I have two problems with that, either it's forked code (but with an ASL) or it's simply blowing our dist files with dependencies. We had already discussions about that, but outsourcing the implementations to private github repos is also not so convincing ...



[1] https://github.com/kiwiwings/pptx-shape-exporter

[2]
https://stackoverflow.com/questions/47920767/how-to-add-custom-fonts-in-apache-poi-ppt
https://mail-archives.apache.org/mod_mbox/poi-user/201310.mbox/%3C525B017B.90804@gmx.de%3E

[3] https://github.com/googlei18n/sfntly
[4] https://github.com/kiwiwings/sfntly
Comment 1 Andreas Beeker 2018-12-21 00:23:54 UTC
Created attachment 36341 [details]
PPTX with embedded font
Comment 2 Andreas Beeker 2018-12-21 00:24:26 UTC
Created attachment 36342 [details]
PPT with embedded font
Comment 3 Andreas Beeker 2018-12-28 23:48:01 UTC
Applied via r1849898

There's a new SlideShow.addFont(InputStream fontData) method, i.e. it works for XSLF and HSLF.

For the glyph subsetting, I've provided the SlideShowExtractor.getCodepoints(...) methods.

The example project which shows how to use sfntly and POI together is in https://github.com/kiwiwings/poi-font-mbender