Skip to content

Embedding fonts #176

@simonbunge

Description

@simonbunge

Any appetite for adding embedding fonts a feature? The use case is using custom-made (corporate) font faces, which the client obviously wouldn't have installed locally.

Some initial thinking around implementation...

1. ...\ppt\slide\slideN.xml

Currently, PptxGenJS generates tags like this:

<a:latin charset="0" pitchFamily="34" typeface="Courier New"/>

In a file generated by PowerPoint 2013 with an embedded font ("Custom1" as an example typeface name) this looks like:

<a:latin charset="0" pitchFamily="2" panose="02000503020000020004" typeface="Custom1"/>

The panose tag appears to be optional in the relevant XSD, which would mean no change required on that level.

2. ...\ppt\presentation.xml

This would need to be amendeded with the following structure.

<p:embeddedFontLst>
	<p:embeddedFont>
		<p:font charset="0" pitchFamily="2" panose="02000503020000020004" typeface="Custom1"/>
		<p:regular r:id="rId7"/>
		<p:bold r:id="rId8"/>
		<p:italic r:id="rId9"/>
		<p:boldItalic r:id="rId10"/>
	</p:embeddedFont>
</p:embeddedFontLst>

3. ...\ppt\fonts\

Would need to add a folder with Embedded OpenType (EOT) .fntdata files in the archive. These binary structures could be manually be extracted from a corporate template and stored on the server to be pulled by the script through a URL. Interestingly, the above 'Custom 1' example is contained in font8.fntdata, so I don't quite understand how the referencing is done.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions