Tom,
I seem to find a list of fonts contained in Pages '09 v4.3 through v5.5.3 documents using mdls in the Terminal:
mdls -name kMDItemFonts foobar.pages
and Word .docx documents contain their fonts in an internal fontTable.xml file.
Are these included font names simply a reference for the opening application to perform a system lookup to determine installed availability, and not actual embedding?
Here is how to get the fontnames out of a Word (.docx) document. Won't work for .doc.
unzip -p foobar.docx "word/fontTable.xml" | ./wrdfont.py
where wrdfont.py contains:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# read from standard input either via pipe, or command-line
import re
import sys
import fileinput
fonts = []
for line in fileinput.input():
afont = re.findall(r'(?<=w:name=)("[ \w+]+")>', line)
fonts.append(afont)
for name in fonts:
print("{}".format(' \n'.join(name)))
sys.exit()