I am trying to insert the font family (not system fonts) in the docx file.
I am using openxml-sdk to achieve this functionality.
Somehow I am able to get the font information from a particular docx file. But not able to embed the font family in the document
Is it possible to embed the font in a docx file using code?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, it trivial for docx.
MS Word have check-box for that [http://www.howtogeek.com/howto/microsoft-office/embed-true-type-fonts-in-word-and-powerpoint-2007-documents/].
To do this programmatically, investigate first simple DOCX with and without font, and compare the differences.
FYI: docx it is just .zip file, just change extension of both files to .zip and compare they content. If you done this - than you will see additional "font" directory with font files, plus one XML which have references to them.
I don't have please of code, but developing one will be simple.
Note, not all font licenses allow embedding, like http://www.word-2010.com/embedding-fonts-in-word-2010/, but this is separate question.