Font embedding

Home Forums Open-Xml-Sdk Font embedding

This topic contains 0 replies, has 1 voice, and was last updated by  jamesl 5 years, 4 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #7908

    jamesl
    Participant

    I’ve looked through the site and forums and wasn’t able to find information on this subject, so I do hope I’m not duplicating something that’s been asked and answered.

    We have an integrated process in our CMS that allows users to select different content — either standalone DOCX files or “pages” from the CSM — and merge it into a single document. Everything works pretty well, so of course we have a client that now wants to break things. They want to have a specific font (a Google font) used for displaying certain headers in the finished document.

    Word itself does have the ability to embed fonts, and since the above process uses empty DOCX files as templates for building the complete document (a simple “template” for CMS content, and then a master template with content placeholders for the different blocks of pages to be inserted/merged), I would have thought that just embedding a font into these templates would work. But that’s not what happens. The resulting document is “corrupt” but recoverable, but the headers are not in the specific font.

    It does appear that something of the embedded font is being carried through to the final document. In the master or content template, the font is embedded as an ODTTF file; when I look at the finished document, there are files of the same sizes in the fonts folder, but now they have DAT extension. Binary comparisons show them to be identical except for the first 32 bytes; the fontTable.xml does have an entry for the font, but there are several differences. So technically the font is there, but the document is broken and the font doesn’t appear to be used.

    Has anyone got any thoughts or suggestions on how I might go about creating a viable document with an embedded font? Does the merge process make this sort of thing impossible? If we have to tell our client that it can’t be done, that’s fine; I just want to be sure I’ve explored all options and possibilities first. Thanks.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.