Bug 63028

Summary: Provide font embedding for slideshows
Product: POI Reporter: Andreas Beeker <kiwiwings>
Component: SL CommonAssignee: POI Developers List <dev>
Severity: enhancement    
Priority: P2    
Version: 4.0.x-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: PPTX with embedded font
PPT with embedded font

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


[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